diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-26 04:57:17 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-26 04:58:02 +0200 |
| commit | 8dd831a5bff24ba599c1ba8ff49e9d094756ea7c (patch) | |
| tree | 34d0cae2598439c559f0dcc4c21c852e0605ed74 /dev/kernel/HALKit/AMD64 | |
| parent | 5b30cacacf0f0ca6fb06bb34389f04b05ceb2b15 (diff) | |
fix(HAL/AP): Fix task getter function inside AP system.
why:
- It used to modulo the index value, which will index an invalid index.
- Also refactored the function name to mp_get_current_task.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/HALKit/AMD64')
| -rw-r--r-- | dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc index 2ce05e7c..1d298698 100644 --- a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc +++ b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc @@ -101,8 +101,9 @@ Void hal_send_ipi_msg(UInt32 target, UInt32 apic_id, UInt8 vector) { /// @param thrdid The thread ID. /***********************************************************************************/ -EXTERN_C HAL::StackFramePtr mp_get_current_context(Int64 thrdid) { - const auto process_index = thrdid % kSchedProcessLimitPerTeam; +EXTERN_C HAL::StackFramePtr mp_get_current_task(Int64 thrdid) { + const auto process_index = thrdid; + if (thrdid > kSMPCount) return nullptr; return kHWThread[process_index].mFramePtr; } |
