summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/src/HardwareThreadScheduler.cc
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-15 13:56:17 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-15 13:56:17 +0200
commit6a30f42d5dcd0f944262147b2806db6c14fe7ffc (patch)
tree86d86a66df2941e49d1d332aaa1671c11db594e5 /dev/kernel/src/HardwareThreadScheduler.cc
parentf8aaa274535b6541f376090958eedbbba3ba00ba (diff)
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 <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/src/HardwareThreadScheduler.cc')
-rw-r--r--dev/kernel/src/HardwareThreadScheduler.cc12
1 files changed, 3 insertions, 9 deletions
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<UIntPtr>(image_ptr);
- this->fStack->SP = reinterpret_cast<UIntPtr>(stack_ptr);
-
Bool ret = mp_register_process(fStack, this->fPID);
if (ret) this->Busy(YES);