diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-06-29 05:24:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-29 13:26:22 -0400 |
commit | 06fcb0c6fb3aae9570a32ac3b72a8222563baa69 (patch) | |
tree | c1f9d750a42031434971b2271882b907fd7838f5 /include/linux | |
parent | 2e60bbb6d50de654d8e68f115161e27878b5e72d (diff) |
[PATCH] genirq: cleanup: misc code cleanups
Assorted code cleanups to the generic IRQ code.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/irq.h | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h index eac1273dc4e1..92c685414622 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __irq_h | 1 | #ifndef _LINUX_IRQ_H |
2 | #define __irq_h | 2 | #define _LINUX_IRQ_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * Please do not include this file in generic code. There is currently | 5 | * Please do not include this file in generic code. There is currently |
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/smp.h> | 12 | #include <linux/smp.h> |
13 | 13 | ||
14 | #if !defined(CONFIG_S390) | 14 | #ifndef CONFIG_S390 |
15 | 15 | ||
16 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
17 | #include <linux/cache.h> | 17 | #include <linux/cache.h> |
@@ -33,7 +33,7 @@ | |||
33 | #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ | 33 | #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ |
34 | #define IRQ_LEVEL 64 /* IRQ level triggered */ | 34 | #define IRQ_LEVEL 64 /* IRQ level triggered */ |
35 | #define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ | 35 | #define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ |
36 | #if defined(ARCH_HAS_IRQ_PER_CPU) | 36 | #ifdef ARCH_HAS_IRQ_PER_CPU |
37 | # define IRQ_PER_CPU 256 /* IRQ is per CPU */ | 37 | # define IRQ_PER_CPU 256 /* IRQ is per CPU */ |
38 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) | 38 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) |
39 | #else | 39 | #else |
@@ -45,7 +45,7 @@ | |||
45 | * to describe about the low-level hardware. | 45 | * to describe about the low-level hardware. |
46 | */ | 46 | */ |
47 | struct hw_interrupt_type { | 47 | struct hw_interrupt_type { |
48 | const char * typename; | 48 | const char *typename; |
49 | unsigned int (*startup)(unsigned int irq); | 49 | unsigned int (*startup)(unsigned int irq); |
50 | void (*shutdown)(unsigned int irq); | 50 | void (*shutdown)(unsigned int irq); |
51 | void (*enable)(unsigned int irq); | 51 | void (*enable)(unsigned int irq); |
@@ -80,7 +80,7 @@ typedef struct irq_desc { | |||
80 | #ifdef CONFIG_SMP | 80 | #ifdef CONFIG_SMP |
81 | cpumask_t affinity; | 81 | cpumask_t affinity; |
82 | #endif | 82 | #endif |
83 | #if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) | 83 | #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) |
84 | unsigned int move_irq; /* Flag need to re-target intr dest*/ | 84 | unsigned int move_irq; /* Flag need to re-target intr dest*/ |
85 | #endif | 85 | #endif |
86 | } ____cacheline_aligned irq_desc_t; | 86 | } ____cacheline_aligned irq_desc_t; |
@@ -89,9 +89,10 @@ extern irq_desc_t irq_desc [NR_IRQS]; | |||
89 | 89 | ||
90 | #include <asm/hw_irq.h> /* the arch dependent stuff */ | 90 | #include <asm/hw_irq.h> /* the arch dependent stuff */ |
91 | 91 | ||
92 | extern int setup_irq(unsigned int irq, struct irqaction * new); | 92 | extern int setup_irq(unsigned int irq, struct irqaction *new); |
93 | 93 | ||
94 | #ifdef CONFIG_GENERIC_HARDIRQS | 94 | #ifdef CONFIG_GENERIC_HARDIRQS |
95 | |||
95 | #ifdef CONFIG_SMP | 96 | #ifdef CONFIG_SMP |
96 | static inline void set_native_irq_info(int irq, cpumask_t mask) | 97 | static inline void set_native_irq_info(int irq, cpumask_t mask) |
97 | { | 98 | { |
@@ -105,7 +106,7 @@ static inline void set_native_irq_info(int irq, cpumask_t mask) | |||
105 | 106 | ||
106 | #ifdef CONFIG_SMP | 107 | #ifdef CONFIG_SMP |
107 | 108 | ||
108 | #if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) | 109 | #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) |
109 | extern cpumask_t pending_irq_cpumask[NR_IRQS]; | 110 | extern cpumask_t pending_irq_cpumask[NR_IRQS]; |
110 | 111 | ||
111 | void set_pending_irq(unsigned int irq, cpumask_t mask); | 112 | void set_pending_irq(unsigned int irq, cpumask_t mask); |
@@ -127,7 +128,7 @@ static inline void set_irq_info(int irq, cpumask_t mask) | |||
127 | { | 128 | { |
128 | } | 129 | } |
129 | 130 | ||
130 | #else // CONFIG_PCI_MSI | 131 | #else /* CONFIG_PCI_MSI */ |
131 | 132 | ||
132 | static inline void move_irq(int irq) | 133 | static inline void move_irq(int irq) |
133 | { | 134 | { |
@@ -138,26 +139,36 @@ static inline void set_irq_info(int irq, cpumask_t mask) | |||
138 | { | 139 | { |
139 | set_native_irq_info(irq, mask); | 140 | set_native_irq_info(irq, mask); |
140 | } | 141 | } |
141 | #endif // CONFIG_PCI_MSI | ||
142 | 142 | ||
143 | #else // CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE | 143 | #endif /* CONFIG_PCI_MSI */ |
144 | |||
145 | #else /* CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE */ | ||
146 | |||
147 | static inline void move_irq(int irq) | ||
148 | { | ||
149 | } | ||
150 | |||
151 | static inline void move_native_irq(int irq) | ||
152 | { | ||
153 | } | ||
154 | |||
155 | static inline void set_pending_irq(unsigned int irq, cpumask_t mask) | ||
156 | { | ||
157 | } | ||
144 | 158 | ||
145 | #define move_irq(x) | ||
146 | #define move_native_irq(x) | ||
147 | #define set_pending_irq(x,y) | ||
148 | static inline void set_irq_info(int irq, cpumask_t mask) | 159 | static inline void set_irq_info(int irq, cpumask_t mask) |
149 | { | 160 | { |
150 | set_native_irq_info(irq, mask); | 161 | set_native_irq_info(irq, mask); |
151 | } | 162 | } |
152 | 163 | ||
153 | #endif // CONFIG_GENERIC_PENDING_IRQ | 164 | #endif /* CONFIG_GENERIC_PENDING_IRQ */ |
154 | 165 | ||
155 | #else // CONFIG_SMP | 166 | #else /* CONFIG_SMP */ |
156 | 167 | ||
157 | #define move_irq(x) | 168 | #define move_irq(x) |
158 | #define move_native_irq(x) | 169 | #define move_native_irq(x) |
159 | 170 | ||
160 | #endif // CONFIG_SMP | 171 | #endif /* CONFIG_SMP */ |
161 | 172 | ||
162 | #ifdef CONFIG_IRQBALANCE | 173 | #ifdef CONFIG_IRQBALANCE |
163 | extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask); | 174 | extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask); |
@@ -186,17 +197,16 @@ extern void init_irq_proc(void); | |||
186 | #ifdef CONFIG_AUTO_IRQ_AFFINITY | 197 | #ifdef CONFIG_AUTO_IRQ_AFFINITY |
187 | extern int select_smp_affinity(unsigned int irq); | 198 | extern int select_smp_affinity(unsigned int irq); |
188 | #else | 199 | #else |
189 | static inline int | 200 | static inline int select_smp_affinity(unsigned int irq) |
190 | select_smp_affinity(unsigned int irq) | ||
191 | { | 201 | { |
192 | return 1; | 202 | return 1; |
193 | } | 203 | } |
194 | #endif | 204 | #endif |
195 | 205 | ||
196 | #endif | 206 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
197 | 207 | ||
198 | extern hw_irq_controller no_irq_type; /* needed in every arch ? */ | 208 | extern hw_irq_controller no_irq_type; /* needed in every arch ? */ |
199 | 209 | ||
200 | #endif | 210 | #endif /* !CONFIG_S390 */ |
201 | 211 | ||
202 | #endif /* __irq_h */ | 212 | #endif /* _LINUX_IRQ_H */ |