From 5138d871202317c7432549b1ac663f26eb3a8759 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 19 May 2025 00:59:49 -0400 Subject: kernel/amd64: Add reboot RESET and POWEROFF flags Signed-off-by: Ian Moffett --- sys/arch/amd64/amd64/reboot.c | 5 +++++ 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 #include #include +#include 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 #include -#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); -- cgit v1.2.3