7649 loader.efi: fix extraction of firmare table info for smbios and acpi.
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
diff --git a/usr/src/boot/sys/boot/efi/loader/main.c b/usr/src/boot/sys/boot/efi/loader/main.c
index 249be4a..3cf7894 100644
--- a/usr/src/boot/sys/boot/efi/loader/main.c
+++ b/usr/src/boot/sys/boot/efi/loader/main.c
@@ -71,7 +71,7 @@
 EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL;
 EFI_GUID serial_io = SERIAL_IO_PROTOCOL;
 
-extern void acpi_detect(const caddr_t);
+extern void acpi_detect(void);
 void efi_serial_init(void);
 #ifdef EFI_ZFS_BOOT
 static void efi_zfs_probe(void);
@@ -191,6 +191,7 @@
 	int i, j, vargood, unit, howto;
 	struct devsw *dev;
 	uint64_t pool_guid;
+	void *ptr;
 	UINTN k;
 	int has_kbd;
 
@@ -404,18 +405,11 @@
 	setenv("LINES", "24", 1);	/* optional */
 	setenv("COLUMNS", "80", 1);	/* optional */
 	setenv("ISADIR", "amd64", 1);	/* we only build 64bit */
+	acpi_detect();
 
-	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))) {
-			smbios_detect(ST->ConfigurationTable[k].VendorTable);
-			continue;
-		}
-		if (!memcmp(guid, &acpi20, sizeof(EFI_GUID))) {
-			acpi_detect(ST->ConfigurationTable[k].VendorTable);
-		}
-	}
+	if ((ptr = efi_get_table(&smbios3)) == NULL)
+		ptr = efi_get_table(&smbios);
+	smbios_detect(ptr);
 
 	efi_serial_init();		/* detect and set up serial ports */
 	interact(NULL);			/* doesn't return */