efi: app: Support reading SMBIOS3 tables

Check for both GUIDs when looking for the SMBIOS tables. This allows
both table versions to be detected when running from OVMF.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-10-05 14:13:15 -06:00
parent f2c7cf87da
commit 6d5dc5ea55

View File

@@ -164,7 +164,8 @@ static void free_memory(struct efi_priv *priv)
static void scan_tables(struct efi_system_table *sys_table)
{
efi_guid_t acpi = EFI_ACPI_TABLE_GUID;
efi_guid_t smbios = SMBIOS3_TABLE_GUID;
efi_guid_t smbios = SMBIOS_TABLE_GUID;
efi_guid_t smbios3 = SMBIOS3_TABLE_GUID;
uint i;
for (i = 0; i < sys_table->nr_tables; i++) {
@@ -172,8 +173,9 @@ static void scan_tables(struct efi_system_table *sys_table)
if (!memcmp(&tab->guid, &acpi, sizeof(efi_guid_t)))
gd_set_acpi_start(map_to_sysmem(tab->table));
else if (!memcmp(&tab->guid, &smbios, sizeof(efi_guid_t)))
gd->arch.smbios_start = map_to_sysmem(tab->table);
else if (!memcmp(&tab->guid, &smbios, sizeof(efi_guid_t)) ||
!memcmp(&tab->guid, &smbios3, sizeof(efi_guid_t)))
gd_set_smbios_start(map_to_sysmem(tab->table));
}
}