diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-04-26 16:06:20 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-04-26 16:06:20 +0200 |
| commit | 3210d2e3f38a73090bcdbdd68623c676868529ce (patch) | |
| tree | 590a4ccfa858b45ddeef4a4a279bdbb57f2c80e8 /Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp | |
| parent | 03a0fee13445aeb95f01d64409e5304b8e97b31c (diff) | |
MHR-16: Final fix of ACPI (really).
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp')
| -rw-r--r-- | Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
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 <Builtins/ACPI/ACPIFactoryInterface.hxx> #include <HALKit/AMD64/Processor.hpp> +#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 |
