diff options
author | Ian Moffett <ian@osmora.org> | 2023-12-19 22:08:43 -0500 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2023-12-19 22:08:43 -0500 |
commit | e07242e3a1589742772732c4e739f78bdab20a00 (patch) | |
tree | be63a8cc66ce3388dc73ba1c441e816ae18ec5d3 /sys/firmware/acpi | |
parent | 4a6226af28a98501c05d961d8878c5e1091d0dee (diff) |
kernel/amd64: lapic: Fixup LAPIC state tracking
This commit removes the lapic_set_base() function and certain globals
from the Local APIC driver so it won't cause problems on hardware with
many CPU sockets or that is just wacky.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/firmware/acpi')
-rw-r--r-- | sys/firmware/acpi/acpi_init.c | 1 | ||||
-rw-r--r-- | sys/firmware/acpi/acpi_madt.c | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/firmware/acpi/acpi_init.c b/sys/firmware/acpi/acpi_init.c index 93a9cf4..4ba1928 100644 --- a/sys/firmware/acpi/acpi_init.c +++ b/sys/firmware/acpi/acpi_init.c @@ -107,7 +107,6 @@ acpi_init(void) panic("Root SDT has an invalid checksum!\n"); } root_sdt_entries = (root_sdt->hdr.length - sizeof(root_sdt->hdr)) / 4; - acpi_parse_madt(); #if defined(__x86_64__) /* Hyra requires HPET on x86_64 */ diff --git a/sys/firmware/acpi/acpi_madt.c b/sys/firmware/acpi/acpi_madt.c index 119a842..4f5ff10 100644 --- a/sys/firmware/acpi/acpi_madt.c +++ b/sys/firmware/acpi/acpi_madt.c @@ -31,6 +31,7 @@ #include <firmware/acpi/tables.h> #include <machine/ioapic.h> #include <machine/lapic.h> +#include <machine/cpu.h> #include <sys/cdefs.h> #include <sys/panic.h> #include <sys/syslog.h> @@ -46,7 +47,7 @@ __KERNEL_META("$Hyra$: acpi_madt.c, Ian Marco Moffett, " static struct acpi_madt *madt = NULL; static void -do_parse(void) +do_parse(struct cpu_info *ci) { uint8_t *cur = NULL; uint8_t *end = NULL; @@ -62,7 +63,7 @@ do_parse(void) /* Init the Local APIC */ lapic_mmio_base = (void *)(uintptr_t)madt->lapic_addr; - lapic_set_base(lapic_mmio_base); + ci->lapic_base = lapic_mmio_base; /* Parse the rest of the MADT */ while (cur < end) { @@ -127,7 +128,7 @@ irq_to_gsi(uint8_t irq) } void -acpi_parse_madt(void) +acpi_parse_madt(struct cpu_info *ci) { /* Prevent this function from running twice */ if (madt != NULL) { @@ -139,5 +140,5 @@ acpi_parse_madt(void) panic("Failed to query for ACPI MADT\n"); } - do_parse(); + do_parse(ci); } |