From a8366afaf39321ae2bbae70740f5ca65bee06769 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 17 Mar 2024 19:54:32 +0100 Subject: unrelated: Rework the ACPI interface. Signed-off-by: Amlal El Mahrouss --- Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp') diff --git a/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp b/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp index edb821b9..d9161d17 100644 --- a/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp +++ b/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp @@ -4,7 +4,7 @@ ------------------------------------------- */ -#include +#include #include /////////////////////////////////////////////////////////////////////////////////////// @@ -39,10 +39,11 @@ struct ProcessorInfoAMD64 final { } Selector; }; -static voidPtr kApicMadt = nullptr; -static const char* kApicSignature = "APIC"; +STATIC voidPtr kApicMadt = nullptr; +STATIC const char* kApicSignature = "APIC"; -struct Madt final { +/// @brief Multiple APIC descriptor table. +struct MadtType final { char fMag[4]; Int32 fLength; char fRev; @@ -90,10 +91,10 @@ struct MadtLocalApicAddressOverride final { /////////////////////////////////////////////////////////////////////////////////////// -static Madt kApicMadtList[256]; +STATIC MadtType kApicMadtList[256]; -Madt* system_find_core(Madt* madt) { - madt = madt + sizeof(Madt); +MadtType* system_find_core(MadtType* madt) { + madt = madt + sizeof(MadtType); if (rt_string_cmp(madt->fMag, kApicSignature, rt_string_len(kApicSignature)) == 0) @@ -105,13 +106,13 @@ Madt* system_find_core(Madt* madt) { /////////////////////////////////////////////////////////////////////////////////////// void hal_system_get_cores(voidPtr rsdPtr) { - auto acpi = ACPIManager(rsdPtr); + auto acpi = ACPIFactoryInterface(rsdPtr); kApicMadt = acpi.Find(kApicSignature).Leak().Leak(); MUST_PASS(kApicMadt); // MADT must exist. SizeT counter = 0UL; - Madt* offset = system_find_core((Madt*)kApicMadt); + MadtType* offset = system_find_core((MadtType*)kApicMadt); //! now find core addresses. while (offset != nullptr) { // calls rt_copy_memory in NewC++ -- cgit v1.2.3