From 3210d2e3f38a73090bcdbdd68623c676868529ce Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 26 Apr 2024 16:06:20 +0200 Subject: MHR-16: Final fix of ACPI (really). Signed-off-by: Amlal El Mahrouss --- Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp') diff --git a/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp b/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp index 0761114d..37e8f0cc 100644 --- a/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp +++ b/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp @@ -6,6 +6,7 @@ #include #include +#include "NewKit/KernelCheck.hpp" /////////////////////////////////////////////////////////////////////////////////////// @@ -45,12 +46,12 @@ STATIC const char* kApicSignature = "APIC"; /// @brief Multiple APIC descriptor table. struct MadtType final : public SDT { struct MadtAddress final { - UInt32 fPhysicalAddress; UInt32 fFlags; // 1 = Dual Legacy PICs installed + UInt32 fPhysicalAddress; Char fType; Char fRecLen; // record length - }; + } Madt[]; }; struct MadtProcessorLocalApic final { @@ -97,11 +98,12 @@ void hal_system_get_cores(voidPtr rsdPtr) { auto acpi = ACPIFactoryInterface(rsdPtr); kApicMadt = acpi.Find(kApicSignature).Leak().Leak(); - MUST_PASS(kApicMadt); // MADT must exist. - - kcout << "New OS: Successfuly fetched the MADT!\r\n"; - - kApicInfoBlock = (MadtType*)kApicMadt; + if (kApicMadt) { + kcout << "New OS: Successfuly fetched the MADT!\r\n"; + kApicInfoBlock = (MadtType*)kApicMadt; + } else { + MUST_PASS(false); + } } } // namespace NewOS::HAL -- cgit v1.2.3