summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-05-27 01:26:44 -0400
committerIan Moffett <ian@osmora.org>2025-05-27 01:26:44 -0400
commitbc883188afb45dec4a3319ae05ebf6caab70f13a (patch)
tree826f0575ec73a56c88c9e512860dd4bbef3a4e8b
parent1dff0a2f878b8f70d175cb0d7cdd9ab3ffcb2f64 (diff)
kernel: Add md_halt()
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sys/include/arch/aarch64/cdefs.h1
-rw-r--r--sys/include/arch/amd64/cdefs.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/include/arch/aarch64/cdefs.h b/sys/include/arch/aarch64/cdefs.h
index a22c436..456a7fb 100644
--- a/sys/include/arch/aarch64/cdefs.h
+++ b/sys/include/arch/aarch64/cdefs.h
@@ -36,5 +36,6 @@
#define md_pause() __ASMV("yield")
#define md_intoff() __ASMV("msr daifset, #2")
#define md_inton() __ASMV("msr daifclr, #2")
+#define md_halt() __ASMV("hlt")
#endif /* !_AARCH64_CDEFS_H_ */
diff --git a/sys/include/arch/amd64/cdefs.h b/sys/include/arch/amd64/cdefs.h
index 256fd8b..bab0c89 100644
--- a/sys/include/arch/amd64/cdefs.h
+++ b/sys/include/arch/amd64/cdefs.h
@@ -41,5 +41,6 @@
#define md_pause() __ASMV("rep; nop") /* (F3 90) PAUSE */
#define md_intoff() __ASMV("cli") /* Clear interrupts */
#define md_inton() __ASMV("sti") /* Enable interrupts */
+#define md_hlt() __ASMV("hlt") /* Halt the processor */
#endif /* !_AMD64_CDEFS_H_ */