aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/irqinit_64.c
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-07-11 14:08:39 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-13 04:21:38 -0400
commit2f97435e57926a5cdc104fe5a7c64932cb62cdda (patch)
treee3be9ae8d6475466db0d154b5610681b4d3d427e /arch/x86/kernel/irqinit_64.c
parent2ff298372d03b01c9ca8738ee2791227a81928e2 (diff)
x86: factor out irq initialization for x86_64
Provide apic_intr_init and smp_intr_init functions. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/irqinit_64.c')
-rw-r--r--arch/x86/kernel/irqinit_64.c43
1 files changed, 28 insertions, 15 deletions
diff --git a/arch/x86/kernel/irqinit_64.c b/arch/x86/kernel/irqinit_64.c
index 1f26fd9ec4f4..18968a78ab3d 100644
--- a/arch/x86/kernel/irqinit_64.c
+++ b/arch/x86/kernel/irqinit_64.c
@@ -164,22 +164,8 @@ static void __init init_ISA_irqs (void)
164 164
165void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ"))); 165void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ")));
166 166
167void __init native_init_IRQ(void) 167void __init smp_intr_init(void)
168{ 168{
169 int i;
170
171 init_ISA_irqs();
172 /*
173 * Cover the whole vector space, no vector can escape
174 * us. (some of these will be overridden and become
175 * 'special' SMP interrupts)
176 */
177 for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) {
178 int vector = FIRST_EXTERNAL_VECTOR + i;
179 if (vector != IA32_SYSCALL_VECTOR)
180 set_intr_gate(vector, interrupt[i]);
181 }
182
183#ifdef CONFIG_SMP 169#ifdef CONFIG_SMP
184 /* 170 /*
185 * The reschedule interrupt is a CPU-to-CPU reschedule-helper 171 * The reschedule interrupt is a CPU-to-CPU reschedule-helper
@@ -207,6 +193,14 @@ void __init native_init_IRQ(void)
207 /* Low priority IPI to cleanup after moving an irq */ 193 /* Low priority IPI to cleanup after moving an irq */
208 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt); 194 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
209#endif 195#endif
196}
197
198void __init apic_intr_init(void)
199{
200#ifdef CONFIG_SMP
201 smp_intr_init();
202#endif
203
210 alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); 204 alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt);
211 alloc_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt); 205 alloc_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt);
212 206
@@ -216,6 +210,25 @@ void __init native_init_IRQ(void)
216 /* IPI vectors for APIC spurious and error interrupts */ 210 /* IPI vectors for APIC spurious and error interrupts */
217 alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); 211 alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
218 alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt); 212 alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
213}
214
215void __init native_init_IRQ(void)
216{
217 int i;
218
219 init_ISA_irqs();
220 /*
221 * Cover the whole vector space, no vector can escape
222 * us. (some of these will be overridden and become
223 * 'special' SMP interrupts)
224 */
225 for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) {
226 int vector = FIRST_EXTERNAL_VECTOR + i;
227 if (vector != IA32_SYSCALL_VECTOR)
228 set_intr_gate(vector, interrupt[i]);
229 }
230
231 apic_intr_init();
219 232
220 if (!acpi_ioapic) 233 if (!acpi_ioapic)
221 setup_irq(2, &irq2); 234 setup_irq(2, &irq2);