From 6a30f42d5dcd0f944262147b2806db6c14fe7ffc Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 15 May 2025 13:56:17 +0200 Subject: feat(kernel): Finalizing the first version of the user scheduler. other: - Removed DmaPool into its own Kit. - ApplicationProcessor unit has been cleaned up. - Rename functions of MemoryMgr. - Use KIB instead of MIBs of stack. - Cleanup parts of the scheduler, and hw scheduler. - Use UD handler for INT 6. Signed-off-by: Amlal El Mahrouss --- dev/kernel/src/HardwareThreadScheduler.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'dev/kernel/src/HardwareThreadScheduler.cc') diff --git a/dev/kernel/src/HardwareThreadScheduler.cc b/dev/kernel/src/HardwareThreadScheduler.cc index c49c3081..1df5ad7a 100644 --- a/dev/kernel/src/HardwareThreadScheduler.cc +++ b/dev/kernel/src/HardwareThreadScheduler.cc @@ -41,14 +41,14 @@ HardwareThread::~HardwareThread() = default; /***********************************************************************************/ //! @brief returns the id of the thread. /***********************************************************************************/ -const ThreadID& HardwareThread::ID() noexcept { +ThreadID& HardwareThread::ID() noexcept { return fID; } /***********************************************************************************/ //! @brief returns the kind of thread we have. /***********************************************************************************/ -const ThreadKind& HardwareThread::Kind() noexcept { +ThreadKind& HardwareThread::Kind() noexcept { return fKind; } @@ -104,16 +104,10 @@ Void HardwareThread::Wake(const bool wakeup) noexcept { /// @retval true stack was changed, code is running. /// @retval false stack is invalid, previous code is running. /***********************************************************************************/ -Bool HardwareThread::Switch(VoidPtr image_ptr, Ptr8 stack_ptr, HAL::StackFramePtr frame, - const ThreadID& pid) { - if (this->IsBusy()) return NO; - +Bool HardwareThread::Switch(HAL::StackFramePtr frame, const ThreadID& pid) { this->fStack = frame; this->fPID = pid; - this->fStack->BP = reinterpret_cast(image_ptr); - this->fStack->SP = reinterpret_cast(stack_ptr); - Bool ret = mp_register_process(fStack, this->fPID); if (ret) this->Busy(YES); -- cgit v1.2.3