diff options
author | Warner Losh <imp@FreeBSD.org> | 2022-07-30 10:43:21 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2022-07-30 10:48:35 +0000 |
commit | 2101541ff1222788901d9503001add9f288a4c40 (patch) | |
tree | bfbc4a7cb2d3d2bbb27c91989c9cce54ddd87e4b | |
parent | 43eebd036447f5399dd4bfa9b9d3e4e6f6596f48 (diff) | |
download | src-2101541ff1222788901d9503001add9f288a4c40.tar.gz src-2101541ff1222788901d9503001add9f288a4c40.zip |
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
-rw-r--r-- | stand/common/commands.c | 9 | ||||
-rw-r--r-- | stand/efi/loader/main.c | 9 |
2 files changed, 9 insertions, 9 deletions
diff --git a/stand/common/commands.c b/stand/common/commands.c index 0d21ed44c681..d86c1a4a6f96 100644 --- a/stand/common/commands.c +++ b/stand/common/commands.c @@ -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); diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index eb143989190d..d288c43d4592 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -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 |