summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/HALKit
diff options
context:
space:
mode:
Diffstat (limited to 'dev/kernel/HALKit')
-rw-r--r--dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc5
-rw-r--r--dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc2
2 files changed, 4 insertions, 3 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;
}
diff --git a/dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc b/dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc
index 70a5e2d9..02f09e23 100644
--- a/dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc
+++ b/dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc
@@ -103,7 +103,7 @@ namespace Detail {
/// @param thrdid The thread ID.
/***********************************************************************************/
-EXTERN_C HAL::StackFramePtr mp_get_current_context(ProcessID thrdid) {
+EXTERN_C HAL::StackFramePtr mp_get_current_task(ProcessID thrdid) {
return kHWThread[thrdid].mFramePtr;
}