[FREELDR:UEFI] Correctly pass through ACPI information and map its memory (#8669)

This prevents bugchecks in Windows due to the ACPI table being overwritten
because of the incorrect UEFI to E820 memory mappings.

CORE-11954
This commit is contained in:
Sylas Hollander
2026-03-01 22:26:35 +03:00
committed by GitHub
parent 06ae7ec211
commit e1853c6621
2 changed files with 4 additions and 9 deletions
+2 -7
View File
@@ -18,8 +18,6 @@ DBG_DEFAULT_CHANNEL(WARNING);
extern EFI_SYSTEM_TABLE * GlobalSystemTable;
extern EFI_HANDLE GlobalImageHandle;
extern UCHAR PcBiosDiskCount;
extern EFI_MEMORY_DESCRIPTOR* EfiMemoryMap;
extern UINT32 FreeldrDescCount;
/* From uefivid.c */
extern ULONG_PTR VramAddress;
@@ -74,8 +72,7 @@ DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
AcpiPresent = TRUE;
/* Calculate the table size */
TableSize = FreeldrDescCount * sizeof(BIOS_MEMORY_MAP) +
sizeof(ACPI_BIOS_DATA) - sizeof(BIOS_MEMORY_MAP);
TableSize = sizeof(ACPI_BIOS_DATA);
/* Set 'Configuration Data' value */
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors[1]) + TableSize;
@@ -110,9 +107,7 @@ DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
AcpiBiosData->RSDTAddress.LowPart = Rsdp->rsdt_physical_address;
}
AcpiBiosData->Count = FreeldrDescCount;
RtlCopyMemory(AcpiBiosData->MemoryMap, EfiMemoryMap,
FreeldrDescCount * sizeof(BIOS_MEMORY_MAP));
AcpiBiosData->Count = 0;
TRACE("RSDT %p, data size %x\n", Rsdp->rsdt_physical_address, TableSize);
+2 -2
View File
@@ -127,9 +127,9 @@ UefiConvertToFreeldrDesc(EFI_MEMORY_TYPE EfiMemoryType)
case EfiUnusableMemory:
return LoaderBad;
case EfiACPIReclaimMemory:
return LoaderFirmwareTemporary;
return LoaderSpecialMemory;
case EfiACPIMemoryNVS:
return LoaderReserve;
return LoaderSpecialMemory;
case EfiMemoryMappedIO:
return LoaderReserve;
case EfiMemoryMappedIOPortSpace: