diff options
| author | Natasha Moongrave <natasha@256phi.eu> | 2026-03-10 15:57:45 +0100 |
|---|---|---|
| committer | Natasha Moongrave <natasha@256phi.eu> | 2026-03-10 15:57:45 +0100 |
| commit | 71e338f71eb015acd1e142f5880efae2102bc942 (patch) | |
| tree | 5ada4114b455fed4b24abb7402f6f9a0a57ef634 | |
| parent | c7eb282304081bfd13f7d371d12c567f52fe22eb (diff) | |
added a halt instruction loop to not sleep via constantly spinning the cpu on 100% but instead allow it enter a sleep state until the next instruction via the hlt signal in src/lib.rs
| -rw-r--r-- | StrixKernel/src/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/StrixKernel/src/lib.rs b/StrixKernel/src/lib.rs index 986c4cd..c2cf804 100644 --- a/StrixKernel/src/lib.rs +++ b/StrixKernel/src/lib.rs @@ -23,6 +23,14 @@ pub fn init() { x86_64::instructions::interrupts::enable(); } +pub fn hlt_loop() -> ! { + loop { + x86_64::instructions::hlt(); + } +} + +// TEST HANDLING + impl<T> Testable for T where T: Fn(), |
