Handle local APIC exceptions

This commit is contained in:
josh committed 2022-12-07 23:24:01 -05:00
1 parent 9b52ae58e8
commit b1a8f8d348
2 files changed
+23 -10

No files matched your search

+5 -4
View File
@@ -6,6 +6,7 @@ module hulk.apic;
import hulk.klog;
import hulk.hurl;
import hulk.acpi;
import hulk.idt;
struct apic
{
@@ -63,9 +64,9 @@ struct apic
/* Enable local APIC to receive interrupts and set spurious interrupt
* vector to 0xFF. */
apic_registers.spurious_interrupt_vector.value = 0x1FFu;
apic_registers.lvt_timer.value = 0x70u | PERIODIC_MODE;
apic_registers.lvt_lint[0].value = 0x71u;
apic_registers.lvt_lint[1].value = 0x72u;
apic_registers.lvt_timer.value = idt.EXCEPTION_LAPIC_TIMER | PERIODIC_MODE;
apic_registers.lvt_lint[0].value = idt.EXCEPTION_LAPIC_LINT0;
apic_registers.lvt_lint[1].value = idt.EXCEPTION_LAPIC_LINT1;
apic_registers.divide_configuration.value = 3u;
}
@@ -74,7 +75,7 @@ struct apic
apic_registers.eoi.value = 0u;
}
public static void isr()
public static void isr(ulong vector)
{
eoi();
}