aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/irqinit_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/irqinit_32.c')
-rw-r--r--arch/x86/kernel/irqinit_32.c56
1 files changed, 33 insertions, 23 deletions
diff --git a/arch/x86/kernel/irqinit_32.c b/arch/x86/kernel/irqinit_32.c
index c56496f8c6fc..ddf3eb72f864 100644
--- a/arch/x86/kernel/irqinit_32.c
+++ b/arch/x86/kernel/irqinit_32.c
@@ -120,28 +120,8 @@ int vector_used_by_percpu_irq(unsigned int vector)
120 return 0; 120 return 0;
121} 121}
122 122
123/* Overridden in paravirt.c */ 123static void __init smp_intr_init(void)
124void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ")));
125
126void __init native_init_IRQ(void)
127{ 124{
128 int i;
129
130 /* all the set up before the call gates are initialised */
131 pre_intr_init_hook();
132
133 /*
134 * Cover the whole vector space, no vector can escape
135 * us. (some of these will be overridden and become
136 * 'special' SMP interrupts)
137 */
138 for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) {
139 /* SYSCALL_VECTOR was reserved in trap_init. */
140 if (i != SYSCALL_VECTOR)
141 set_intr_gate(i, interrupt[i-FIRST_EXTERNAL_VECTOR]);
142 }
143
144
145#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_SMP) 125#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_SMP)
146 /* 126 /*
147 * The reschedule interrupt is a CPU-to-CPU reschedule-helper 127 * The reschedule interrupt is a CPU-to-CPU reschedule-helper
@@ -170,8 +150,13 @@ void __init native_init_IRQ(void)
170 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt); 150 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
171 set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors); 151 set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors);
172#endif 152#endif
153}
173 154
155static void __init apic_intr_init(void)
156{
174#ifdef CONFIG_X86_LOCAL_APIC 157#ifdef CONFIG_X86_LOCAL_APIC
158 smp_intr_init();
159
175 /* self generated IPI for local APIC timer */ 160 /* self generated IPI for local APIC timer */
176 alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); 161 alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
177 162
@@ -181,12 +166,37 @@ void __init native_init_IRQ(void)
181# ifdef CONFIG_PERF_COUNTERS 166# ifdef CONFIG_PERF_COUNTERS
182 alloc_intr_gate(LOCAL_PERF_VECTOR, perf_counter_interrupt); 167 alloc_intr_gate(LOCAL_PERF_VECTOR, perf_counter_interrupt);
183# endif 168# endif
184#endif
185 169
186#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_MCE_P4THERMAL) 170# ifdef CONFIG_X86_MCE_P4THERMAL
187 /* thermal monitor LVT interrupt */ 171 /* thermal monitor LVT interrupt */
188 alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); 172 alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt);
173# endif
189#endif 174#endif
175}
176
177/* Overridden in paravirt.c */
178void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ")));
179
180void __init native_init_IRQ(void)
181{
182 int i;
183
184 /* all the set up before the call gates are initialised */
185 pre_intr_init_hook();
186
187 apic_intr_init();
188
189 /*
190 * Cover the whole vector space, no vector can escape
191 * us. (some of these will be overridden and become
192 * 'special' SMP interrupts)
193 */
194 for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) {
195 int vector = FIRST_EXTERNAL_VECTOR + i;
196 /* SYSCALL_VECTOR was reserved in trap_init. */
197 if (!test_bit(vector, used_vectors))
198 set_intr_gate(vector, interrupt[i]);
199 }
190 200
191 if (!acpi_ioapic) 201 if (!acpi_ioapic)
192 setup_irq(2, &irq2); 202 setup_irq(2, &irq2);