acpi: show APIC address found

This commit is contained in:
josh committed 2022-10-18 12:55:41 -04:00
1 parent 72b83b0c3c
commit dba58b2277
1 file changed
+3 -2
+3 -2
View File
@@ -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);
}
}
}