diff options
| author | Amlal <amlalelmahrouss@icloud.com> | 2024-06-19 07:59:04 +0000 |
|---|---|---|
| committer | Amlal <amlalelmahrouss@icloud.com> | 2024-06-19 07:59:04 +0000 |
| commit | b820eb6a5a7948597d81998137b05ddc0eb0dbad (patch) | |
| tree | db4eaea0b6863076c4f1476f361e2317823a663a /Kernel/HALKit/AMD64/HalHart.cpp | |
| parent | 36ff25861676cd1f5fb94b901fa59b015c614bc5 (diff) | |
| parent | 6735570c44516661260546dadb81f0f5c238d1db (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.cpp | 34 |
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 |
