aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-31 12:00:59 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-31 12:00:59 -0500
commitdb200df0b3530f673d8e9f5bd535e9e10305842a (patch)
tree9a94039b8813452c51a50fcb45e95c32a9f0e537 /include
parentec270e59a74eee972006a87c8e12514a20588369 (diff)
parent43a256322ac1fc105c181b3cade3b9bfc0b63ca1 (diff)
Merge branch 'irq-fixes-for-linus-4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'irq-fixes-for-linus-4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: sparseirq: move __weak symbols into separate compilation unit sparseirq: work around __weak alias bug sparseirq: fix hang with !SPARSE_IRQ sparseirq: set lock_class for legacy irq when sparse_irq is selected sparseirq: work around compiler optimizing away __weak functions sparseirq: fix desc->lock init sparseirq: do not printk when migrating IRQ descriptors sparseirq: remove duplicated arch_early_irq_init() irq: simplify for_each_irq_desc() usage proc: remove ifdef CONFIG_SPARSE_IRQ from stat.c irq: for_each_irq_desc() move to irqnr.h hrtimer: remove #include <linux/irq.h>
Diffstat (limited to 'include')
-rw-r--r--include/linux/interrupt.h6
-rw-r--r--include/linux/irq.h27
-rw-r--r--include/linux/irqnr.h23
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
465int show_interrupts(struct seq_file *p, void *v); 465int show_interrupts(struct seq_file *p, void *v);
466 466
467struct irq_desc;
468
469extern int early_irq_init(void);
470extern int arch_early_irq_init(void);
471extern 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
196extern void early_irq_init(void);
197extern void arch_early_irq_init(void);
198extern void arch_init_chip_data(struct irq_desc *desc, int cpu);
199extern void arch_init_copy_chip_data(struct irq_desc *old_desc, 196extern 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);
201extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); 198extern 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
204extern struct irq_desc irq_desc[NR_IRQS]; 201extern struct irq_desc irq_desc[NR_IRQS];
205 202#else /* CONFIG_SPARSE_IRQ */
206static inline struct irq_desc *irq_to_desc(unsigned int irq)
207{
208 return (irq < NR_IRQS) ? irq_desc + irq : NULL;
209}
210static 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
217extern struct irq_desc *irq_to_desc(unsigned int irq);
218extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
219extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); 203extern 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
212extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
232 213
233static inline struct irq_desc * 214static inline struct irq_desc *
234irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) 215irq_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
20extern int nr_irqs; 20extern int nr_irqs;
21extern 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
24struct 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++)