[FREELDR] Retrieve the correct ACPI RSDP table address. (#1951) 1951/head
authorMark Harmstone <mark@harmstone.com>
Wed, 2 Oct 2019 11:43:30 +0000 (12:43 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 5 Oct 2019 21:20:53 +0000 (23:20 +0200)
Use either the RSDT (ACPI 1.0) or the XSDT (ACPI >1.0).
This fixes ACPI issues with Vista on VirtualBox.

boot/freeldr/freeldr/arch/i386/hwacpi.c

index dcaad2d..345e2c6 100644 (file)
@@ -94,7 +94,18 @@ DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
 
         /* Fill the table */
         AcpiBiosData = (PACPI_BIOS_DATA)&PartialResourceList->PartialDescriptors[1];
-        AcpiBiosData->RSDTAddress.LowPart = Rsdp->rsdt_physical_address;
+
+        if (Rsdp->revision > 0)
+        {
+            TRACE("ACPI >1.0, using XSDT address\n");
+            AcpiBiosData->RSDTAddress.QuadPart = Rsdp->xsdt_physical_address;
+        }
+        else
+        {
+            TRACE("ACPI 1.0, using RSDT address\n");
+            AcpiBiosData->RSDTAddress.LowPart = Rsdp->rsdt_physical_address;
+        }
+
         AcpiBiosData->Count = PcBiosMapCount;
         memcpy(AcpiBiosData->MemoryMap, PcBiosMemoryMap,
             PcBiosMapCount * sizeof(BIOS_MEMORY_MAP));