diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2008-08-11 10:34:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-11 10:43:09 -0400 |
commit | 2ae111cdd8d83ebf9de72e36e68a8c84b6ebbeea (patch) | |
tree | 0ca28a5869a172d0c76caa3ad8271524cc0a733b | |
parent | 15dd859cacf312f606f54502d1f66537a1e5c78c (diff) |
x86: apic interrupts - move assignments to irqinit_32.c, v2
64bit mode APIC interrupt handlers are set within irqinit_64.c.
Lets do tha same for 32bit mode which would help in furter code merging.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/apic_32.c | 48 | ||||
-rw-r--r-- | arch/x86/kernel/irqinit_32.c | 49 | ||||
-rw-r--r-- | arch/x86/mach-default/setup.c | 15 | ||||
-rw-r--r-- | include/asm-x86/arch_hooks.h | 2 |
4 files changed, 49 insertions, 65 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index f93c18f5b79d..9e341c9d9414 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -1354,54 +1354,6 @@ void smp_error_interrupt(struct pt_regs *regs) | |||
1354 | irq_exit(); | 1354 | irq_exit(); |
1355 | } | 1355 | } |
1356 | 1356 | ||
1357 | #ifdef CONFIG_SMP | ||
1358 | void __init smp_intr_init(void) | ||
1359 | { | ||
1360 | /* | ||
1361 | * IRQ0 must be given a fixed assignment and initialized, | ||
1362 | * because it's used before the IO-APIC is set up. | ||
1363 | */ | ||
1364 | set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]); | ||
1365 | |||
1366 | /* | ||
1367 | * The reschedule interrupt is a CPU-to-CPU reschedule-helper | ||
1368 | * IPI, driven by wakeup. | ||
1369 | */ | ||
1370 | alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt); | ||
1371 | |||
1372 | /* IPI for invalidation */ | ||
1373 | alloc_intr_gate(INVALIDATE_TLB_VECTOR, invalidate_interrupt); | ||
1374 | |||
1375 | /* IPI for generic function call */ | ||
1376 | alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt); | ||
1377 | |||
1378 | /* IPI for single call function */ | ||
1379 | set_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, | ||
1380 | call_function_single_interrupt); | ||
1381 | } | ||
1382 | #endif | ||
1383 | |||
1384 | /* | ||
1385 | * Initialize APIC interrupts | ||
1386 | */ | ||
1387 | void __init apic_intr_init(void) | ||
1388 | { | ||
1389 | #ifdef CONFIG_SMP | ||
1390 | smp_intr_init(); | ||
1391 | #endif | ||
1392 | /* self generated IPI for local APIC timer */ | ||
1393 | alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); | ||
1394 | |||
1395 | /* IPI vectors for APIC spurious and error interrupts */ | ||
1396 | alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); | ||
1397 | alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt); | ||
1398 | |||
1399 | /* thermal monitor LVT interrupt */ | ||
1400 | #ifdef CONFIG_X86_MCE_P4THERMAL | ||
1401 | alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); | ||
1402 | #endif | ||
1403 | } | ||
1404 | |||
1405 | /** | 1357 | /** |
1406 | * connect_bsp_APIC - attach the APIC to the interrupt system | 1358 | * connect_bsp_APIC - attach the APIC to the interrupt system |
1407 | */ | 1359 | */ |
diff --git a/arch/x86/kernel/irqinit_32.c b/arch/x86/kernel/irqinit_32.c index d66914287ee1..9200a1e2752d 100644 --- a/arch/x86/kernel/irqinit_32.c +++ b/arch/x86/kernel/irqinit_32.c | |||
@@ -74,6 +74,15 @@ void __init init_ISA_irqs (void) | |||
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
77 | /* | ||
78 | * IRQ2 is cascade interrupt to second interrupt controller | ||
79 | */ | ||
80 | static struct irqaction irq2 = { | ||
81 | .handler = no_action, | ||
82 | .mask = CPU_MASK_NONE, | ||
83 | .name = "cascade", | ||
84 | }; | ||
85 | |||
77 | /* Overridden in paravirt.c */ | 86 | /* Overridden in paravirt.c */ |
78 | void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ"))); | 87 | void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ"))); |
79 | 88 | ||
@@ -98,6 +107,46 @@ void __init native_init_IRQ(void) | |||
98 | set_intr_gate(vector, interrupt[i]); | 107 | set_intr_gate(vector, interrupt[i]); |
99 | } | 108 | } |
100 | 109 | ||
110 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_SMP) | ||
111 | /* | ||
112 | * IRQ0 must be given a fixed assignment and initialized, | ||
113 | * because it's used before the IO-APIC is set up. | ||
114 | */ | ||
115 | set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]); | ||
116 | |||
117 | /* | ||
118 | * The reschedule interrupt is a CPU-to-CPU reschedule-helper | ||
119 | * IPI, driven by wakeup. | ||
120 | */ | ||
121 | alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt); | ||
122 | |||
123 | /* IPI for invalidation */ | ||
124 | alloc_intr_gate(INVALIDATE_TLB_VECTOR, invalidate_interrupt); | ||
125 | |||
126 | /* IPI for generic function call */ | ||
127 | alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt); | ||
128 | |||
129 | /* IPI for single call function */ | ||
130 | set_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, call_function_single_interrupt); | ||
131 | #endif | ||
132 | |||
133 | #ifdef CONFIG_X86_LOCAL_APIC | ||
134 | /* self generated IPI for local APIC timer */ | ||
135 | alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); | ||
136 | |||
137 | /* IPI vectors for APIC spurious and error interrupts */ | ||
138 | alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); | ||
139 | alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt); | ||
140 | #endif | ||
141 | |||
142 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_MCE_P4THERMAL) | ||
143 | /* thermal monitor LVT interrupt */ | ||
144 | alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); | ||
145 | #endif | ||
146 | |||
147 | if (!acpi_ioapic) | ||
148 | setup_irq(2, &irq2); | ||
149 | |||
101 | /* setup after call gates are initialised (usually add in | 150 | /* setup after call gates are initialised (usually add in |
102 | * the architecture specific gates) | 151 | * the architecture specific gates) |
103 | */ | 152 | */ |
diff --git a/arch/x86/mach-default/setup.c b/arch/x86/mach-default/setup.c index 3d317836be9e..b00f5ad10ca1 100644 --- a/arch/x86/mach-default/setup.c +++ b/arch/x86/mach-default/setup.c | |||
@@ -36,15 +36,6 @@ void __init pre_intr_init_hook(void) | |||
36 | init_ISA_irqs(); | 36 | init_ISA_irqs(); |
37 | } | 37 | } |
38 | 38 | ||
39 | /* | ||
40 | * IRQ2 is cascade interrupt to second interrupt controller | ||
41 | */ | ||
42 | static struct irqaction irq2 = { | ||
43 | .handler = no_action, | ||
44 | .mask = CPU_MASK_NONE, | ||
45 | .name = "cascade", | ||
46 | }; | ||
47 | |||
48 | /** | 39 | /** |
49 | * intr_init_hook - post gate setup interrupt initialisation | 40 | * intr_init_hook - post gate setup interrupt initialisation |
50 | * | 41 | * |
@@ -60,12 +51,6 @@ void __init intr_init_hook(void) | |||
60 | if (x86_quirks->arch_intr_init()) | 51 | if (x86_quirks->arch_intr_init()) |
61 | return; | 52 | return; |
62 | } | 53 | } |
63 | #ifdef CONFIG_X86_LOCAL_APIC | ||
64 | apic_intr_init(); | ||
65 | #endif | ||
66 | |||
67 | if (!acpi_ioapic) | ||
68 | setup_irq(2, &irq2); | ||
69 | } | 54 | } |
70 | 55 | ||
71 | /** | 56 | /** |
diff --git a/include/asm-x86/arch_hooks.h b/include/asm-x86/arch_hooks.h index 72adc3a109cc..de4596b24c23 100644 --- a/include/asm-x86/arch_hooks.h +++ b/include/asm-x86/arch_hooks.h | |||
@@ -12,8 +12,6 @@ | |||
12 | /* these aren't arch hooks, they are generic routines | 12 | /* these aren't arch hooks, they are generic routines |
13 | * that can be used by the hooks */ | 13 | * that can be used by the hooks */ |
14 | extern void init_ISA_irqs(void); | 14 | extern void init_ISA_irqs(void); |
15 | extern void apic_intr_init(void); | ||
16 | extern void smp_intr_init(void); | ||
17 | extern irqreturn_t timer_interrupt(int irq, void *dev_id); | 15 | extern irqreturn_t timer_interrupt(int irq, void *dev_id); |
18 | 16 | ||
19 | /* these are the defined hooks */ | 17 | /* these are the defined hooks */ |