]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/linux/irqnr.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[linux-2.6-omap-h63xx.git] / include / linux / irqnr.h
1 #ifndef _LINUX_IRQNR_H
2 #define _LINUX_IRQNR_H
3
4 /*
5  * Generic irq_desc iterators:
6  */
7 #ifdef __KERNEL__
8
9 #ifndef CONFIG_GENERIC_HARDIRQS
10 #include <asm/irq.h>
11 # define nr_irqs                NR_IRQS
12
13 # define for_each_irq_desc(irq, desc)           \
14         for (irq = 0; irq < nr_irqs; irq++)
15
16 # define for_each_irq_desc_reverse(irq, desc)                          \
17         for (irq = nr_irqs - 1; irq >= 0; irq--)
18 #else /* CONFIG_GENERIC_HARDIRQS */
19
20 extern int nr_irqs;
21 extern struct irq_desc *irq_to_desc(unsigned int irq);
22
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)
27
28
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)
33
34 #endif /* CONFIG_GENERIC_HARDIRQS */
35
36 #define for_each_irq_nr(irq)                   \
37        for (irq = 0; irq < nr_irqs; irq++)
38
39 #endif /* __KERNEL__ */
40
41 #endif