summaryrefslogtreecommitdiff
path: root/include/linux/irqnr.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-01-15 18:27:20 +0100
committerTakashi Iwai <tiwai@suse.de>2009-01-15 18:27:20 +0100
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 @@
#ifndef CONFIG_GENERIC_HARDIRQS
#include <asm/irq.h>
-# define nr_irqs NR_IRQS
+
+/*
+ * Wrappers for non-genirq architectures:
+ */
+#define nr_irqs NR_IRQS
+#define irq_to_desc(irq) (&irq_desc[irq])
# define for_each_irq_desc(irq, desc) \
for (irq = 0; irq < nr_irqs; irq++)
# define for_each_irq_desc_reverse(irq, desc) \
for (irq = nr_irqs - 1; irq >= 0; irq--)
-#else
+#else /* CONFIG_GENERIC_HARDIRQS */
extern int nr_irqs;
+extern struct irq_desc *irq_to_desc(unsigned int irq);
-#ifndef CONFIG_SPARSE_IRQ
+# define for_each_irq_desc(irq, desc) \
+ for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \
+ irq++, desc = irq_to_desc(irq)) \
+ if (desc)
-struct irq_desc;
-# define for_each_irq_desc(irq, desc) \
- for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++)
-# define for_each_irq_desc_reverse(irq, desc) \
- for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \
- irq >= 0; irq--, desc--)
-#endif
-#endif
+
+# define for_each_irq_desc_reverse(irq, desc) \
+ for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \
+ irq--, desc = irq_to_desc(irq)) \
+ if (desc)
+
+#endif /* CONFIG_GENERIC_HARDIRQS */
#define for_each_irq_nr(irq) \
for (irq = 0; irq < nr_irqs; irq++)