From f1e6e1114aaa2c9be69c456a20da82c877a1c8e3 Mon Sep 17 00:00:00 2001 From: sigsegv7 Date: Sun, 17 Sep 2023 05:28:14 -0400 Subject: kernel/amd64: Add Local APIC driver This commit introduces the initial Local APIC driver sources Signed-off-by: sigsegv7 --- sys/firmware/acpi/acpi_madt.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys/firmware') diff --git a/sys/firmware/acpi/acpi_madt.c b/sys/firmware/acpi/acpi_madt.c index bf3007b..c23f2a4 100644 --- a/sys/firmware/acpi/acpi_madt.c +++ b/sys/firmware/acpi/acpi_madt.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -50,13 +51,20 @@ do_parse(void) uint8_t *cur = NULL; uint8_t *end = NULL; + void *ioapic_mmio_base = NULL; + void *lapic_mmio_base = NULL; + struct apic_header *hdr = NULL; struct ioapic *ioapic = NULL; - void *ioapic_mmio_base = NULL; cur = (uint8_t *)(madt + 1); end = (uint8_t *)madt + madt->hdr.length; + /* Init the Local APIC */ + lapic_mmio_base = (void *)(uintptr_t)madt->lapic_addr; + lapic_set_base(lapic_mmio_base); + + /* Parse the rest of the MADT */ while (cur < end) { hdr = (void *)cur; -- cgit v1.2.3