git: e94f269cd329 - main - stand/efi: Initialize archsw at compile time
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 26 May 2025 15:33:33 UTC
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