From cbfd279a1410e11d734edc99509a3e0c02dc6fcc Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 3 Jan 2025 09:58:24 +0100 Subject: Worked on the AARCH64 HAL for TQ's boards, Add new spec in /doc/ Signed-off-by: Amlal El Mahrouss --- dev/Kernel/HALKit/ARM64/HalApplicationProcessor.cc | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 dev/Kernel/HALKit/ARM64/HalApplicationProcessor.cc (limited to 'dev/Kernel/HALKit/ARM64/HalApplicationProcessor.cc') diff --git a/dev/Kernel/HALKit/ARM64/HalApplicationProcessor.cc b/dev/Kernel/HALKit/ARM64/HalApplicationProcessor.cc new file mode 100644 index 00000000..fa62cf20 --- /dev/null +++ b/dev/Kernel/HALKit/ARM64/HalApplicationProcessor.cc @@ -0,0 +1,40 @@ +/* ------------------------------------------- + + Copyright (C) 2024, Theater Quality Corp, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include + +using namespace Kernel; + +namespace Kernel::Detail +{ + STATIC void mp_hang_fn(void) + { + while (YES) + ; + } +} // namespace Kernel::Detail + +/// @brief wakes up thread from it's hang state. +/// wakes up thread from hang. +Void mp_wakeup_thread(HAL::StackFramePtr stack) +{ + if (!stack) + return; + + hal_set_pc_to_hart(reinterpret_cast(stack->R15), reinterpret_cast(stack->BP)); +} + +/// @brief makes thread go to hang state. +/// hooks and hangs thread to prevent code from executing. +Void mp_hang_thread(HAL::StackFramePtr stack) +{ + if (!stack) + return; + + hal_set_pc_to_hart(reinterpret_cast(stack->R15), reinterpret_cast(Kernel::Detail::mp_hang_fn)); +} -- cgit v1.2.3