diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/interrupt.h | 6 | ||||
-rw-r--r-- | include/linux/irq.h | 27 | ||||
-rw-r--r-- | include/linux/irqnr.h | 23 |
3 files changed, 23 insertions, 33 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index be3c484b5242..8cc8ef47f5b6 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -464,4 +464,10 @@ static inline void init_irq_proc(void) | |||
464 | 464 | ||
465 | int show_interrupts(struct seq_file *p, void *v); | 465 | int show_interrupts(struct seq_file *p, void *v); |
466 | 466 | ||
467 | struct irq_desc; | ||
468 | |||
469 | extern int early_irq_init(void); | ||
470 | extern int arch_early_irq_init(void); | ||
471 | extern int arch_init_chip_data(struct irq_desc *desc, int cpu); | ||
472 | |||
467 | #endif | 473 | #endif |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 98564dc64476..d64a6d49bdef 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -193,42 +193,23 @@ struct irq_desc { | |||
193 | const char *name; | 193 | const char *name; |
194 | } ____cacheline_internodealigned_in_smp; | 194 | } ____cacheline_internodealigned_in_smp; |
195 | 195 | ||
196 | extern void early_irq_init(void); | ||
197 | extern void arch_early_irq_init(void); | ||
198 | extern void arch_init_chip_data(struct irq_desc *desc, int cpu); | ||
199 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, | 196 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, |
200 | struct irq_desc *desc, int cpu); | 197 | struct irq_desc *desc, int cpu); |
201 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); | 198 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); |
202 | 199 | ||
203 | #ifndef CONFIG_SPARSE_IRQ | 200 | #ifndef CONFIG_SPARSE_IRQ |
204 | extern struct irq_desc irq_desc[NR_IRQS]; | 201 | extern struct irq_desc irq_desc[NR_IRQS]; |
205 | 202 | #else /* CONFIG_SPARSE_IRQ */ | |
206 | static inline struct irq_desc *irq_to_desc(unsigned int irq) | ||
207 | { | ||
208 | return (irq < NR_IRQS) ? irq_desc + irq : NULL; | ||
209 | } | ||
210 | static inline struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu) | ||
211 | { | ||
212 | return irq_to_desc(irq); | ||
213 | } | ||
214 | |||
215 | #else | ||
216 | |||
217 | extern struct irq_desc *irq_to_desc(unsigned int irq); | ||
218 | extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); | ||
219 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); | 203 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); |
220 | 204 | ||
221 | # define for_each_irq_desc(irq, desc) \ | ||
222 | for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; irq++, desc = irq_to_desc(irq)) | ||
223 | # define for_each_irq_desc_reverse(irq, desc) \ | ||
224 | for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; irq--, desc = irq_to_desc(irq)) | ||
225 | |||
226 | #define kstat_irqs_this_cpu(DESC) \ | 205 | #define kstat_irqs_this_cpu(DESC) \ |
227 | ((DESC)->kstat_irqs[smp_processor_id()]) | 206 | ((DESC)->kstat_irqs[smp_processor_id()]) |
228 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ | 207 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ |
229 | ((DESC)->kstat_irqs[smp_processor_id()]++) | 208 | ((DESC)->kstat_irqs[smp_processor_id()]++) |
230 | 209 | ||
231 | #endif | 210 | #endif /* CONFIG_SPARSE_IRQ */ |
211 | |||
212 | extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); | ||
232 | 213 | ||
233 | static inline struct irq_desc * | 214 | static inline struct irq_desc * |
234 | irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) | 215 | irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) |
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 95d2b74641f5..5504a5c97836 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h | |||
@@ -15,20 +15,23 @@ | |||
15 | 15 | ||
16 | # define for_each_irq_desc_reverse(irq, desc) \ | 16 | # define for_each_irq_desc_reverse(irq, desc) \ |
17 | for (irq = nr_irqs - 1; irq >= 0; irq--) | 17 | for (irq = nr_irqs - 1; irq >= 0; irq--) |
18 | #else | 18 | #else /* CONFIG_GENERIC_HARDIRQS */ |
19 | 19 | ||
20 | extern int nr_irqs; | 20 | extern int nr_irqs; |
21 | extern struct irq_desc *irq_to_desc(unsigned int irq); | ||
21 | 22 | ||
22 | #ifndef CONFIG_SPARSE_IRQ | 23 | # define for_each_irq_desc(irq, desc) \ |
24 | for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \ | ||
25 | irq++, desc = irq_to_desc(irq)) \ | ||
26 | if (desc) | ||
23 | 27 | ||
24 | struct irq_desc; | 28 | |
25 | # define for_each_irq_desc(irq, desc) \ | 29 | # define for_each_irq_desc_reverse(irq, desc) \ |
26 | for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++) | 30 | for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \ |
27 | # define for_each_irq_desc_reverse(irq, desc) \ | 31 | irq--, desc = irq_to_desc(irq)) \ |
28 | for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \ | 32 | if (desc) |
29 | irq >= 0; irq--, desc--) | 33 | |
30 | #endif | 34 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
31 | #endif | ||
32 | 35 | ||
33 | #define for_each_irq_nr(irq) \ | 36 | #define for_each_irq_nr(irq) \ |
34 | for (irq = 0; irq < nr_irqs; irq++) | 37 | for (irq = 0; irq < nr_irqs; irq++) |