diff options
-rw-r--r-- | usr/src/boot/sys/boot/efi/loader/main.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/usr/src/boot/sys/boot/efi/loader/main.c b/usr/src/boot/sys/boot/efi/loader/main.c index ef917ac632..337192c373 100644 --- a/usr/src/boot/sys/boot/efi/loader/main.c +++ b/usr/src/boot/sys/boot/efi/loader/main.c @@ -496,6 +496,23 @@ command_reboot(int argc __unused, char *argv[] __unused) return (CMD_ERROR); } +COMMAND_SET(poweroff, "poweroff", "power off the system", command_poweroff); + +static int +command_poweroff(int argc __unused, char *argv[] __unused) +{ + int i; + + for (i = 0; devsw[i] != NULL; ++i) + if (devsw[i]->dv_cleanup != NULL) + (devsw[i]->dv_cleanup)(); + + RS->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL); + + /* NOTREACHED */ + return (CMD_ERROR); +} + COMMAND_SET(memmap, "memmap", "print memory map", command_memmap); static int |