From nobody Sat Jul 30 10:48:45 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Lw1Md5Qvzz4XCT1; Sat, 30 Jul 2022 10:48:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lw1Md4vXNz3q04; Sat, 30 Jul 2022 10:48:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659178125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qblYATzomvA+h9AhzcwYWICeRwDtuBEv3baD2rrA7k=; b=a8xPp6Hb6sPOEI59VBcXqXUfsVIoEAfXfQKkT1G8a3NXqJi0wleBe/MTPgewlhRtgFj8Zz 2d+JORab5oNGIHfRMskm2/DFF6Ps5SSws4f5yEsusNVvk5dyoRUN+isTk+pk696X+MneFr yNSKxSmSYu+r+IT56NEWMhB+MJCZAW/9+pBYMH2su3SnXKjwSVOUlMNf5fKklx/+xhMXmU cy2QSvalKFjp2VMPyMIhRIGzo7ImXZ7H+91TIflRzb4ynN+uUH6SPujCofWyZdv5Rgs/qR /5CvHm1+IRLUX24EyAT4mTvcjpKoVo7+snS5TtiTTv1f7ohvEoGX+ovEUIkasA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Lw1Md3y8Fz1BF5; Sat, 30 Jul 2022 10:48:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26UAmjId031263; Sat, 30 Jul 2022 10:48:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26UAmju5031262; Sat, 30 Jul 2022 10:48:45 GMT (envelope-from git) Date: Sat, 30 Jul 2022 10:48:45 GMT Message-Id: <202207301048.26UAmju5031262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2101541ff122 - main - stand: Move quit command to common commands List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2101541ff1222788901d9503001add9f288a4c40 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659178125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qblYATzomvA+h9AhzcwYWICeRwDtuBEv3baD2rrA7k=; b=kDPORjG3+8HFRAltPMEPp5ZLntzgKvwmu+FMyycMd38mvR4UGkxMVbXGOI8dAK+bok11Rv jJ4Ct7qZ158E5iy5rNQpMINSETK9z5IcbHXatGJaMaPyyPvZeh3UxcjLy2nQjvYcEuTI9L ikP+SEb8W1rPkQfCeZy6+tyYxMY/GlDuF2VirAlLbqA5lmeePJZW1HyX6qPXL9j1kQJhKm 64za+4rwzSIF+g9qKLrFcBGO1Dtsi0imfX+LBIJNGTjMQlhlGuE6E+9CFsGmy0wnieM6to 9X79JtJccj900y1H3abS511UxwB0xklY42JWi++PG5/xXrnAFWt/myjqQsZ2Qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659178125; a=rsa-sha256; cv=none; b=cKS3v5aOYQ5BJZxPps45l0PM7b6KAct+AmtNAjsrd5ZOXOq76FZBzdA8GRXrCtrsc29ATH xE0JZMvQ4+zBQGEG+hw2PJCzGpX5NTBgN/G9gIj+FPGCGc2wFbqj8aHKPaPvZ3dl/5nX5b wuuJCwJLDf/W2amnnUeO09VA/5SWHEqaHxy63em1YR5r+v5QcGO2eHoP/RVs9FpwIe4bCm WRh4QLXjKtEWfHNTxnFmq8IqTohZvH/6Xt9UhN5MFPElp9asdUR745zorBAzBuSqBtJGa2 MG0xwSI16iiKH3NHfTdMj//IcGCuuzZdBt/e3zVAgr23V2tauE6ZxjRFf9cu6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2101541ff1222788901d9503001add9f288a4c40 commit 2101541ff1222788901d9503001add9f288a4c40 Author: Warner Losh AuthorDate: 2022-07-30 10:43:21 +0000 Commit: Warner Losh 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