aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/handle.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/irq/handle.c')
-rw-r--r--kernel/irq/handle.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index e9d022cf593e..e94eeca09ea9 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -48,6 +48,36 @@ handle_bad_irq(unsigned int irq, struct irq_desc *desc)
48 * Controller mappings for all interrupt sources: 48 * Controller mappings for all interrupt sources:
49 */ 49 */
50int nr_irqs = NR_IRQS; 50int nr_irqs = NR_IRQS;
51
52#ifdef CONFIG_HAVE_DYN_ARRAY
53static struct irq_desc irq_desc_init __initdata = {
54 .status = IRQ_DISABLED,
55 .chip = &no_irq_chip,
56 .handle_irq = handle_bad_irq,
57 .depth = 1,
58 .lock = __SPIN_LOCK_UNLOCKED(irq_desc_init.lock),
59#ifdef CONFIG_SMP
60 .affinity = CPU_MASK_ALL
61#endif
62};
63
64static void __init init_work(void *data)
65{
66 struct dyn_array *da = data;
67 int i;
68 struct irq_desc *desc;
69
70 desc = *da->name;
71
72 for (i = 0; i < *da->nr; i++)
73 memcpy(&desc[i], &irq_desc_init, sizeof(struct irq_desc));
74}
75
76struct irq_desc *irq_desc;
77DEFINE_DYN_ARRAY(irq_desc, sizeof(struct irq_desc), nr_irqs, PAGE_SIZE, init_work);
78
79#else
80
51struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = { 81struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = {
52 [0 ... NR_IRQS-1] = { 82 [0 ... NR_IRQS-1] = {
53 .status = IRQ_DISABLED, 83 .status = IRQ_DISABLED,
@@ -60,6 +90,7 @@ struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = {
60#endif 90#endif
61 } 91 }
62}; 92};
93#endif
63 94
64/* 95/*
65 * What should we do if we get a hw irq event on an illegal vector? 96 * What should we do if we get a hw irq event on an illegal vector?