From f36396f7fcc1fc4c116a76fa43f1e9f7cd6e4084 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 17 Apr 2025 23:38:29 +0200 Subject: kernel, boot: recovering lost changes because of some git issue. Signed-off-by: Amlal El Mahrouss --- dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc | 28 ++++------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc') diff --git a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc index 43888f3b..938907f4 100644 --- a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc +++ b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc @@ -210,24 +210,15 @@ namespace Kernel::HAL if (kMADTBlock) { - SizeT index = 1; + SizeT index = 1UL; kSMPInterrupt = 0; kSMPCount = 0; - kout << "SMP: Starting APs...\r"; + kout << "SMP: Registering APIC IDs...\r"; kApicBaseAddress = kMADTBlock->Address; - constexpr auto kMemoryAPStart = 0x7C000; - Char* ptr_ap_code = reinterpret_cast(kMemoryAPStart); - - mm_map_page(ptr_ap_code, ptr_ap_code, kMMFlagsWr); - - 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 || @@ -241,18 +232,7 @@ namespace Kernel::HAL break; kAPICLocales[kSMPCount] = kMADTBlock->List[kSMPCount].LAPIC.ProcessorID; - (void)(kout << "SMP: APIC ID: " << number(kAPICLocales[kSMPCount]) << kendl); - - // I'll just make the AP start from scratch here. - - hal_send_start_ipi(kApicBaseAddress, kAPICLocales[kSMPCount]); - - HardwareTimer timer(Kernel::rtl_ms(10)); - timer.Wait(); - - /// TODO: HAL helper to create an address. - - hal_send_sipi(kApicBaseAddress, kAPICLocales[kSMPCount], (UInt8)(((UIntPtr)ptr_ap_code) >> 12)); + (Void)(kout << "SMP: APIC ID: " << number(kAPICLocales[kSMPCount]) << kendl); ++kSMPCount; break; @@ -264,7 +244,7 @@ namespace Kernel::HAL ++index; } - (void)(kout << "SMP: number of APs: " << number(kSMPCount) << kendl); + (Void)(kout << "SMP: Number of IDs: " << number(kSMPCount) << kendl); // Kernel is now SMP aware. // That means that the scheduler is now available (on MP Kernels) -- cgit v1.2.3