diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/interrupt.h | 17 | ||||
-rw-r--r-- | include/linux/irq.h | 16 | ||||
-rw-r--r-- | include/linux/irqnr.h | 8 | ||||
-rw-r--r-- | include/linux/irqreturn.h | 28 | ||||
-rw-r--r-- | include/linux/kernel_stat.h | 13 |
5 files changed, 45 insertions, 37 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 9127f6b51a39..91658d076598 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -61,6 +61,17 @@ | |||
61 | 61 | ||
62 | typedef irqreturn_t (*irq_handler_t)(int, void *); | 62 | typedef irqreturn_t (*irq_handler_t)(int, void *); |
63 | 63 | ||
64 | /** | ||
65 | * struct irqaction - per interrupt action descriptor | ||
66 | * @handler: interrupt handler function | ||
67 | * @flags: flags (see IRQF_* above) | ||
68 | * @mask: no comment as it is useless and about to be removed | ||
69 | * @name: name of the device | ||
70 | * @dev_id: cookie to identify the device | ||
71 | * @next: pointer to the next irqaction for shared interrupts | ||
72 | * @irq: interrupt number | ||
73 | * @dir: pointer to the proc/irq/NN/name entry | ||
74 | */ | ||
64 | struct irqaction { | 75 | struct irqaction { |
65 | irq_handler_t handler; | 76 | irq_handler_t handler; |
66 | unsigned long flags; | 77 | unsigned long flags; |
@@ -462,6 +473,12 @@ static inline void init_irq_proc(void) | |||
462 | } | 473 | } |
463 | #endif | 474 | #endif |
464 | 475 | ||
476 | #if defined(CONFIG_GENERIC_HARDIRQS) && defined(CONFIG_DEBUG_SHIRQ) | ||
477 | extern void debug_poll_all_shared_irqs(void); | ||
478 | #else | ||
479 | static inline void debug_poll_all_shared_irqs(void) { } | ||
480 | #endif | ||
481 | |||
465 | int show_interrupts(struct seq_file *p, void *v); | 482 | int show_interrupts(struct seq_file *p, void *v); |
466 | 483 | ||
467 | struct irq_desc; | 484 | struct irq_desc; |
diff --git a/include/linux/irq.h b/include/linux/irq.h index f899b502f186..6db939a575bd 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -160,12 +160,10 @@ struct irq_2_iommu; | |||
160 | */ | 160 | */ |
161 | struct irq_desc { | 161 | struct irq_desc { |
162 | unsigned int irq; | 162 | unsigned int irq; |
163 | #ifdef CONFIG_SPARSE_IRQ | ||
164 | struct timer_rand_state *timer_rand_state; | 163 | struct timer_rand_state *timer_rand_state; |
165 | unsigned int *kstat_irqs; | 164 | unsigned int *kstat_irqs; |
166 | # ifdef CONFIG_INTR_REMAP | 165 | #ifdef CONFIG_INTR_REMAP |
167 | struct irq_2_iommu *irq_2_iommu; | 166 | struct irq_2_iommu *irq_2_iommu; |
168 | # endif | ||
169 | #endif | 167 | #endif |
170 | irq_flow_handler_t handle_irq; | 168 | irq_flow_handler_t handle_irq; |
171 | struct irq_chip *chip; | 169 | struct irq_chip *chip; |
@@ -202,12 +200,6 @@ extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc | |||
202 | extern struct irq_desc irq_desc[NR_IRQS]; | 200 | extern struct irq_desc irq_desc[NR_IRQS]; |
203 | #else /* CONFIG_SPARSE_IRQ */ | 201 | #else /* CONFIG_SPARSE_IRQ */ |
204 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); | 202 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); |
205 | |||
206 | #define kstat_irqs_this_cpu(DESC) \ | ||
207 | ((DESC)->kstat_irqs[smp_processor_id()]) | ||
208 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ | ||
209 | ((DESC)->kstat_irqs[smp_processor_id()]++) | ||
210 | |||
211 | #endif /* CONFIG_SPARSE_IRQ */ | 203 | #endif /* CONFIG_SPARSE_IRQ */ |
212 | 204 | ||
213 | extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); | 205 | extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); |
@@ -226,7 +218,6 @@ irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) | |||
226 | * Migration helpers for obsolete names, they will go away: | 218 | * Migration helpers for obsolete names, they will go away: |
227 | */ | 219 | */ |
228 | #define hw_interrupt_type irq_chip | 220 | #define hw_interrupt_type irq_chip |
229 | typedef struct irq_chip hw_irq_controller; | ||
230 | #define no_irq_type no_irq_chip | 221 | #define no_irq_type no_irq_chip |
231 | typedef struct irq_desc irq_desc_t; | 222 | typedef struct irq_desc irq_desc_t; |
232 | 223 | ||
@@ -236,6 +227,7 @@ typedef struct irq_desc irq_desc_t; | |||
236 | #include <asm/hw_irq.h> | 227 | #include <asm/hw_irq.h> |
237 | 228 | ||
238 | extern int setup_irq(unsigned int irq, struct irqaction *new); | 229 | extern int setup_irq(unsigned int irq, struct irqaction *new); |
230 | extern void remove_irq(unsigned int irq, struct irqaction *act); | ||
239 | 231 | ||
240 | #ifdef CONFIG_GENERIC_HARDIRQS | 232 | #ifdef CONFIG_GENERIC_HARDIRQS |
241 | 233 | ||
@@ -280,7 +272,7 @@ static inline int irq_balancing_disabled(unsigned int irq) | |||
280 | } | 272 | } |
281 | 273 | ||
282 | /* Handle irq action chains: */ | 274 | /* Handle irq action chains: */ |
283 | extern int handle_IRQ_event(unsigned int irq, struct irqaction *action); | 275 | extern irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action); |
284 | 276 | ||
285 | /* | 277 | /* |
286 | * Built-in IRQ handlers for various IRQ types, | 278 | * Built-in IRQ handlers for various IRQ types, |
@@ -325,7 +317,7 @@ static inline void generic_handle_irq(unsigned int irq) | |||
325 | 317 | ||
326 | /* Handling of unhandled and spurious interrupts: */ | 318 | /* Handling of unhandled and spurious interrupts: */ |
327 | extern void note_interrupt(unsigned int irq, struct irq_desc *desc, | 319 | extern void note_interrupt(unsigned int irq, struct irq_desc *desc, |
328 | int action_ret); | 320 | irqreturn_t action_ret); |
329 | 321 | ||
330 | /* Resending of interrupts :*/ | 322 | /* Resending of interrupts :*/ |
331 | void check_irq_resend(struct irq_desc *desc, unsigned int irq); | 323 | void check_irq_resend(struct irq_desc *desc, unsigned int irq); |
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 86af92e9e84c..52ebbb4b161d 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h | |||
@@ -28,13 +28,17 @@ extern struct irq_desc *irq_to_desc(unsigned int irq); | |||
28 | # define for_each_irq_desc(irq, desc) \ | 28 | # define for_each_irq_desc(irq, desc) \ |
29 | for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \ | 29 | for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \ |
30 | irq++, desc = irq_to_desc(irq)) \ | 30 | irq++, desc = irq_to_desc(irq)) \ |
31 | if (desc) | 31 | if (!desc) \ |
32 | ; \ | ||
33 | else | ||
32 | 34 | ||
33 | 35 | ||
34 | # define for_each_irq_desc_reverse(irq, desc) \ | 36 | # define for_each_irq_desc_reverse(irq, desc) \ |
35 | for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \ | 37 | for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \ |
36 | irq--, desc = irq_to_desc(irq)) \ | 38 | irq--, desc = irq_to_desc(irq)) \ |
37 | if (desc) | 39 | if (!desc) \ |
40 | ; \ | ||
41 | else | ||
38 | 42 | ||
39 | #endif /* CONFIG_GENERIC_HARDIRQS */ | 43 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
40 | 44 | ||
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h index 881883c2009d..c5584ca5b8c9 100644 --- a/include/linux/irqreturn.h +++ b/include/linux/irqreturn.h | |||
@@ -1,25 +1,17 @@ | |||
1 | /* irqreturn.h */ | ||
2 | #ifndef _LINUX_IRQRETURN_H | 1 | #ifndef _LINUX_IRQRETURN_H |
3 | #define _LINUX_IRQRETURN_H | 2 | #define _LINUX_IRQRETURN_H |
4 | 3 | ||
5 | /* | 4 | /** |
6 | * For 2.4.x compatibility, 2.4.x can use | 5 | * enum irqreturn |
7 | * | 6 | * @IRQ_NONE interrupt was not from this device |
8 | * typedef void irqreturn_t; | 7 | * @IRQ_HANDLED interrupt was handled by this device |
9 | * #define IRQ_NONE | ||
10 | * #define IRQ_HANDLED | ||
11 | * #define IRQ_RETVAL(x) | ||
12 | * | ||
13 | * To mix old-style and new-style irq handler returns. | ||
14 | * | ||
15 | * IRQ_NONE means we didn't handle it. | ||
16 | * IRQ_HANDLED means that we did have a valid interrupt and handled it. | ||
17 | * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled) | ||
18 | */ | 8 | */ |
19 | typedef int irqreturn_t; | 9 | enum irqreturn { |
10 | IRQ_NONE, | ||
11 | IRQ_HANDLED, | ||
12 | }; | ||
20 | 13 | ||
21 | #define IRQ_NONE (0) | 14 | typedef enum irqreturn irqreturn_t; |
22 | #define IRQ_HANDLED (1) | 15 | #define IRQ_RETVAL(x) ((x) != IRQ_NONE) |
23 | #define IRQ_RETVAL(x) ((x) != 0) | ||
24 | 16 | ||
25 | #endif | 17 | #endif |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 570d20413119..0c8b89f28a95 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -28,7 +28,7 @@ struct cpu_usage_stat { | |||
28 | 28 | ||
29 | struct kernel_stat { | 29 | struct kernel_stat { |
30 | struct cpu_usage_stat cpustat; | 30 | struct cpu_usage_stat cpustat; |
31 | #ifndef CONFIG_SPARSE_IRQ | 31 | #ifndef CONFIG_GENERIC_HARDIRQS |
32 | unsigned int irqs[NR_IRQS]; | 32 | unsigned int irqs[NR_IRQS]; |
33 | #endif | 33 | #endif |
34 | }; | 34 | }; |
@@ -41,7 +41,7 @@ DECLARE_PER_CPU(struct kernel_stat, kstat); | |||
41 | 41 | ||
42 | extern unsigned long long nr_context_switches(void); | 42 | extern unsigned long long nr_context_switches(void); |
43 | 43 | ||
44 | #ifndef CONFIG_SPARSE_IRQ | 44 | #ifndef CONFIG_GENERIC_HARDIRQS |
45 | #define kstat_irqs_this_cpu(irq) \ | 45 | #define kstat_irqs_this_cpu(irq) \ |
46 | (kstat_this_cpu.irqs[irq]) | 46 | (kstat_this_cpu.irqs[irq]) |
47 | 47 | ||
@@ -52,16 +52,19 @@ static inline void kstat_incr_irqs_this_cpu(unsigned int irq, | |||
52 | { | 52 | { |
53 | kstat_this_cpu.irqs[irq]++; | 53 | kstat_this_cpu.irqs[irq]++; |
54 | } | 54 | } |
55 | #endif | ||
56 | |||
57 | 55 | ||
58 | #ifndef CONFIG_SPARSE_IRQ | ||
59 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | 56 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) |
60 | { | 57 | { |
61 | return kstat_cpu(cpu).irqs[irq]; | 58 | return kstat_cpu(cpu).irqs[irq]; |
62 | } | 59 | } |
63 | #else | 60 | #else |
61 | #include <linux/irq.h> | ||
64 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); | 62 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); |
63 | #define kstat_irqs_this_cpu(DESC) \ | ||
64 | ((DESC)->kstat_irqs[smp_processor_id()]) | ||
65 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ | ||
66 | ((DESC)->kstat_irqs[smp_processor_id()]++) | ||
67 | |||
65 | #endif | 68 | #endif |
66 | 69 | ||
67 | /* | 70 | /* |