aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/interrupt.h4
-rw-r--r--include/linux/irqnr.h11
-rw-r--r--include/linux/random.h2
3 files changed, 13 insertions, 4 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 79e915e7e8a5..777f89e00b4a 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -14,12 +14,12 @@
14#include <linux/irqflags.h> 14#include <linux/irqflags.h>
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/percpu.h> 16#include <linux/percpu.h>
17#include <linux/irqnr.h>
18
17#include <asm/atomic.h> 19#include <asm/atomic.h>
18#include <asm/ptrace.h> 20#include <asm/ptrace.h>
19#include <asm/system.h> 21#include <asm/system.h>
20 22
21extern int nr_irqs;
22
23/* 23/*
24 * These correspond to the IORESOURCE_IRQ_* defines in 24 * These correspond to the IORESOURCE_IRQ_* defines in
25 * linux/ioport.h to select the interrupt line behaviour. When 25 * linux/ioport.h to select the interrupt line behaviour. When
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
index 13754f813589..95d2b74641f5 100644
--- a/include/linux/irqnr.h
+++ b/include/linux/irqnr.h
@@ -1,6 +1,11 @@
1#ifndef _LINUX_IRQNR_H 1#ifndef _LINUX_IRQNR_H
2#define _LINUX_IRQNR_H 2#define _LINUX_IRQNR_H
3 3
4/*
5 * Generic irq_desc iterators:
6 */
7#ifdef __KERNEL__
8
4#ifndef CONFIG_GENERIC_HARDIRQS 9#ifndef CONFIG_GENERIC_HARDIRQS
5#include <asm/irq.h> 10#include <asm/irq.h>
6# define nr_irqs NR_IRQS 11# define nr_irqs NR_IRQS
@@ -11,10 +16,12 @@
11# define for_each_irq_desc_reverse(irq, desc) \ 16# define for_each_irq_desc_reverse(irq, desc) \
12 for (irq = nr_irqs - 1; irq >= 0; irq--) 17 for (irq = nr_irqs - 1; irq >= 0; irq--)
13#else 18#else
19
20extern int nr_irqs;
21
14#ifndef CONFIG_SPARSE_IRQ 22#ifndef CONFIG_SPARSE_IRQ
15 23
16struct irq_desc; 24struct irq_desc;
17extern int nr_irqs;
18# define for_each_irq_desc(irq, desc) \ 25# define for_each_irq_desc(irq, desc) \
19 for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++) 26 for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++)
20# define for_each_irq_desc_reverse(irq, desc) \ 27# define for_each_irq_desc_reverse(irq, desc) \
@@ -26,4 +33,6 @@ extern int nr_irqs;
26#define for_each_irq_nr(irq) \ 33#define for_each_irq_nr(irq) \
27 for (irq = 0; irq < nr_irqs; irq++) 34 for (irq = 0; irq < nr_irqs; irq++)
28 35
36#endif /* __KERNEL__ */
37
29#endif 38#endif
diff --git a/include/linux/random.h b/include/linux/random.h
index ad9daa2374d5..adbf3bd3c6b3 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -8,6 +8,7 @@
8#define _LINUX_RANDOM_H 8#define _LINUX_RANDOM_H
9 9
10#include <linux/ioctl.h> 10#include <linux/ioctl.h>
11#include <linux/irqnr.h>
11 12
12/* ioctl()'s for the random number generator */ 13/* ioctl()'s for the random number generator */
13 14
@@ -49,7 +50,6 @@ struct timer_rand_state;
49 50
50extern struct timer_rand_state *irq_timer_state[]; 51extern struct timer_rand_state *irq_timer_state[];
51 52
52extern int nr_irqs;
53static inline struct timer_rand_state *get_timer_rand_state(unsigned int irq) 53static inline struct timer_rand_state *get_timer_rand_state(unsigned int irq)
54{ 54{
55 if (irq >= nr_irqs) 55 if (irq >= nr_irqs)