summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_reboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface/efi/efi_reboot.c')
-rw-r--r--src/interface/efi/efi_reboot.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/interface/efi/efi_reboot.c b/src/interface/efi/efi_reboot.c
index bfee36aa3..96638c48e 100644
--- a/src/interface/efi/efi_reboot.c
+++ b/src/interface/efi/efi_reboot.c
@@ -26,6 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
*
*/
+#include <errno.h>
#include <ipxe/efi/efi.h>
#include <ipxe/reboot.h>
@@ -41,4 +42,20 @@ static void efi_reboot ( int warm ) {
rs->ResetSystem ( ( warm ? EfiResetWarm : EfiResetCold ), 0, 0, NULL );
}
+/**
+ * Power off system
+ *
+ * @ret rc Return status code
+ */
+static int efi_poweroff ( void ) {
+ EFI_RUNTIME_SERVICES *rs = efi_systab->RuntimeServices;
+
+ /* Use runtime services to power off system */
+ rs->ResetSystem ( EfiResetShutdown, 0, 0, NULL );
+
+ /* Should never happen */
+ return -ECANCELED;
+}
+
PROVIDE_REBOOT ( efi, reboot, efi_reboot );
+PROVIDE_REBOOT ( efi, poweroff, efi_poweroff );