git: 2efbc8e2840f - main - stand/efi/smbios: Move detection of smbios earlier.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 25 May 2023 04:34:01 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2efbc8e2840f6c0b8255a46527f2cdb32ace1bd1 commit 2efbc8e2840f6c0b8255a46527f2cdb32ace1bd1 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2023-05-24 22:34:21 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2023-05-25 04:33:53 +0000 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 --- stand/efi/loader/main.c | 32 ++++++++++++++++---------------- 1 file 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 */