diff options
Diffstat (limited to 'dev/ZKA/Sources')
| -rw-r--r-- | dev/ZKA/Sources/Semaphore.cxx | 2 | ||||
| -rw-r--r-- | dev/ZKA/Sources/String.cxx | 11 | ||||
| -rw-r--r-- | dev/ZKA/Sources/Timer.cxx | 18 |
3 files changed, 23 insertions, 8 deletions
diff --git a/dev/ZKA/Sources/Semaphore.cxx b/dev/ZKA/Sources/Semaphore.cxx index c159240e..f9da0703 100644 --- a/dev/ZKA/Sources/Semaphore.cxx +++ b/dev/ZKA/Sources/Semaphore.cxx @@ -32,7 +32,7 @@ namespace Kernel return fLockingProcess; } - bool Semaphore::LockOrWait(PROCESS_HEADER_BLOCK* process, HardwareTimerInterface* timer) + bool Semaphore::LockOrWait(PROCESS_HEADER_BLOCK* process, TimerInterface* timer) { if (process == nullptr) return false; diff --git a/dev/ZKA/Sources/String.cxx b/dev/ZKA/Sources/String.cxx index 8ea7d65f..8c928aa5 100644 --- a/dev/ZKA/Sources/String.cxx +++ b/dev/ZKA/Sources/String.cxx @@ -183,6 +183,17 @@ namespace Kernel return true; } + bool StringBuilder::Equals(const WideChar* lhs, const WideChar* rhs) + { + for (Size index = 0; rhs[index] != 0; ++index) + { + if (rhs[index] != lhs[index]) + return false; + } + + return true; + } + const char* StringBuilder::Format(const char* fmt, const char* fmt2) { if (!fmt || !fmt2) 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; |
