From 4eb813ba7247d9e2bebf255ecc50f68c0a71bb72 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 20 Aug 2024 02:53:51 +0200 Subject: + IMP: Using Hybrid MP services on ZKA_EFI firmware. + Implement HPET on HardwareTimer and added a SoftwareTimer. + Implemented Hybrid MP Services on EFI.hxx. Signed-off-by: Amlal El Mahrouss --- dev/ZKA/Sources/Timer.cxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'dev/ZKA/Sources/Timer.cxx') diff --git a/dev/ZKA/Sources/Timer.cxx b/dev/ZKA/Sources/Timer.cxx index 041c4b67..7a5ebd8d 100644 --- a/dev/ZKA/Sources/Timer.cxx +++ b/dev/ZKA/Sources/Timer.cxx @@ -8,36 +8,40 @@ ///! BUGS: 0 ///! @file Timer.cxx +///! @brief Software Timer implementation using namespace Kernel; /// @brief Unimplemented as it is an interface. -Int32 HardwareTimerInterface::Wait() noexcept +Int32 TimerInterface::Wait() noexcept { return kErrorUnimplemented; } -/// @brief HardwareTimer class, meant to be generic. +/// @brief SoftwareTimer class, meant to be generic. -HardwareTimer::HardwareTimer(Int64 seconds) +SoftwareTimer::SoftwareTimer(Int64 seconds) : fWaitFor(seconds) { - MUST_PASS(fWaitFor > 0); + fDigitalTimer = new IntPtr(); + MUST_PASS(fDigitalTimer); + } -HardwareTimer::~HardwareTimer() +SoftwareTimer::~SoftwareTimer() { + delete fDigitalTimer; fWaitFor = 0; } -Int32 HardwareTimer::Wait() noexcept +Int32 SoftwareTimer::Wait() noexcept { if (fWaitFor < 1) return -1; while (*fDigitalTimer < (*fDigitalTimer + fWaitFor)) { - ; + ++fDigitalTimer; } return 0; -- cgit v1.2.3