aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/irqnr.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-01-15 12:27:20 -0500
committerTakashi Iwai <tiwai@suse.de>2009-01-15 12:27:20 -0500
commitc0106d72b8d71696dbe9dc80e2c77d4ac63f7531 (patch)
treeca96d2baecb0555e36219ed6968dc8e306e530ca /include/linux/irqnr.h
parent5852973c129cf7c7e6c229abb7250673fc2a50c9 (diff)
parenteff317d0834ad1ff03f747f6bc2d76b9a9c95160 (diff)
Merge branch 'topic/asoc' into next/asoc
Diffstat (limited to 'include/linux/irqnr.h')
-rw-r--r--include/linux/irqnr.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
index 95d2b74641f5..86af92e9e84c 100644
--- a/include/linux/irqnr.h
+++ b/include/linux/irqnr.h
@@ -8,27 +8,35 @@
8 8
9#ifndef CONFIG_GENERIC_HARDIRQS 9#ifndef CONFIG_GENERIC_HARDIRQS
10#include <asm/irq.h> 10#include <asm/irq.h>
11# define nr_irqs NR_IRQS 11
12/*
13 * Wrappers for non-genirq architectures:
14 */
15#define nr_irqs NR_IRQS
16#define irq_to_desc(irq) (&irq_desc[irq])
12 17
13# define for_each_irq_desc(irq, desc) \ 18# define for_each_irq_desc(irq, desc) \
14 for (irq = 0; irq < nr_irqs; irq++) 19 for (irq = 0; irq < nr_irqs; irq++)
15 20
16# define for_each_irq_desc_reverse(irq, desc) \ 21# define for_each_irq_desc_reverse(irq, desc) \
17 for (irq = nr_irqs - 1; irq >= 0; irq--) 22 for (irq = nr_irqs - 1; irq >= 0; irq--)
18#else 23#else /* CONFIG_GENERIC_HARDIRQS */
19 24
20extern int nr_irqs; 25extern int nr_irqs;
26extern struct irq_desc *irq_to_desc(unsigned int irq);
21 27
22#ifndef CONFIG_SPARSE_IRQ 28# define for_each_irq_desc(irq, desc) \
29 for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \
30 irq++, desc = irq_to_desc(irq)) \
31 if (desc)
23 32
24struct irq_desc; 33
25# define for_each_irq_desc(irq, desc) \ 34# define for_each_irq_desc_reverse(irq, desc) \
26 for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++) 35 for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \
27# define for_each_irq_desc_reverse(irq, desc) \ 36 irq--, desc = irq_to_desc(irq)) \
28 for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \ 37 if (desc)
29 irq >= 0; irq--, desc--) 38
30#endif 39#endif /* CONFIG_GENERIC_HARDIRQS */
31#endif
32 40
33#define for_each_irq_nr(irq) \ 41#define for_each_irq_nr(irq) \
34 for (irq = 0; irq < nr_irqs; irq++) 42 for (irq = 0; irq < nr_irqs; irq++)