stand: Move quit command to common commands

Since both EFI and the future kboot will benefit from a 'quit' command,
move it from efi/loader/main.c to common/commands.c. In EFI this command
exits back to the boot loader (which will cause the next BootXXXX in the
BootOrder list to be attempted). In kboot, this will exit back to
whatever called loader.kboot. In uboot this will cause a reset (which
will restart uboot, not quite a simple exit, but will look similar)
and in OFW it will execute OF_exit which should return to the
openfirmware prompt.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2022-07-30 04:43:21 -06:00
parent 43eebd0364
commit 2101541ff1
2 changed files with 9 additions and 9 deletions

View File

@ -576,3 +576,12 @@ command_readtest(int argc, char *argv[])
}
COMMAND_SET(readtest, "readtest", "Time a file read", command_readtest);
static int
command_quit(int argc, char *argv[])
{
exit(0);
return (CMD_OK);
}
COMMAND_SET(quit, "quit", "exit the loader", command_quit);

View File

@ -1280,15 +1280,6 @@ command_reboot(int argc, char *argv[])
return (CMD_ERROR);
}
COMMAND_SET(quit, "quit", "exit the loader", command_quit);
static int
command_quit(int argc, char *argv[])
{
exit(0);
return (CMD_OK);
}
COMMAND_SET(memmap, "memmap", "print memory map", command_memmap);
static int