From 54a0f4c49d9bfb955174c87dae2f442d7f5a8b25 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 23 May 2025 11:12:31 +0200 Subject: feat!(Kernel): Improvements on the BitMapMgr, HTS, and UPS. other: - Add ZXD header file. - Reworking AMD64 interrupts. - Improved HTS's design implementation. - Improved UPS's balancing implementation. breaking changes: - Rename MemoryMgr to HeapMgr. Signed-off-by: Amlal El Mahrouss --- dev/kernel/src/HardwareThreadScheduler.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'dev/kernel/src/HardwareThreadScheduler.cc') diff --git a/dev/kernel/src/HardwareThreadScheduler.cc b/dev/kernel/src/HardwareThreadScheduler.cc index 23365af5..78bad9d6 100644 --- a/dev/kernel/src/HardwareThreadScheduler.cc +++ b/dev/kernel/src/HardwareThreadScheduler.cc @@ -92,11 +92,16 @@ Void HardwareThread::Wake(const bool wakeup) noexcept { /// @retval false stack is invalid, previous code is running. /***********************************************************************************/ Bool HardwareThread::Switch(HAL::StackFramePtr frame) { - this->fStack = frame; + if (!frame) { + return NO; + } - Bool ret = mp_register_task(fStack, this->fPID); + if (!hal_check_stack(frame)) { + return NO; + } - return ret; + this->fStack = frame; + return mp_register_task(fStack, this->fID); } /***********************************************************************************/ @@ -145,8 +150,6 @@ Ref HardwareThreadScheduler::operator[](SizeT idx) { return {kFakeThread}; } - fThreadList[idx].fPID = idx; - return &fThreadList[idx]; } -- cgit v1.2.3