Skip to content

Commit 1076ddd

Browse files
mintsukiFlyGoat
authored andcommitted
ACPI: Prefer ACPI 2.0 over 1.0 table
Before this, it would be random depending on table order.
1 parent 96430dd commit 1076ddd

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/acpi.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,19 @@ bool acpi_init(struct csmwrap_priv *priv) {
369369
g_rsdp = (uintptr_t)table->VendorTable;
370370
break;
371371
}
372+
}
372373

373-
if (!efi_guidcmp(table->VendorGuid, acpiGuid)) {
374-
printf("Found ACPI 1.0 RSDT at %x, copied to %x\n", (uintptr_t)table->VendorTable, (uintptr_t)table_target);
375-
memcpy(table_target, table->VendorTable, sizeof(EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER));
376-
g_rsdp = (uintptr_t)table->VendorTable;
377-
break;
374+
if (g_rsdp == 0) {
375+
for (i = 0; i < gST->NumberOfTableEntries; i++) {
376+
EFI_CONFIGURATION_TABLE *table;
377+
table = gST->ConfigurationTable + i;
378+
379+
if (!efi_guidcmp(table->VendorGuid, acpiGuid)) {
380+
printf("Found ACPI 1.0 RSDT at %x, copied to %x\n", (uintptr_t)table->VendorTable, (uintptr_t)table_target);
381+
memcpy(table_target, table->VendorTable, sizeof(EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER));
382+
g_rsdp = (uintptr_t)table->VendorTable;
383+
break;
384+
}
378385
}
379386
}
380387

0 commit comments

Comments
 (0)