Page MenuHomeFreeBSD

D49292.id152028.diff
No OneTemporary

D49292.id152028.diff

diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -1156,6 +1156,7 @@
main(int argc, CHAR16 *argv[])
{
EFI_GUID *guid;
+ VOID *smbios_v2_ptr __unused;
int howto, i, uhowto;
UINTN k;
bool has_kbd, is_last;
@@ -1180,19 +1181,37 @@
archsw.arch_zfs_probe = efi_zfs_probe;
#if !defined(__arm__)
+ smbios_v2_ptr = NULL;
for (k = 0; k < ST->NumberOfTableEntries; k++) {
+ bool is_smbios_v2, is_smbios_v3;
+
guid = &ST->ConfigurationTable[k].VendorGuid;
- if (!memcmp(guid, &smbios, sizeof(EFI_GUID)) ||
- !memcmp(guid, &smbios3, sizeof(EFI_GUID))) {
+ is_smbios_v2 = memcmp(guid, &smbios, sizeof(*guid)) == 0;
+ is_smbios_v3 = memcmp(guid, &smbios3, sizeof(*guid)) == 0;
+
+ if (is_smbios_v2 || is_smbios_v3) {
+ VOID *const VT = ST->ConfigurationTable[k].VendorTable;
char buf[40];
- snprintf(buf, sizeof(buf), "%p",
- ST->ConfigurationTable[k].VendorTable);
+ snprintf(buf, sizeof(buf), "%p", VT);
setenv("hint.smbios.0.mem", buf, 1);
- smbios_detect(ST->ConfigurationTable[k].VendorTable);
- break;
+ if (is_smbios_v2)
+ /*
+ * We will parse a v2 table only if we don't
+ * find a v3 table. In the meantime, store the
+ * address.
+ */
+ smbios_v2_ptr = VT;
+ else
+ if (smbios_detect(VT) != NULL) {
+ /* v3 parsing was successful. */
+ smbios_v2_ptr = NULL;
+ break;
+ }
}
}
+ if (smbios_v2_ptr != NULL)
+ (void)smbios_detect(smbios_v2_ptr);
#endif
/* Get our loaded image protocol interface structure. */

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 2, 1:32 AM (1 h, 42 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37869856
Default Alt Text
D49292.id152028.diff (1 KB)

Event Timeline