summaryrefslogtreecommitdiffhomepage
path: root/Kernel/HALKit/AMD64/HalHart.cpp
diff options
context:
space:
mode:
authorAmlal <amlalelmahrouss@icloud.com>2024-06-19 07:59:04 +0000
committerAmlal <amlalelmahrouss@icloud.com>2024-06-19 07:59:04 +0000
commitb820eb6a5a7948597d81998137b05ddc0eb0dbad (patch)
treedb4eaea0b6863076c4f1476f361e2317823a663a /Kernel/HALKit/AMD64/HalHart.cpp
parent36ff25861676cd1f5fb94b901fa59b015c614bc5 (diff)
parent6735570c44516661260546dadb81f0f5c238d1db (diff)
Merged in MHR-31 (pull request #16)
MHR-31: Round robin scheduler.
Diffstat (limited to 'Kernel/HALKit/AMD64/HalHart.cpp')
-rw-r--r--Kernel/HALKit/AMD64/HalHart.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/Kernel/HALKit/AMD64/HalHart.cpp b/Kernel/HALKit/AMD64/HalHart.cpp
new file mode 100644
index 00000000..069f3767
--- /dev/null
+++ b/Kernel/HALKit/AMD64/HalHart.cpp
@@ -0,0 +1,34 @@
+/* -------------------------------------------
+
+ Copyright Zeta Electronics Corporation
+
+------------------------------------------- */
+
+#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();
+
+ rt_do_context_switch(stack);
+
+ HAL::rt_sti();
+ }
+
+ /// @brief makes the thread sleep on a loop.
+ /// hooks and hangs thread to prevent code from executing.
+ void rt_hang_thread(HAL::StackFrame* stack)
+ {
+ while (true)
+ {
+ /* nohing, code is spinning */
+ }
+
+ }
+} // namespace NewOS