diff options
author | Ian Moffett <ian@osmora.org> | 2025-05-19 00:59:49 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-05-19 00:59:49 -0400 |
commit | 5138d871202317c7432549b1ac663f26eb3a8759 (patch) | |
tree | a85bd8bd3ea8b7fe3b03f7f33180f3738831a278 /sys | |
parent | 4f27072e20aa16fc7ceed89476ded78c1a9ec26b (diff) |
kernel/amd64: Add reboot RESET and POWEROFF flags
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/reboot.c | 5 | ||||
-rw-r--r-- | sys/include/sys/reboot.h | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/reboot.c b/sys/arch/amd64/amd64/reboot.c index b9df1c0..64db09e 100644 --- a/sys/arch/amd64/amd64/reboot.c +++ b/sys/arch/amd64/amd64/reboot.c @@ -32,10 +32,15 @@ #include <sys/cdefs.h> #include <machine/pio.h> #include <machine/cpu.h> +#include <dev/acpi/acpi.h> void cpu_reboot(int method) { + if (ISSET(method, REBOOT_POWEROFF)) { + acpi_sleep(ACPI_SLEEP_S5); + } + if (ISSET(method, REBOOT_HALT)) { cpu_halt_all(); } diff --git a/sys/include/sys/reboot.h b/sys/include/sys/reboot.h index 86fc45d..eeb55f8 100644 --- a/sys/include/sys/reboot.h +++ b/sys/include/sys/reboot.h @@ -33,9 +33,10 @@ #include <sys/param.h> #include <sys/cdefs.h> -#define REBOOT_HALT BIT(0) /* Halt instead of rebooting */ - #if defined(_KERNEL) +#define REBOOT_RESET 0x00000000 +#define REBOOT_HALT BIT(0) /* Halt instead of rebooting */ +#define REBOOT_POWEROFF BIT(1) /* Power off (needs REBOOT_HALT set too) */ void cpu_reboot(int method); |