From dba58b2277abe86dc9932f7f8046ae98ae4a39bc Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 18 Oct 2022 12:55:41 -0400 Subject: [PATCH] acpi: show APIC address found --- src/hulk/acpi.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hulk/acpi.d b/src/hulk/acpi.d index 487f611..ce6f89b 100644 --- a/src/hulk/acpi.d +++ b/src/hulk/acpi.d @@ -3,7 +3,6 @@ */ module hulk.acpi; -import hulk.klog; import hulk.hurl; import hulk.klog; import hos.memory; @@ -54,7 +53,7 @@ struct acpi ubyte length; } - private static ulong apic_address; + public static __gshared ulong apic_address; public static void initialize(ulong acpi_xsdt_phys) { @@ -86,6 +85,7 @@ struct acpi const(MadtHeader) * madt_header = cast(const(MadtHeader) *)address; Hurl.map_range(address, madt_header.length, 0u); apic_address = madt_header.local_apic_address; + klog.writefln("Found 32-bit APIC address: 0x%x", apic_address); const(void) * madt_end = cast(const(void) *)(address + madt_header.length); const(MadtEntry) * madt_entry = cast(const(MadtEntry) *)(address + 0x2Cu); while (madt_entry < madt_end) @@ -95,6 +95,7 @@ struct acpi { /* Found a 64-bit Local APIC Address Override entry. */ memcpy(cast(void *)&apic_address, cast(const(void) *)madt_entry + 4u, 8u); + klog.writefln("Found 64-bit APIC address: 0x%x", apic_address); } } }