From 9cff7866d58bfd48cad3f32882b957499c06a649 Mon Sep 17 00:00:00 2001
From: Ian Moffett <ian@osmora.org>
Date: Sun, 19 May 2024 22:37:00 -0400
Subject: kernel: Add reboot() and reboot syscall

Signed-off-by: Ian Moffett <ian@osmora.org>
---
 sys/arch/amd64/amd64/machdep.c | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'sys/arch/amd64')

diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 6a24232..34bea11 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -330,6 +330,15 @@ processor_switch_to(struct proc *old_td, struct proc *new_td)
     amd64_fxrstor(new_pcb->fpu_state);
 }
 
+void
+cpu_reset(void)
+{
+    for (;;) {
+        /* Pulse the reset line */
+        outb(0x64, 0xFE);
+    }
+}
+
 void
 processor_init(void)
 {
-- 
cgit v1.2.3