From a9eb352aeaf8b42d24715377c29a5b3ec8f14fcd Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Mon, 30 Sep 2019 13:33:44 +0100 Subject: [PATCH] arch: acpi: Patch the 32-bit PCI device area in the APCI table Patch the table with the currently used constants. This will be relevant when we want to adjust the size of the PCI device area to accomodate the PCI MMCONFIG region. Signed-off-by: Rob Bradford --- arch/src/x86_64/acpi.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/src/x86_64/acpi.rs b/arch/src/x86_64/acpi.rs index dc4168194..aee840d6a 100644 --- a/arch/src/x86_64/acpi.rs +++ b/arch/src/x86_64/acpi.rs @@ -151,6 +151,14 @@ pub fn create_dsdt_table( 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x79, 0x00, ]; + // Patch Range Minimum/Range Maximum/Length for the the 64-bit device area + pci_dsdt_data[170..174].copy_from_slice(&layout::MEM_32BIT_DEVICES_START.0.to_le_bytes()[0..4]); + pci_dsdt_data[174..178].copy_from_slice( + &(layout::MEM_32BIT_DEVICES_START.0 + layout::MEM_32BIT_DEVICES_SIZE - 1).to_le_bytes() + [0..4], + ); + pci_dsdt_data[182..186].copy_from_slice(&layout::MEM_32BIT_DEVICES_SIZE.to_le_bytes()[0..4]); + // Patch the Range Minimum/Range Maximum/Length for the the 64-bit device area pci_dsdt_data[200..208].copy_from_slice(&(start_of_device_area.0).to_le_bytes()); pci_dsdt_data[208..216].copy_from_slice(&end_of_device_area.0.to_le_bytes());