summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/HALKit/POWER
diff options
context:
space:
mode:
Diffstat (limited to 'dev/kernel/HALKit/POWER')
-rw-r--r--dev/kernel/HALKit/POWER/HalApplicationProcessor.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/dev/kernel/HALKit/POWER/HalApplicationProcessor.cc b/dev/kernel/HALKit/POWER/HalApplicationProcessor.cc
index daa26e53..c2703af6 100644
--- a/dev/kernel/HALKit/POWER/HalApplicationProcessor.cc
+++ b/dev/kernel/HALKit/POWER/HalApplicationProcessor.cc
@@ -8,6 +8,8 @@
#include <HALKit/POWER/Processor.h>
#include <KernelKit/DebugOutput.h>
+/// @note This part of the HAL needs an owner.
+
namespace Kernel::Detail {
STATIC void mp_hang_fn(void) {
while (YES)
@@ -21,6 +23,9 @@ namespace Kernel {
void mp_wakeup_thread(HAL::StackFramePtr stack) {
if (!stack) return;
+ MUST_PASS(stack->R15 > 0);
+ MUST_PASS(stack->IP > 0);
+
hal_set_pc_to_hart(reinterpret_cast<HAL_HARDWARE_THREAD*>(stack->R15),
reinterpret_cast<VoidPtr>(stack->IP));
}
@@ -30,7 +35,9 @@ void mp_wakeup_thread(HAL::StackFramePtr stack) {
void mp_hang_thread(HAL::StackFramePtr stack) {
if (!stack) return;
+ MUST_PASS(stack->R15 > 0);
+
hal_set_pc_to_hart(reinterpret_cast<HAL_HARDWARE_THREAD*>(stack->R15),
reinterpret_cast<VoidPtr>(Kernel::Detail::mp_hang_fn));
}
-} // namespace Kernel \ No newline at end of file
+} // namespace Kernel