OcAcpiLib: Unlock tables located in low memory

closes acidanthera/bugtracker#1085
This commit is contained in:
Goldfish64 2020-08-20 13:07:34 -05:00
parent e5a85b17fc
commit 7741c09d64
4 changed files with 17 additions and 2 deletions

View File

@ -19,6 +19,7 @@
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/OcMemoryLib.h>
#include <Library/OcMiscLib.h>
#include <IndustryStandard/AcpiAml.h>
@ -561,6 +562,19 @@ AcpiInitContext (
Index
));
//
// Unlock table if in lower memory.
//
if ((UINTN)Context->Tables[DstIndex] < BASE_1MB) {
DEBUG ((
DEBUG_INFO,
"OCA: Unlocking table %08x at %p\n",
Context->Tables[DstIndex]->Signature,
Context->Tables[DstIndex]
));
LegacyRegionUnlock ((UINTN)Context->Tables[DstIndex], Context->Tables[DstIndex]->Length);
}
if (Context->Tables[DstIndex]->Signature == EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE) {
Context->Fadt = (EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE *) Context->Tables[DstIndex];

View File

@ -34,6 +34,7 @@
[LibraryClasses]
BaseLib
OcFileLib
OcMemoryLib
OcMiscLib
PrintLib

View File

@ -93,7 +93,7 @@ LegacyRegionLock (
DEBUG ((
DEBUG_INFO,
"Lock LegacyRegion %0X-%0X - %r\n",
"OCMM: Lock LegacyRegion %0X-%0X - %r\n",
LegacyAddress,
(LegacyAddress + (LegacyLength - 1)),
Status

View File

@ -93,7 +93,7 @@ LegacyRegionUnlock (
DEBUG ((
DEBUG_INFO,
"Unlock LegacyRegion %0X-%0X - %r\n",
"OCMM: Unlock LegacyRegion %0X-%0X - %r\n",
LegacyAddress,
(LegacyAddress + (LegacyLength - 1)),
Status