diff --git a/arch/x86/apic.c b/arch/x86/apic.c index e03f72e8..9ff8c97b 100644 --- a/arch/x86/apic.c +++ b/arch/x86/apic.c @@ -164,7 +164,7 @@ void init_apic(unsigned int cpu_id, apic_mode_t mode) { vmap_4k(apic_get_base(apic_base), apic_base.base, L1_PROT_NOCACHE); spiv.reg = apic_read(APIC_SPIV); - spiv.vector = 0xFF; + spiv.vector = APIC_SPI_VECTOR; spiv.apic_enable = 1; apic_write(APIC_SPIV, spiv.reg); } diff --git a/arch/x86/entry.S b/arch/x86/entry.S index 5432716b..f3a6d368 100644 --- a/arch/x86/entry.S +++ b/arch/x86/entry.S @@ -115,6 +115,10 @@ ENTRY(asm_interrupt_handler_\sym) END_FUNC(asm_interrupt_handler_\sym) .endm +ENTRY(asm_interrupt_handler_dummy) + IRET +END_FUNC(asm_interrupt_handler_dummy) + ENTRY(handle_exception) SAVE_ALL_REGS diff --git a/arch/x86/traps.c b/arch/x86/traps.c index 0429edbc..bd76b384 100644 --- a/arch/x86/traps.c +++ b/arch/x86/traps.c @@ -43,6 +43,7 @@ extern void asm_interrupt_handler_uart1(void); extern void asm_interrupt_handler_uart2(void); extern void asm_interrupt_handler_keyboard(void); extern void asm_interrupt_handler_timer(void); +extern void asm_interrupt_handler_dummy(void); extern void terminate_user_task(void); @@ -165,6 +166,8 @@ void init_traps(const cpu_t *cpu) { _ul(asm_interrupt_handler_keyboard), GATE_DPL0, GATE_PRESENT, 0); set_intr_gate(&percpu->idt[APIC_TIMER_IRQ], __KERN_CS, _ul(asm_interrupt_handler_timer), GATE_DPL0, GATE_PRESENT, 0); + set_intr_gate(&percpu->idt[APIC_SPI_VECTOR], __KERN_CS, + _ul(asm_interrupt_handler_dummy), GATE_DPL0, GATE_PRESENT, 0); barrier(); lidt(&percpu->idt_ptr); diff --git a/include/arch/x86/traps.h b/include/arch/x86/traps.h index 431b0604..604212ca 100644 --- a/include/arch/x86/traps.h +++ b/include/arch/x86/traps.h @@ -48,6 +48,8 @@ #define KB_PORT2_IRQ KEYBOARD_PORT2_IRQ_VECTOR #define APIC_TIMER_IRQ APIC_TIMER_IRQ_VECTOR +#define APIC_SPI_VECTOR 0xFF + extern void init_traps(const cpu_t *cpu); extern void init_boot_traps(void); extern void init_rmode_traps(void);