diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-09-28 17:01:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-28 17:01:48 +0200 |
| commit | 2117a9b0f4b84f5bd6c99566bcf5849a64104467 (patch) | |
| tree | 590b20056c62d04a496aa22f6bee0034a1430e4e /dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc | |
| parent | 0f88e96c0cf7ffaccecae94794024164c510f735 (diff) | |
| parent | b1302067703566624390d780dffd621bb99bb439 (diff) | |
Merge pull request #64 from nekernel-org/dev
ver: `kernel` v0.0.6
Diffstat (limited to 'dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc')
| -rw-r--r-- | dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc index df5386e4..e3e08830 100644 --- a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc +++ b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc @@ -88,7 +88,7 @@ struct LAPIC final { /// @param target /// @return /***********************************************************************************/ -Void hal_send_ipi_msg(UInt32 target, UInt32 apic_id, UInt8 vector) { +EXTERN_C Void hal_send_ipi_msg(UInt32 target, UInt32 apic_id, UInt8 vector) { Kernel::ke_dma_write<UInt32>(target, APIC_ICR_HIGH, apic_id << 24); Kernel::ke_dma_write<UInt32>(target, APIC_ICR_LOW, 0x00000600 | 0x00004000 | 0x00000000 | vector); @@ -200,10 +200,7 @@ Void mp_init_cores(VoidPtr vendor_ptr) noexcept { UInt8 type = *entry_ptr; UInt8 length = *(entry_ptr + 1); - // Avoid infinite loop on bad APIC tables. - if (length < 2) break; - - if (type == 0) { + if (type == 0 && length == sizeof(struct LAPIC)) { volatile LAPIC* entry_struct = (volatile LAPIC*) entry_ptr; if (entry_struct->Flags & 0x1) { @@ -212,15 +209,15 @@ Void mp_init_cores(VoidPtr vendor_ptr) noexcept { ++kSMPCount; - kout << "Kind: LAPIC: ON\r"; + kout << "AP: kind: LAPIC: ON.\r"; // 0x7c00, as recommended by the Intel SDM. hal_send_ipi_msg(kApicBaseAddress, entry_struct->ProcessorID, 0x7c); } else { - kout << "Kind: LAPIC: OFF\r"; + kout << "AP: kind: LAPIC: OFF.\r"; } } else { - kout << "Kind: UNKNOWN: OFF\r"; + kout << "AP: kind: UNKNOWN: OFF.\r"; } entry_ptr += length; |
