Skip to content

Commit e90ff42

Browse files
committed
efi: Expose ACPI RSDP table if present
If there is an ACPI RSDP table in the zero page then expose it through to the running kernel via the ACPI tables otherwise continue with the stub data. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
1 parent 82f301f commit e90ff42

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

src/efi/mod.rs

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -786,17 +786,32 @@ pub fn efi_exec(
786786
};
787787

788788
let vendor_data = 0u32;
789-
790-
let mut ct = efi::ConfigurationTable {
791-
vendor_guid: Guid::from_fields(
792-
0x678a_9665,
793-
0x9957,
794-
0x4e7c,
795-
0xa6,
796-
0x27,
797-
&[0x34, 0xc9, 0x46, 0x3d, 0xd2, 0xac],
798-
),
799-
vendor_table: &vendor_data as *const _ as *mut _,
789+
let acpi_rsdp_ptr = unsafe { *((ZERO_PAGE_START + 0x70) as u64 as *const u64) };
790+
791+
let mut ct = if acpi_rsdp_ptr != 0 {
792+
efi::ConfigurationTable {
793+
vendor_guid: Guid::from_fields(
794+
0x8868_e871,
795+
0xe4f1,
796+
0x11d3,
797+
0xbc,
798+
0x22,
799+
&[0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81],
800+
),
801+
vendor_table: acpi_rsdp_ptr as u64 as *mut _,
802+
}
803+
} else {
804+
efi::ConfigurationTable {
805+
vendor_guid: Guid::from_fields(
806+
0x678a_9665,
807+
0x9957,
808+
0x4e7c,
809+
0xa6,
810+
0x27,
811+
&[0x34, 0xc9, 0x46, 0x3d, 0xd2, 0xac],
812+
),
813+
vendor_table: &vendor_data as *const _ as *mut _,
814+
}
800815
};
801816

802817
let mut st = efi::SystemTable {

0 commit comments

Comments
 (0)