[Concept,v2,11/20] efi: app: Support reading SMBIOS3 tables

Message ID 20251007170549.541981-12-sjg@u-boot.org
State New
Headers
Series expo: Complete mouse operation in the EFI app |

Commit Message

Simon Glass Oct. 7, 2025, 5:05 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

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>
---

(no changes since v1)

 lib/efi_client/efi_app.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
  

Patch

diff --git a/lib/efi_client/efi_app.c b/lib/efi_client/efi_app.c
index c851173f1ae..00003c27ec5 100644
--- a/lib/efi_client/efi_app.c
+++ b/lib/efi_client/efi_app.c
@@ -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));
 	}
 }