Skip to content

Commit 9fb7eb3

Browse files
committed
Uefi: Look for an ACPI2 RSDP first
Only look for an ACPI v1 RSDP if no v2 RSDP was found.
1 parent 8ca8a7a commit 9fb7eb3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/bin/uefi.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ fn efi_main(image: Handle, st: SystemTable<Boot>) -> Status {
5959
rsdp_addr: {
6060
use uefi::table::cfg;
6161
let mut config_entries = system_table.config_table().iter();
62-
config_entries
63-
.find(|entry| matches!(entry.guid, cfg::ACPI_GUID | cfg::ACPI2_GUID))
64-
.map(|entry| PhysAddr::new(entry.address as u64))
62+
// look for an ACPI2 RSDP first
63+
let acpi2_rsdp = config_entries.find(|entry| matches!(entry.guid, cfg::ACPI2_GUID));
64+
// if no ACPI2 RSDP is found, look for a ACPI RSDP
65+
let rsdp = acpi2_rsdp
66+
.or_else(|| config_entries.find(|entry| matches!(entry.guid, cfg::ACPI_GUID)));
67+
rsdp.map(|entry| PhysAddr::new(entry.address as u64));
6568
},
6669
};
6770

0 commit comments

Comments
 (0)