Thomas Gleixner | dd3a1db | 2008-10-16 18:20:58 +0200 | [diff] [blame] | 1 | #ifndef _LINUX_IRQNR_H |
| 2 | #define _LINUX_IRQNR_H |
| 3 | |
| 4 | #ifndef CONFIG_GENERIC_HARDIRQS |
| 5 | #include <asm/irq.h> |
| 6 | # define nr_irqs NR_IRQS |
| 7 | |
| 8 | # define for_each_irq_desc(irq, desc) \ |
| 9 | for (irq = 0; irq < nr_irqs; irq++) |
| 10 | #else |
| 11 | extern int nr_irqs; |
| 12 | |
| 13 | # define for_each_irq_desc(irq, desc) \ |
| 14 | for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++) |
| 15 | |
Ingo Molnar | e9f95e6 | 2008-10-21 15:49:59 +0200 | [diff] [blame] | 16 | # define for_each_irq_desc_reverse(irq, desc) \ |
| 17 | for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \ |
| 18 | irq >= 0; irq--, desc--) |
Thomas Gleixner | dd3a1db | 2008-10-16 18:20:58 +0200 | [diff] [blame] | 19 | #endif |
| 20 | |
| 21 | #define for_each_irq_nr(irq) \ |
| 22 | for (irq = 0; irq < nr_irqs; irq++) |
| 23 | |
| 24 | #endif |