summaryrefslogtreecommitdiffhomepage
path: root/NewKernel/HALKit/AMD64/HalHardwareMP.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NewKernel/HALKit/AMD64/HalHardwareMP.cpp')
-rw-r--r--NewKernel/HALKit/AMD64/HalHardwareMP.cpp34
1 files changed, 34 insertions, 0 deletions
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 <ArchKit/ArchKit.hpp>
+
+// 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