From nobody Wed Dec 07 18:06:24 2022 X-Original-To: dev-commits-src-main@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 4NS4wc38Wbz4jRc7; Wed, 7 Dec 2022 18:06:24 +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 4NS4wc2XMcz4Ljp; Wed, 7 Dec 2022 18:06:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670436384; 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=t3Q/JnyNPG8BxDBnircm4qCYodUfJxSiSGqhOAkkBmc=; b=bMdB06IetZGoJ2u4xNkfzmitHBNuv7ITfyUNOlu7i89P71YquyiseBgufAlD3R4bixTUh8 moICKbSrO+UA6978FgXgHgzFwgPn59v3Gqt5AzAKtKpS4Xc/vN6eoBU0/jzLBh5lrHowgE sLQ0Ss8pPN22ZCZtWIQMKmEbAxiFhWPewPsd4Pj179+CwlYpjAmgyLGLPKRpoUzMIdLhU1 PuOTKw2BQ2N3syPN4zLGaKnGWIfeCzvuxvej2a9y1dzBXQVbcSAbTkjar6yRsW8bsnpxFd 6INB001RFCdxgDPcsGGMCJw8BWS410mjfjXL06yzJGMNRDhHzAWx3Lf/VbVW5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670436384; 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=t3Q/JnyNPG8BxDBnircm4qCYodUfJxSiSGqhOAkkBmc=; b=sGG6dEY4XLSb1MiLLLtz8wuySOgLsP/iBtUNetuFyU7JxxvZ/H5y2LiUKsWplKCgOFy8Pp YLwOd5c4/2v4LcNIyQb01/nunSxiV22HZmp0yFmZwZm3GJayYyx2898vyyq4MN4D7xhqS7 +Qgpd4azl/CBJ2x8/3tz2aaQzWmAmzNFA8XZfa0aTYUJL1BOf2HKb3IRmRRcb9/vPK1XL8 7Y9IZ2d3NxHRTysiidvzZxmNRVV/heb5G78J86v8DnBL2/wHuKbpOvpE5oF2r8B94nhLbM cBr8MnYBVEs/Bfoi66mCe0hbCh+3nPm5PpVVK+hqr3nNohYWsi4iV3U4kavDZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670436384; a=rsa-sha256; cv=none; b=UKI9hCm6xZuWJdcJoFZHh8oXfXA7r6eOHjyheMbmNkCckRRfQq1nTCEfxI+KO290NMUN8v lREiOFSVrsb4LlUukOxne5DdeuFRxoBVxXfL9yZgMPXqps1tIIvO51TyaNh+ZeYOVgSeS2 FRJWIxoGNz4z3+0PYfk4jXubV9hV+4+qMhzNxc0QUW4v3O51pvAyTQxdtgvZ1tJPUMq/CR KJkOT9k0OQsxYRHXlew+StW2FASKSLyKSvLUxBLVl9eiwZ+ehWdKUB/vxdXADOmSw+HYj9 WETpOsJEd5r9LidE6K9V3K1sOm8ptC5uliNp/+OLs+ecL+xBpR9fzD9iZ3SvnA== 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 4NS4wc1Tn1zQJk; Wed, 7 Dec 2022 18:06:24 +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 2B7I6Otj072362; Wed, 7 Dec 2022 18:06:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B7I6OHM072361; Wed, 7 Dec 2022 18:06:24 GMT (envelope-from git) Date: Wed, 7 Dec 2022 18:06:24 GMT Message-Id: <202212071806.2B7I6OHM072361@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: b11aebff4d4a - main - kboot: Mark the EFI specific parts of bootinfo.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: b11aebff4d4a301bfeac516b5be45080c8a11142 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b11aebff4d4a301bfeac516b5be45080c8a11142 commit b11aebff4d4a301bfeac516b5be45080c8a11142 Author: Warner Losh AuthorDate: 2022-12-06 17:55:58 +0000 Commit: Warner Losh CommitDate: 2022-12-07 18:00:54 +0000 kboot: Mark the EFI specific parts of bootinfo.c bootinfo.c is about to be shared with kboot since they create substantially similar environments / metadata tagging / etc. Tag this with #ifdef EFI for the moment until the proper abstracting out can happen. Sponsored by: Netflix --- stand/efi/loader/bootinfo.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 1185908f64be..1bd8c11c0028 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -40,8 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EFI #include #include +#endif #include "bootstrap.h" #include "modinfo.h" @@ -50,8 +52,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef EFI #include "loader_efi.h" #include "gfx_fb.h" +#endif #if defined(LOADER_FDT_SUPPORT) #include @@ -67,10 +71,12 @@ int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, static int bi_getboothowto(char *kargs) { +#ifdef EFI const char *sw, *tmp; char *opts; int speed, port; char buf[50]; +#endif char *console; int howto; @@ -83,6 +89,7 @@ bi_getboothowto(char *kargs) howto |= RB_SERIAL; if (strcmp(console, "nullconsole") == 0) howto |= RB_MUTE; +#ifdef EFI #if defined(__i386__) || defined(__amd64__) if (strcmp(console, "efi") == 0 && getenv("efi_8250_uid") != NULL && @@ -121,12 +128,14 @@ bi_getboothowto(char *kargs) NULL, NULL); } } +#endif #endif } return (howto); } +#ifdef EFI static EFI_STATUS efi_do_vmap(EFI_MEMORY_DESCRIPTOR *mm, UINTN sz, UINTN mmsz, UINT32 mmver) { @@ -295,6 +304,7 @@ bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) return (0); } +#endif /* * Load the information expected by an amd64 kernel. @@ -351,8 +361,10 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) return(EINVAL); } +#ifdef EFI /* Try reading the /etc/fstab file to select the root device */ getrootmount(devformat(rootdev)); +#endif addr = 0; for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { @@ -408,11 +420,15 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) #ifdef MODINFOMD_MODULEP file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof(module), &module); #endif +#ifdef EFI file_addmetadata(kfp, MODINFOMD_FW_HANDLE, sizeof(ST), &ST); +#endif #ifdef LOADER_GELI_SUPPORT geli_export_key_metadata(kfp); #endif +#ifdef EFI bi_load_efi_data(kfp, exit_bs); +#endif size = md_copymodules(0, is64); /* Find the size of the modules */ kernend = roundup(addr + size, PAGE_SIZE);