diff options
| author | Amlal <amlal.elmahrouss@icloud.com> | 2025-01-26 12:19:50 +0100 |
|---|---|---|
| committer | Amlal <amlal.elmahrouss@icloud.com> | 2025-01-26 12:19:50 +0100 |
| commit | 7821342e0fd790c0933f3e2579659b09aaa25098 (patch) | |
| tree | a7c5acd8bfa93a6660ef869dfbdafafae0aeb50a /dev/Kernel/HALKit/AMD64 | |
| parent | c0cd417753523f60d9ef414b345f791b068071ed (diff) | |
ADD: Starting code in 0x7c000 on AMD64 APs. (HalApplicationProcessor.cc)
ADD: Add a MUST_PASS (debug) for IPCMsg.cc
Signed-off-by: Amlal <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/HALKit/AMD64')
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc | 10 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/Processor.h | 6 |
2 files changed, 6 insertions, 10 deletions
diff --git a/dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc b/dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc index 4234f11e..c6074d72 100644 --- a/dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc +++ b/dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc @@ -219,15 +219,9 @@ namespace Kernel::HAL kcout << "SMP: Starting APs...\r"; + UInt32 eax, edx; kApicBaseAddress = kMADTBlock->Address; - constexpr auto kMemoryAPStart = 0x7C000; - Char* ptr_ap_code = reinterpret_cast<Char*>(kMemoryAPStart); - - SizeT hal_ap_blob_len = hal_ap_blob_end - hal_ap_blob_start; - - rt_copy_memory((Char*)hal_ap_blob_start, ptr_ap_code, hal_ap_blob_len); - while (Yes) { if (kMADTBlock->List[index].Type > 9 || @@ -252,7 +246,7 @@ namespace Kernel::HAL /// TODO: HAL helper to create an address. - hal_send_sipi(kApicBaseAddress, kAPICLocales[kSMPCount], (UInt8)(((UIntPtr)ptr_ap_code) >> 12)); + hal_send_sipi(kApicBaseAddress, kAPICLocales[kSMPCount], (UInt8)(((UIntPtr)0x7c00) >> 12)); ++kSMPCount; break; diff --git a/dev/Kernel/HALKit/AMD64/Processor.h b/dev/Kernel/HALKit/AMD64/Processor.h index acdf7e42..623c8245 100644 --- a/dev/Kernel/HALKit/AMD64/Processor.h +++ b/dev/Kernel/HALKit/AMD64/Processor.h @@ -233,14 +233,16 @@ namespace Kernel::HAL /// @param lo low byte /// @param hi high byte /***********************************************************************************/ - inline Void hal_get_msr(UInt32 msr, UInt32* lo, UInt32* hi) noexcept + inline UInt32 hal_get_msr(UInt32 msr, UInt32* lo, UInt32* hi) noexcept { if (!lo || !hi) - return; + return 0; asm volatile("rdmsr" : "=a"(*lo), "=d"(*hi) : "c"(msr)); + + return *lo + *hi; } /// @brief Set Model-specific register. |
