Skip to content

Commit dc20b2d

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
x86/idt: Move interrupt gate initialization to IDT code
Move the gate intialization from interrupt init to the IDT code so all IDT related operations are at a single place. Signed-off-by: Thomas Gleixner <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 636a759 commit dc20b2d

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

arch/x86/kernel/idt.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,25 @@ void __init idt_setup_debugidt_traps(void)
286286
*/
287287
void __init idt_setup_apic_and_irq_gates(void)
288288
{
289+
int i = FIRST_EXTERNAL_VECTOR;
290+
void *entry;
291+
289292
idt_setup_from_table(idt_table, apic_idts, ARRAY_SIZE(apic_idts));
293+
294+
for_each_clear_bit_from(i, used_vectors, FIRST_SYSTEM_VECTOR) {
295+
entry = irq_entries_start + 8 * (i - FIRST_EXTERNAL_VECTOR);
296+
set_intr_gate(i, entry);
297+
}
298+
299+
for_each_clear_bit_from(i, used_vectors, NR_VECTORS) {
300+
#ifdef CONFIG_X86_LOCAL_APIC
301+
set_bit(i, used_vectors);
302+
set_intr_gate(i, spurious_interrupt);
303+
#else
304+
entry = irq_entries_start + 8 * (i - FIRST_EXTERNAL_VECTOR);
305+
set_intr_gate(i, entry);
306+
#endif
307+
}
290308
}
291309

292310
/**

arch/x86/kernel/irqinit.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,29 +89,11 @@ void __init init_IRQ(void)
8989

9090
void __init native_init_IRQ(void)
9191
{
92-
int i;
93-
9492
/* Execute any quirks before the call gates are initialised: */
9593
x86_init.irqs.pre_vector_init();
9694

9795
idt_setup_apic_and_irq_gates();
9896

99-
/*
100-
* Cover the whole vector space, no vector can escape
101-
* us. (some of these will be overridden and become
102-
* 'special' SMP interrupts)
103-
*/
104-
i = FIRST_EXTERNAL_VECTOR;
105-
for_each_clear_bit_from(i, used_vectors, FIRST_SYSTEM_VECTOR) {
106-
/* IA32_SYSCALL_VECTOR could be used in trap_init already. */
107-
set_intr_gate(i, irq_entries_start +
108-
8 * (i - FIRST_EXTERNAL_VECTOR));
109-
}
110-
#ifdef CONFIG_X86_LOCAL_APIC
111-
for_each_clear_bit_from(i, used_vectors, NR_VECTORS)
112-
set_intr_gate(i, spurious_interrupt);
113-
#endif
114-
11597
if (!acpi_ioapic && !of_ioapic && nr_legacy_irqs())
11698
setup_irq(2, &irq2);
11799

0 commit comments

Comments
 (0)