aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/kapi/cpu.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-10-29 11:15:50 +0100
committerFelix Morgner <felix.morgner@ost.ch>2025-10-29 11:15:50 +0100
commite7b04ef7f5da8e014e8b85fcf65448b317cca8ff (patch)
tree3741aaeb76b254f775c720dbe36471c0b7a90ceb /arch/x86_64/src/kapi/cpu.cpp
parent6434de8ff75a9143847ef529bc209790ac4909b3 (diff)
downloadteachos-e7b04ef7f5da8e014e8b85fcf65448b317cca8ff.tar.xz
teachos-e7b04ef7f5da8e014e8b85fcf65448b317cca8ff.zip
kapi: move halt to cpu namespace
Diffstat (limited to 'arch/x86_64/src/kapi/cpu.cpp')
-rw-r--r--arch/x86_64/src/kapi/cpu.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86_64/src/kapi/cpu.cpp b/arch/x86_64/src/kapi/cpu.cpp
new file mode 100644
index 0000000..22543ee
--- /dev/null
+++ b/arch/x86_64/src/kapi/cpu.cpp
@@ -0,0 +1,12 @@
+#include "kapi/cpu.hpp"
+
+namespace teachos::cpu
+{
+
+ auto halt() -> void
+ {
+ asm volatile("1: hlt\njmp 1b");
+ __builtin_unreachable();
+ }
+
+} // namespace teachos::cpu