diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-16 09:51:24 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-16 10:08:17 +0200 |
| commit | 5b2ec031ab578caec8fbbdbe5350b9c0df493fd3 (patch) | |
| tree | a0aab7bea6ef32aaa48ece6bdf287974dd67c8eb /dev/kernel/HALKit/AMD64/HalAPICController.cc | |
| parent | b7c6e7aef4c2c647623520f65d78921841bdffaa (diff) | |
feat(kernel/ap): Improved and fixed the AP boot flow, also made sure that the segment
loading for the long mode stub works.
TODO:
- Stack pointer shall be set when jumping to AP routine.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/HALKit/AMD64/HalAPICController.cc')
| -rw-r--r-- | dev/kernel/HALKit/AMD64/HalAPICController.cc | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalAPICController.cc b/dev/kernel/HALKit/AMD64/HalAPICController.cc deleted file mode 100644 index e547d982..00000000 --- a/dev/kernel/HALKit/AMD64/HalAPICController.cc +++ /dev/null @@ -1,38 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include <HALKit/AMD64/Processor.h> -#include <modules/ACPI/ACPIFactoryInterface.h> - -#define kIOAPICRegVal (4) -#define kIOAPICRegReg (0) - -namespace Kernel::HAL { -APICController::APICController(VoidPtr base) : fApic(base) {} - -/// @brief Read from APIC controller. -/// @param reg register. -UInt32 APICController::Read(UInt32 reg) noexcept { - MUST_PASS(this->fApic); - - UInt32 volatile* io_apic = (UInt32 volatile*) this->fApic; - io_apic[kIOAPICRegReg] = (reg & 0xFF); - - return io_apic[kIOAPICRegVal]; -} - -/// @brief Write to APIC controller. -/// @param reg register. -/// @param value value. -Void APICController::Write(UInt32 reg, UInt32 value) noexcept { - MUST_PASS(this->fApic); - - UInt32 volatile* io_apic = (UInt32 volatile*) this->fApic; - - io_apic[kIOAPICRegReg] = (reg & 0xFF); - io_apic[kIOAPICRegVal] = value; -} -} // namespace Kernel::HAL |
