r6040: make printks consistent with DRV_NAME
[linux-2.6/linux-2.6-openrd.git] / include / linux / irqnr.h
blob5504a5c97836d9fb4f1fb191cd6a11cdc131c22e
1 #ifndef _LINUX_IRQNR_H
2 #define _LINUX_IRQNR_H
4 /*
5 * Generic irq_desc iterators:
6 */
7 #ifdef __KERNEL__
9 #ifndef CONFIG_GENERIC_HARDIRQS
10 #include <asm/irq.h>
11 # define nr_irqs NR_IRQS
13 # define for_each_irq_desc(irq, desc) \
14 for (irq = 0; irq < nr_irqs; irq++)
16 # define for_each_irq_desc_reverse(irq, desc) \
17 for (irq = nr_irqs - 1; irq >= 0; irq--)
18 #else /* CONFIG_GENERIC_HARDIRQS */
20 extern int nr_irqs;
21 extern struct irq_desc *irq_to_desc(unsigned int irq);
23 # define for_each_irq_desc(irq, desc) \
24 for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \
25 irq++, desc = irq_to_desc(irq)) \
26 if (desc)
29 # define for_each_irq_desc_reverse(irq, desc) \
30 for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \
31 irq--, desc = irq_to_desc(irq)) \
32 if (desc)
34 #endif /* CONFIG_GENERIC_HARDIRQS */
36 #define for_each_irq_nr(irq) \
37 for (irq = 0; irq < nr_irqs; irq++)
39 #endif /* __KERNEL__ */
41 #endif