Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 May 2025 15:33:33 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e94f269cd329 - main - stand/efi: Initialize archsw at compile time
Message-ID:  <202505261533.54QFXXeK045076@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

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

commit e94f269cd3293187d52406f1904b82613964644f
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2025-05-26 03:25:26 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-05-26 15:30:37 +0000

    stand/efi: Initialize archsw at compile time
    
    Sponsored by:           Netflix
---
 stand/efi/loader/main.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
index c9a842afb06d..70cdfb2e9328 100644
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -71,7 +71,17 @@
 
 #include "loader_efi.h"
 
-struct arch_switch archsw;	/* MI/MD interface boundary */
+struct arch_switch archsw = {	/* MI/MD interface boundary */
+	.arch_autoload = efi_autoload,
+	.arch_getdev = efi_getdev,
+	.arch_copyin = efi_copyin,
+	.arch_copyout = efi_copyout,
+#if defined(__amd64__) || defined(__i386__)
+	.arch_hypervisor = x86_hypervisor,
+#endif
+	.arch_readin = efi_readin,
+	.arch_zfs_probe = efi_zfs_probe,
+};
 
 EFI_GUID acpi = ACPI_TABLE_GUID;
 EFI_GUID acpi20 = ACPI_20_TABLE_GUID;
@@ -1202,16 +1212,6 @@ main(int argc, CHAR16 *argv[])
 	char buf[32];
 	bool uefi_boot_mgr;
 
-	archsw.arch_autoload = efi_autoload;
-	archsw.arch_getdev = efi_getdev;
-	archsw.arch_copyin = efi_copyin;
-	archsw.arch_copyout = efi_copyout;
-#if defined(__amd64__) || defined(__i386__)
-	archsw.arch_hypervisor = x86_hypervisor;
-#endif
-	archsw.arch_readin = efi_readin;
-	archsw.arch_zfs_probe = efi_zfs_probe;
-
 #if !defined(__arm__)
 	efi_smbios_detect();
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505261533.54QFXXeK045076>