diff options
Diffstat (limited to 'arch/x86/kernel/irqinit.c')
-rw-r--r-- | arch/x86/kernel/irqinit.c | 63 |
1 files changed, 40 insertions, 23 deletions
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c index f5fa64c0b37e..a760ce1a2c0d 100644 --- a/arch/x86/kernel/irqinit.c +++ b/arch/x86/kernel/irqinit.c | |||
@@ -5,7 +5,6 @@ | |||
5 | #include <linux/ioport.h> | 5 | #include <linux/ioport.h> |
6 | #include <linux/interrupt.h> | 6 | #include <linux/interrupt.h> |
7 | #include <linux/timex.h> | 7 | #include <linux/timex.h> |
8 | #include <linux/slab.h> | ||
9 | #include <linux/random.h> | 8 | #include <linux/random.h> |
10 | #include <linux/kprobes.h> | 9 | #include <linux/kprobes.h> |
11 | #include <linux/init.h> | 10 | #include <linux/init.h> |
@@ -84,24 +83,7 @@ static struct irqaction irq2 = { | |||
84 | }; | 83 | }; |
85 | 84 | ||
86 | DEFINE_PER_CPU(vector_irq_t, vector_irq) = { | 85 | DEFINE_PER_CPU(vector_irq_t, vector_irq) = { |
87 | [0 ... IRQ0_VECTOR - 1] = -1, | 86 | [0 ... NR_VECTORS - 1] = -1, |
88 | [IRQ0_VECTOR] = 0, | ||
89 | [IRQ1_VECTOR] = 1, | ||
90 | [IRQ2_VECTOR] = 2, | ||
91 | [IRQ3_VECTOR] = 3, | ||
92 | [IRQ4_VECTOR] = 4, | ||
93 | [IRQ5_VECTOR] = 5, | ||
94 | [IRQ6_VECTOR] = 6, | ||
95 | [IRQ7_VECTOR] = 7, | ||
96 | [IRQ8_VECTOR] = 8, | ||
97 | [IRQ9_VECTOR] = 9, | ||
98 | [IRQ10_VECTOR] = 10, | ||
99 | [IRQ11_VECTOR] = 11, | ||
100 | [IRQ12_VECTOR] = 12, | ||
101 | [IRQ13_VECTOR] = 13, | ||
102 | [IRQ14_VECTOR] = 14, | ||
103 | [IRQ15_VECTOR] = 15, | ||
104 | [IRQ15_VECTOR + 1 ... NR_VECTORS - 1] = -1 | ||
105 | }; | 87 | }; |
106 | 88 | ||
107 | int vector_used_by_percpu_irq(unsigned int vector) | 89 | int vector_used_by_percpu_irq(unsigned int vector) |
@@ -123,12 +105,12 @@ void __init init_ISA_irqs(void) | |||
123 | #if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC) | 105 | #if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC) |
124 | init_bsp_APIC(); | 106 | init_bsp_APIC(); |
125 | #endif | 107 | #endif |
126 | init_8259A(0); | 108 | legacy_pic->init(0); |
127 | 109 | ||
128 | /* | 110 | /* |
129 | * 16 old-style INTA-cycle interrupts: | 111 | * 16 old-style INTA-cycle interrupts: |
130 | */ | 112 | */ |
131 | for (i = 0; i < NR_IRQS_LEGACY; i++) { | 113 | for (i = 0; i < legacy_pic->nr_legacy_irqs; i++) { |
132 | struct irq_desc *desc = irq_to_desc(i); | 114 | struct irq_desc *desc = irq_to_desc(i); |
133 | 115 | ||
134 | desc->status = IRQ_DISABLED; | 116 | desc->status = IRQ_DISABLED; |
@@ -142,9 +124,44 @@ void __init init_ISA_irqs(void) | |||
142 | 124 | ||
143 | void __init init_IRQ(void) | 125 | void __init init_IRQ(void) |
144 | { | 126 | { |
127 | int i; | ||
128 | |||
129 | /* | ||
130 | * On cpu 0, Assign IRQ0_VECTOR..IRQ15_VECTOR's to IRQ 0..15. | ||
131 | * If these IRQ's are handled by legacy interrupt-controllers like PIC, | ||
132 | * then this configuration will likely be static after the boot. If | ||
133 | * these IRQ's are handled by more mordern controllers like IO-APIC, | ||
134 | * then this vector space can be freed and re-used dynamically as the | ||
135 | * irq's migrate etc. | ||
136 | */ | ||
137 | for (i = 0; i < legacy_pic->nr_legacy_irqs; i++) | ||
138 | per_cpu(vector_irq, 0)[IRQ0_VECTOR + i] = i; | ||
139 | |||
145 | x86_init.irqs.intr_init(); | 140 | x86_init.irqs.intr_init(); |
146 | } | 141 | } |
147 | 142 | ||
143 | /* | ||
144 | * Setup the vector to irq mappings. | ||
145 | */ | ||
146 | void setup_vector_irq(int cpu) | ||
147 | { | ||
148 | #ifndef CONFIG_X86_IO_APIC | ||
149 | int irq; | ||
150 | |||
151 | /* | ||
152 | * On most of the platforms, legacy PIC delivers the interrupts on the | ||
153 | * boot cpu. But there are certain platforms where PIC interrupts are | ||
154 | * delivered to multiple cpu's. If the legacy IRQ is handled by the | ||
155 | * legacy PIC, for the new cpu that is coming online, setup the static | ||
156 | * legacy vector to irq mapping: | ||
157 | */ | ||
158 | for (irq = 0; irq < legacy_pic->nr_legacy_irqs; irq++) | ||
159 | per_cpu(vector_irq, cpu)[IRQ0_VECTOR + irq] = irq; | ||
160 | #endif | ||
161 | |||
162 | __setup_vector_irq(cpu); | ||
163 | } | ||
164 | |||
148 | static void __init smp_intr_init(void) | 165 | static void __init smp_intr_init(void) |
149 | { | 166 | { |
150 | #ifdef CONFIG_SMP | 167 | #ifdef CONFIG_SMP |
@@ -203,8 +220,8 @@ static void __init apic_intr_init(void) | |||
203 | /* self generated IPI for local APIC timer */ | 220 | /* self generated IPI for local APIC timer */ |
204 | alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); | 221 | alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); |
205 | 222 | ||
206 | /* generic IPI for platform specific use */ | 223 | /* IPI for X86 platform specific use */ |
207 | alloc_intr_gate(GENERIC_INTERRUPT_VECTOR, generic_interrupt); | 224 | alloc_intr_gate(X86_PLATFORM_IPI_VECTOR, x86_platform_ipi); |
208 | 225 | ||
209 | /* IPI vectors for APIC spurious and error interrupts */ | 226 | /* IPI vectors for APIC spurious and error interrupts */ |
210 | alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); | 227 | alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); |