summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKAKit/src/HardwareThreadScheduler.cc
diff options
context:
space:
mode:
authorAmlal <amlal.elmahrouss@icloud.com>2024-11-02 07:46:45 +0100
committerAmlal <amlal.elmahrouss@icloud.com>2024-11-02 07:49:04 +0100
commitf5e656424dc41ff93c67bcc8139a76d40f525efc (patch)
treef701847fb8d2bec8a31c1f24f86afc5f2f338e64 /dev/ZKAKit/src/HardwareThreadScheduler.cc
parent358379efc79bdda8b5742b82b95c45063184d76f (diff)
IMP: minOSKrnl commit 1039.
- KernelKit: New allocation limit in Heap.cc - KernelKit: Add Matches method for password validation. - KernelKit: Scheduler and Thread have been improved with new validations on frame. - META: Ran format command. - NewKit: Add new Ptr8 type for UInt8* types. - MBCI: Fix codestyle. Signed-off-by: Amlal <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKAKit/src/HardwareThreadScheduler.cc')
-rw-r--r--dev/ZKAKit/src/HardwareThreadScheduler.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/dev/ZKAKit/src/HardwareThreadScheduler.cc b/dev/ZKAKit/src/HardwareThreadScheduler.cc
index 5c75853c..5c5b8f15 100644
--- a/dev/ZKAKit/src/HardwareThreadScheduler.cc
+++ b/dev/ZKAKit/src/HardwareThreadScheduler.cc
@@ -89,14 +89,14 @@ namespace Kernel
/// @note Those symbols are needed in order to switch and validate the stack.
- EXTERN Bool hal_check_stack(HAL::StackFramePtr stackPtr);
- EXTERN_C Bool mp_register_process(VoidPtr image, UInt8* stack_ptr, HAL::StackFramePtr frame_ptr);
+ EXTERN Bool hal_check_stack(HAL::StackFramePtr frame_ptr);
+ EXTERN_C Bool mp_register_process(VoidPtr image, Ptr8 stack_ptr, HAL::StackFramePtr frame_ptr);
/// @brief Switch to hardware thread.
/// @param stack the new hardware thread.
/// @retval true stack was changed, code is running.
/// @retval false stack is invalid, previous code is running.
- Bool HardwareThread::Switch(VoidPtr image, UInt8* stack_ptr, HAL::StackFramePtr frame)
+ Bool HardwareThread::Switch(VoidPtr image, Ptr8 stack_ptr, HAL::StackFramePtr frame)
{
if (!frame ||
!image ||
@@ -109,6 +109,9 @@ namespace Kernel
if (this->IsBusy())
return No;
+ if (!hal_check_stack(frame))
+ return No;
+
fStack = frame;
Bool ret = mp_register_process(image, stack_ptr, fStack);