aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2023-05-24 22:34:21 +0000
committerWarner Losh <imp@FreeBSD.org>2023-05-25 04:33:53 +0000
commit2efbc8e2840f6c0b8255a46527f2cdb32ace1bd1 (patch)
tree4de5935bde4b30c05a0b34095001a259fddcf129
parent8955236a10137a1b645e642baf4eaca9c6460547 (diff)
downloadsrc-2efbc8e2840f6c0b8255a46527f2cdb32ace1bd1.tar.gz
src-2efbc8e2840f6c0b8255a46527f2cdb32ace1bd1.zip
stand/efi/smbios: Move detection of smbios earlier.
It would be nice to make decisions early in boot, about maybe consoles, based on smbios variables. Set them just after we setup the archsw so we can use them everywhere. Sponsored by: Netflix Reviewed by: tsoome, kevans Differential Revision: https://reviews.freebsd.org/D40219
-rw-r--r--stand/efi/loader/main.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
index e5f9b40ae55f..8419331f7a19 100644
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -930,6 +930,22 @@ main(int argc, CHAR16 *argv[])
archsw.arch_readin = efi_readin;
archsw.arch_zfs_probe = efi_zfs_probe;
+#if !defined(__arm__)
+ for (k = 0; k < ST->NumberOfTableEntries; k++) {
+ guid = &ST->ConfigurationTable[k].VendorGuid;
+ if (!memcmp(guid, &smbios, sizeof(EFI_GUID)) ||
+ !memcmp(guid, &smbios3, sizeof(EFI_GUID))) {
+ char buf[40];
+
+ snprintf(buf, sizeof(buf), "%p",
+ ST->ConfigurationTable[k].VendorTable);
+ setenv("hint.smbios.0.mem", buf, 1);
+ smbios_detect(ST->ConfigurationTable[k].VendorTable);
+ break;
+ }
+ }
+#endif
+
/* Get our loaded image protocol interface structure. */
(void) OpenProtocolByHandle(IH, &imgid, (void **)&boot_img);
@@ -1181,22 +1197,6 @@ main(int argc, CHAR16 *argv[])
autoload_font(false); /* Set up the font list for console. */
efi_init_environment();
-#if !defined(__arm__)
- for (k = 0; k < ST->NumberOfTableEntries; k++) {
- guid = &ST->ConfigurationTable[k].VendorGuid;
- if (!memcmp(guid, &smbios, sizeof(EFI_GUID)) ||
- !memcmp(guid, &smbios3, sizeof(EFI_GUID))) {
- char buf[40];
-
- snprintf(buf, sizeof(buf), "%p",
- ST->ConfigurationTable[k].VendorTable);
- setenv("hint.smbios.0.mem", buf, 1);
- smbios_detect(ST->ConfigurationTable[k].VendorTable);
- break;
- }
- }
-#endif
-
interact(); /* doesn't return */
return (EFI_SUCCESS); /* keep compiler happy */