loader.efi: add poweroff command

Add poweroff command to make life a bit easier.

Reviewed by:	imp, allanjude
Approved by:	re (kib)
Differential Revision:	https://reviews.freebsd.org/D17535
This commit is contained in:
Toomas Soome 2018-10-12 16:24:49 +00:00
parent 555225c062
commit 0f31e1e6a8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=339334

View File

@ -993,6 +993,23 @@ main(int argc, CHAR16 *argv[])
return (EFI_SUCCESS); /* keep compiler happy */
}
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(reboot, "reboot", "reboot the system", command_reboot);
static int