From 09dd11ddf800898c00ecb04a65fb5cd10fb481fa Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 8 May 2024 12:32:41 +0200 Subject: MHR-23: :boom: changes, reworked project tree. Signed-off-by: Amlal El Mahrouss --- NewKernel/HALKit/AMD64/HalHardwareMP.cpp | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 NewKernel/HALKit/AMD64/HalHardwareMP.cpp (limited to 'NewKernel/HALKit/AMD64/HalHardwareMP.cpp') diff --git a/NewKernel/HALKit/AMD64/HalHardwareMP.cpp b/NewKernel/HALKit/AMD64/HalHardwareMP.cpp new file mode 100644 index 00000000..e514eb55 --- /dev/null +++ b/NewKernel/HALKit/AMD64/HalHardwareMP.cpp @@ -0,0 +1,34 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#include + +// bugs = 0 + +namespace NewOS +{ + /// @brief wakes up thread. + /// wakes up thread from hang. + void rt_wakeup_thread(HAL::StackFrame* stack) + { + HAL::rt_cli(); + + stack->Rcx = 0; + + HAL::rt_sti(); + } + + /// @brief makes thread sleep. + /// hooks and hangs thread to prevent code from executing. + void rt_hang_thread(HAL::StackFrame* stack) + { + HAL::rt_cli(); + + stack->Rcx = 1; + + HAL::rt_sti(); + } +} // namespace NewOS -- cgit v1.2.3