git: 2101541ff122 - main - stand: Move quit command to common commands

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sat, 30 Jul 2022 10:48:45 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=2101541ff1222788901d9503001add9f288a4c40

commit 2101541ff1222788901d9503001add9f288a4c40
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-07-30 10:43:21 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-07-30 10:48:35 +0000

    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
---
 stand/common/commands.c | 9 +++++++++
 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