diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-01-02 21:10:13 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-01-02 21:10:13 +0100 |
| commit | cbfa3f14674713910077f024958d96fd31b4f36f (patch) | |
| tree | 23a603a8ac25b8d7ff1305f80087222a9233aee2 /dev/Kernel/src/HardwareThreadScheduler.cc | |
| parent | e154cbf9a2a9eedd4c122d6619f25d29e04610ef (diff) | |
FIX: Fix scheduler for the task switch, separate desktop and mobile
targets.
- Giving priority to aarch64 support.
- The scheduler needed those fixes before proceeding to aarch64
support.
- We use the register approach, which is correct here, the
platform code will just take those records and execute them.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/src/HardwareThreadScheduler.cc')
| -rw-r--r-- | dev/Kernel/src/HardwareThreadScheduler.cc | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/dev/Kernel/src/HardwareThreadScheduler.cc b/dev/Kernel/src/HardwareThreadScheduler.cc index 8ece31b9..91800ab7 100644 --- a/dev/Kernel/src/HardwareThreadScheduler.cc +++ b/dev/Kernel/src/HardwareThreadScheduler.cc @@ -4,6 +4,7 @@ ------------------------------------------- */ +#include "NewKit/Macros.h" #include <ArchKit/ArchKit.h> #include <KernelKit/UserProcessScheduler.h> #include <KernelKit/HardwareThreadScheduler.h> @@ -101,11 +102,6 @@ namespace Kernel Void HardwareThread::Wake(const bool wakeup) noexcept { fWakeup = wakeup; - - if (!fWakeup) - mp_hang_thread(fStack); - else - mp_wakeup_thread(fStack); } /***********************************************************************************/ @@ -116,27 +112,13 @@ namespace Kernel /***********************************************************************************/ Bool HardwareThread::Switch(VoidPtr image, Ptr8 stack_ptr, HAL::StackFramePtr frame, const ThreadID& pid) { - if (!frame || - !image || - !stack_ptr) - return No; - - if (!this->IsWakeup()) - return No; - - if (this->IsBusy()) - return No; - - if (!hal_check_stack(frame)) - return No; - this->fStack = frame; this->fSourcePID = pid; Bool ret = mp_register_process(image, stack_ptr, fStack, this->fSourcePID); if (ret) - this->Busy(true); + this->Busy(YES); return ret; } @@ -230,9 +212,6 @@ namespace Kernel /***********************************************************************************/ SizeT HardwareThreadScheduler::Capacity() noexcept { - if (fThreadList.Empty()) - return 0UL; - - return fThreadList.Capacity(); + return fThreadList.Count(); } } // namespace Kernel |
