diff options
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); |