diff --git a/towboot/src/boot/config_tables.rs b/towboot/src/boot/config_tables.rs index f16517d..2461a29 100644 --- a/towboot/src/boot/config_tables.rs +++ b/towboot/src/boot/config_tables.rs @@ -11,6 +11,8 @@ use uefi::table::cfg::{ SMBIOS3_GUID, }; +static mut RSDP_V2_SET: bool = false; + /// Go through all of the configuration tables. /// Some of them are interesting for Multiboot2. pub(super) fn parse_for_multiboot( @@ -49,12 +51,17 @@ fn handle_acpi(table: &ConfigTableEntry, info_builder: &mut InfoBuilder) { rsdp.revision(), rsdp.rsdt_address(), ); } else { - info_builder.set_rsdp_v2( - rsdp.signature(), rsdp.checksum(), - rsdp.oem_id().as_bytes()[0..6].try_into().unwrap(), - rsdp.revision(), rsdp.rsdt_address(), rsdp.length(), - rsdp.xsdt_address(), rsdp.ext_checksum(), - ); + unsafe { + if !RSDP_V2_SET { + info_builder.set_rsdp_v2( + rsdp.signature(), rsdp.checksum(), + rsdp.oem_id().as_bytes()[0..6].try_into().unwrap(), + rsdp.revision(), rsdp.rsdt_address(), rsdp.length(), + rsdp.xsdt_address(), rsdp.ext_checksum(), + ); + RSDP_V2_SET = true; + } + } } }