From fa4de31aa4de4a9166899825eec5cf016ef88ffa Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sun, 17 Sep 2023 11:22:58 -0400 Subject: [PATCH] Store pertinent ACPI table pointers --- src/hulk/acpi.d | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/hulk/acpi.d b/src/hulk/acpi.d index 6d0846b..82167a4 100644 --- a/src/hulk/acpi.d +++ b/src/hulk/acpi.d @@ -9,7 +9,7 @@ import hulk.memory; struct Acpi { - static uint signature(string s) + private static uint signature(string s) { return s[0] | (s[1] << 8) | (s[2] << 16) | (s[3] << 24); } @@ -111,7 +111,11 @@ struct Acpi } } - public static __gshared ulong apic_address; + public __gshared ulong apic_address; + + public __gshared MADT * madt; + + public __gshared MCFG * mcfg; public static void initialize(ulong acpi_xsdt_phys) { @@ -148,11 +152,13 @@ struct Acpi (signature >> 24u) & 0xFFu); if (signature == APIC_SIGNATURE) { - (cast(MADT *)address).initialize(); + madt = cast(MADT *)address; + madt.initialize(); } else if (signature == MCFG_SIGNATURE) { - (cast(MCFG *)address).initialize(); + mcfg = cast(MCFG *)address; + mcfg.initialize(); } } }