patch-2.4.25 linux-2.4.25/include/asm-ppc64/irq.h

Next file: linux-2.4.25/include/asm-ppc64/machdep.h
Previous file: linux-2.4.25/include/asm-ppc64/iSeries/vio.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.24/include/asm-ppc64/irq.h linux-2.4.25/include/asm-ppc64/irq.h
@@ -15,31 +15,22 @@
 extern void disable_irq_nosync(unsigned int);
 extern void enable_irq(unsigned int);
 
-/*
- * this is the maximum number of virtual irqs we will use.
- */
-#define NR_IRQS			512
+/* Need to keep at 256 (minimum) for iSeries */
+#define NR_IRQS  256
 
-#define NUM_8259_INTERRUPTS	16
+#define MAX_IRQS (1<<24)
 
-/* Interrupt numbers are virtual in case they are sparsely
- * distributed by the hardware.
- */
-#define NR_HW_IRQS		8192
-extern unsigned short real_irq_to_virt_map[NR_HW_IRQS];
-extern unsigned short virt_irq_to_real_map[NR_IRQS];
-/* Create a mapping for a real_irq if it doesn't already exist.
- * Return the virtual irq as a convenience.
- */
-unsigned long virt_irq_create_mapping(unsigned long real_irq);
+extern unsigned int _next_irq(unsigned int irq);
 
-/* These funcs map irqs between real and virtual */
-static inline unsigned long real_irq_to_virt(unsigned long real_irq) {
-	return real_irq_to_virt_map[real_irq];
-}
-static inline unsigned long virt_irq_to_real(unsigned long virt_irq) {
-	return virt_irq_to_real_map[virt_irq];
-}
+/* Define a way to iterate across irqs fairly efficiently. */
+#define for_each_irq(i) \
+	for ((i) = 0; (i) < MAX_IRQS; (i) = _next_irq(i))
+
+
+extern void *_irqdesc(unsigned int irq);
+extern void *_real_irqdesc(unsigned int irq);
+#define irqdesc(irq) ((irq_desc_t *)_irqdesc(irq))
+#define real_irqdesc(irq) ((irq_desc_t *)_real_irqdesc(irq))
 
 /*
  * This gets called from serial.c, which is now used on
@@ -51,5 +42,34 @@
 	return irq;
 }
 
+/*
+ * Because many systems have two overlapping names spaces for
+ * interrupts (ISA and XICS for example), and the ISA interrupts
+ * have historically not been easy to renumber, we allow ISA
+ * interrupts to take values 0 - 15, and shift up the remaining
+ * interrupts by 0x10.
+ *
+ * This would be nice to remove at some point as it adds confusion
+ * and adds a nasty end case if any platform native interrupts have
+ * values within 0x10 of the end of that namespace.
+ */
+
+#define NUM_ISA_INTERRUPTS	0x10
+
+extern inline int irq_offset_up(int irq)
+{
+	return(irq + NUM_ISA_INTERRUPTS);
+}
+
+extern inline int irq_offset_down(int irq)
+{
+	return(irq - NUM_ISA_INTERRUPTS);
+}
+
+extern inline int irq_offset_value(void)
+{
+	return NUM_ISA_INTERRUPTS;
+}
+
 #endif /* _ASM_IRQ_H */
 #endif /* __KERNEL__ */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)