send apic spurious ints to its own vector

This commit is contained in:
2026-09-25 18:15:26 +02:00
committed by Marvin Friedrich
parent ff4362ca5b
commit 32ee3895e6
2 changed files with 6 additions and 5 deletions
+5 -5
View File
@@ -57,7 +57,7 @@ void lapic_init(struct local_apic* lapic) {
// Reset the TPR. // Reset the TPR.
lapic_write_reg(lapic, APIC_REG_TPR, 0); lapic_write_reg(lapic, APIC_REG_TPR, 0);
// Enable APIC bit in the SIVR. // Enable APIC bit in the SIVR.
lapic_write_reg(lapic, APIC_REG_SIVR, lapic_read_reg(lapic, APIC_REG_SIVR) | 0x100); lapic_write_reg(lapic, APIC_REG_SIVR, (lapic_read_reg(lapic, APIC_REG_SIVR) & ~0xFF) | 0x100 | IDT_SPURIOUS);
if (lapic->xapic_regs) { if (lapic->xapic_regs) {
lapic_write_reg(lapic, APIC_REG_DFR, 0xF000'0000); lapic_write_reg(lapic, APIC_REG_DFR, 0xF000'0000);
@@ -84,10 +84,10 @@ void lapic_eoi(struct local_apic* lapic) {
lapic_write_reg(lapic, APIC_REG_EOI, 0); lapic_write_reg(lapic, APIC_REG_EOI, 0);
} }
#define PIC1_COMMAND_PORT 0x20 constexpr uint16_t PIC1_COMMAND_PORT = 0x20;
#define PIC1_DATA_PORT 0x21 constexpr uint16_t PIC1_DATA_PORT = 0x21;
#define PIC2_COMMAND_PORT 0xA0 constexpr uint16_t PIC2_COMMAND_PORT = 0xA0;
#define PIC2_DATA_PORT 0xA1 constexpr uint16_t PIC2_DATA_PORT = 0xA1;
void pic_disable() { void pic_disable() {
// We initialize the PIC properly, but completely disable it and use the APIC in favor of it. // We initialize the PIC properly, but completely disable it and use the APIC in favor of it.
+1
View File
@@ -198,4 +198,5 @@
#define CPL_KERNEL (0x0) #define CPL_KERNEL (0x0)
#define IDT_PF (0xE) #define IDT_PF (0xE)
#define IDT_SPURIOUS (0xFE)
#define IDT_IPI_RESCHED (0xFF) #define IDT_IPI_RESCHED (0xFF)