summaryrefslogtreecommitdiff
path: root/sys/firmware/acpi
diff options
context:
space:
mode:
authorsigsegv7 <ian@vegaa.systems>2023-09-17 05:28:14 -0400
committersigsegv7 <ian@vegaa.systems>2023-09-17 05:28:14 -0400
commitf1e6e1114aaa2c9be69c456a20da82c877a1c8e3 (patch)
tree9ee3afd61eac040b48b038e4a5d2b1bbc7a59f28 /sys/firmware/acpi
parentc0dbc1251d68f19c52d1bd51f6d0cbe1485f1fa5 (diff)
kernel/amd64: Add Local APIC driver
This commit introduces the initial Local APIC driver sources Signed-off-by: sigsegv7 <ian@vegaa.systems>
Diffstat (limited to 'sys/firmware/acpi')
-rw-r--r--sys/firmware/acpi/acpi_madt.c10
1 files changed, 9 insertions, 1 deletions
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 <firmware/acpi/acpi.h>
#include <firmware/acpi/tables.h>
#include <machine/ioapic.h>
+#include <machine/lapic.h>
#include <sys/cdefs.h>
#include <sys/panic.h>
#include <sys/syslog.h>
@@ -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;