MdeModulePkg: AcpiTableDxe: make 4 GB table allocation limit optional

AARCH64 systems never require compatibility with legacy ACPI OSes, and
may not have any 32-bit addressable system RAM. To support ACPI on these
systems, we need to be able to relax the 4 GB allocation restriction.

So add a PCD PcdAcpiExposedTableVersions containing a bitmask describing
which ACPI versions are targeted, and wire it up it up to the memory
allocation calls in AcpiTableDxe/AcpiTableProtocol.c. I.e., if ACPI v1.0b
is not among the supported versions, the memory allocations are not limited
to 4 GB, and only table types that carry 64-bit addresses are emitted.

Note that this will inhibit the publishing of any tables that carry only
32-bit addresses, i.e., RSDPv1, RSDTv1 and RSDTv3.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Ard Biesheuvel
2016-02-17 15:37:58 +01:00
parent 0d4a6c3dfc
commit f9bbb8d9c3
4 changed files with 270 additions and 181 deletions

View File

@@ -19,7 +19,7 @@
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_ACPI_SDT_PROTOCOL mAcpiSdtProtocolTemplate = {
EFI_ACPI_TABLE_VERSION_NONE | EFI_ACPI_TABLE_VERSION_1_0B | ACPI_TABLE_VERSION_GTE_2_0,
EFI_ACPI_TABLE_VERSION_NONE,
GetAcpiTable2,
RegisterNotify,
Open,
@@ -1102,6 +1102,7 @@ SdtAcpiTableAcpiSdtConstructor (
InitializeListHead (&AcpiTableInstance->NotifyList);
CopyMem (&AcpiTableInstance->AcpiSdtProtocol, &mAcpiSdtProtocolTemplate, sizeof(mAcpiSdtProtocolTemplate));
AcpiTableInstance->AcpiSdtProtocol.AcpiVersion = (EFI_ACPI_TABLE_VERSION)PcdGet32 (PcdAcpiExposedTableVersions);
//
// Register event for ExitPmAuth, so that we can uninstall ACPI SDT protocol after ExitPmAuth.