From 934fbad33f2ec3f583ebc80f36c0da0903d9dadf Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Thu, 26 Oct 2017 12:05:50 +0200 Subject: EFI: add poweroff support Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Sascha Hauer --- common/efi/efi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'common/efi') diff --git a/common/efi/efi.c b/common/efi/efi.c index 4b42f5d676..561ce4c081 100644 --- a/common/efi/efi.c +++ b/common/efi/efi.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -283,9 +284,18 @@ static void __noreturn efi_restart_system(struct restart_handler *rst) hang(); } +static void __noreturn efi_poweroff_system(struct poweroff_handler *handler) +{ + shutdown_barebox(); + RT->reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL); + + hang(); +} + static int restart_register_feature(void) { restart_handler_register_fn(efi_restart_system); + poweroff_handler_register_fn(efi_poweroff_system); return 0; } -- cgit v1.2.3