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:
parent
0d4a6c3dfc
commit
f9bbb8d9c3
|
@ -4,6 +4,7 @@
|
||||||
# and libraries instances, which are used for those modules.
|
# and libraries instances, which are used for those modules.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
|
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials are licensed and made available under
|
# This program and the accompanying materials are licensed and made available under
|
||||||
# the terms and conditions of the BSD License that accompanies this distribution.
|
# the terms and conditions of the BSD License that accompanies this distribution.
|
||||||
# The full text of the license may be found at
|
# The full text of the license may be found at
|
||||||
|
@ -1049,6 +1050,16 @@
|
||||||
# @Prompt Driver guid array of VFR drivers for VarCheckHiiBin generation.
|
# @Prompt Driver guid array of VFR drivers for VarCheckHiiBin generation.
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVarCheckVfrDriverGuidArray|{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }|VOID*|0x3000103A
|
gEfiMdeModulePkgTokenSpaceGuid.PcdVarCheckVfrDriverGuidArray|{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }|VOID*|0x3000103A
|
||||||
|
|
||||||
|
## Indicates which ACPI versions are targeted by the ACPI tables exposed to the OS
|
||||||
|
# These values are aligned with the definitions in MdePkg/Include/Protocol/AcpiSystemDescriptionTable.h
|
||||||
|
# BIT 1 - EFI_ACPI_TABLE_VERSION_1_0B.<BR>
|
||||||
|
# BIT 2 - EFI_ACPI_TABLE_VERSION_2_0.<BR>
|
||||||
|
# BIT 3 - EFI_ACPI_TABLE_VERSION_3_0.<BR>
|
||||||
|
# BIT 4 - EFI_ACPI_TABLE_VERSION_4_0.<BR>
|
||||||
|
# BIT 5 - EFI_ACPI_TABLE_VERSION_5_0.<BR>
|
||||||
|
# @Prompt Exposed ACPI table versions.
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x3E|UINT32|0x0001004c
|
||||||
|
|
||||||
[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
|
[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
|
||||||
## This PCD defines the Console output row. The default value is 25 according to UEFI spec.
|
## This PCD defines the Console output row. The default value is 25 according to UEFI spec.
|
||||||
# This PCD could be set to 0 then console output would be at max column and max row.
|
# This PCD could be set to 0 then console output would be at max column and max row.
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
GLOBAL_REMOVE_IF_UNREFERENCED
|
GLOBAL_REMOVE_IF_UNREFERENCED
|
||||||
EFI_ACPI_SDT_PROTOCOL mAcpiSdtProtocolTemplate = {
|
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,
|
GetAcpiTable2,
|
||||||
RegisterNotify,
|
RegisterNotify,
|
||||||
Open,
|
Open,
|
||||||
|
@ -1102,6 +1102,7 @@ SdtAcpiTableAcpiSdtConstructor (
|
||||||
|
|
||||||
InitializeListHead (&AcpiTableInstance->NotifyList);
|
InitializeListHead (&AcpiTableInstance->NotifyList);
|
||||||
CopyMem (&AcpiTableInstance->AcpiSdtProtocol, &mAcpiSdtProtocolTemplate, sizeof(mAcpiSdtProtocolTemplate));
|
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.
|
// Register event for ExitPmAuth, so that we can uninstall ACPI SDT protocol after ExitPmAuth.
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# ACPI Table Protocol Driver
|
# ACPI Table Protocol Driver
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
|
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials are
|
# This program and the accompanying materials are
|
||||||
# licensed and made available under the terms and conditions of the BSD License
|
# licensed and made available under the terms and conditions of the BSD License
|
||||||
# which accompanies this distribution. The full text of the license may be found at
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -67,6 +68,7 @@
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision ## CONSUMES
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId ## CONSUMES
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision ## CONSUMES
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions ## CONSUMES
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiAcpiTableProtocolGuid ## PRODUCES
|
gEfiAcpiTableProtocolGuid ## PRODUCES
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
ACPI Table Protocol Implementation
|
ACPI Table Protocol Implementation
|
||||||
|
|
||||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
|
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -21,6 +22,12 @@
|
||||||
//
|
//
|
||||||
UINTN mEfiAcpiMaxNumTables = EFI_ACPI_MAX_NUM_TABLES;
|
UINTN mEfiAcpiMaxNumTables = EFI_ACPI_MAX_NUM_TABLES;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Allocation strategy to use for AllocatePages ().
|
||||||
|
// Runtime value depends on PcdExposedAcpiTableVersions.
|
||||||
|
//
|
||||||
|
STATIC EFI_ALLOCATE_TYPE mAcpiTableAllocType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function adds an ACPI table to the table list. It will detect FACS and
|
This function adds an ACPI table to the table list. It will detect FACS and
|
||||||
allocate the correct type of memory and properly align the table.
|
allocate the correct type of memory and properly align the table.
|
||||||
|
@ -133,10 +140,11 @@ PublishTables (
|
||||||
if ((Version & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
if ((Version & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
CurrentRsdtEntry = (UINT32 *) ((UINT8 *) AcpiTableInstance->Rsdt1 + sizeof (EFI_ACPI_DESCRIPTION_HEADER));
|
CurrentRsdtEntry = (UINT32 *) ((UINT8 *) AcpiTableInstance->Rsdt1 + sizeof (EFI_ACPI_DESCRIPTION_HEADER));
|
||||||
*CurrentRsdtEntry = (UINT32) (UINTN) AcpiTableInstance->Fadt1;
|
*CurrentRsdtEntry = (UINT32) (UINTN) AcpiTableInstance->Fadt1;
|
||||||
}
|
|
||||||
if ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0) {
|
|
||||||
CurrentRsdtEntry = (UINT32 *) ((UINT8 *) AcpiTableInstance->Rsdt3 + sizeof (EFI_ACPI_DESCRIPTION_HEADER));
|
CurrentRsdtEntry = (UINT32 *) ((UINT8 *) AcpiTableInstance->Rsdt3 + sizeof (EFI_ACPI_DESCRIPTION_HEADER));
|
||||||
*CurrentRsdtEntry = (UINT32) (UINTN) AcpiTableInstance->Fadt3;
|
*CurrentRsdtEntry = (UINT32) (UINTN) AcpiTableInstance->Fadt3;
|
||||||
|
}
|
||||||
|
if ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0) {
|
||||||
CurrentXsdtEntry = (VOID *) ((UINT8 *) AcpiTableInstance->Xsdt + sizeof (EFI_ACPI_DESCRIPTION_HEADER));
|
CurrentXsdtEntry = (VOID *) ((UINT8 *) AcpiTableInstance->Xsdt + sizeof (EFI_ACPI_DESCRIPTION_HEADER));
|
||||||
//
|
//
|
||||||
// Add entry to XSDT, XSDT expects 64 bit pointers, but
|
// Add entry to XSDT, XSDT expects 64 bit pointers, but
|
||||||
|
@ -209,6 +217,7 @@ InstallAcpiTable (
|
||||||
EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance;
|
EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
VOID *AcpiTableBufferConst;
|
VOID *AcpiTableBufferConst;
|
||||||
|
EFI_ACPI_TABLE_VERSION Version;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check for invalid input parameters
|
// Check for invalid input parameters
|
||||||
|
@ -218,6 +227,8 @@ InstallAcpiTable (
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Version = PcdGet32 (PcdAcpiExposedTableVersions);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the instance of the ACPI table protocol
|
// Get the instance of the ACPI table protocol
|
||||||
//
|
//
|
||||||
|
@ -232,13 +243,13 @@ InstallAcpiTable (
|
||||||
AcpiTableInstance,
|
AcpiTableInstance,
|
||||||
AcpiTableBufferConst,
|
AcpiTableBufferConst,
|
||||||
TRUE,
|
TRUE,
|
||||||
EFI_ACPI_TABLE_VERSION_1_0B | ACPI_TABLE_VERSION_GTE_2_0,
|
Version,
|
||||||
TableKey
|
TableKey
|
||||||
);
|
);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
Status = PublishTables (
|
Status = PublishTables (
|
||||||
AcpiTableInstance,
|
AcpiTableInstance,
|
||||||
EFI_ACPI_TABLE_VERSION_1_0B | ACPI_TABLE_VERSION_GTE_2_0
|
Version
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
FreePool (AcpiTableBufferConst);
|
FreePool (AcpiTableBufferConst);
|
||||||
|
@ -250,7 +261,7 @@ InstallAcpiTable (
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
SdtNotifyAcpiList (
|
SdtNotifyAcpiList (
|
||||||
AcpiTableInstance,
|
AcpiTableInstance,
|
||||||
EFI_ACPI_TABLE_VERSION_1_0B | ACPI_TABLE_VERSION_GTE_2_0,
|
Version,
|
||||||
*TableKey
|
*TableKey
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -337,12 +348,15 @@ ReallocateAcpiTableBuffer (
|
||||||
//
|
//
|
||||||
// Create RSDT, XSDT structures and allocate buffers.
|
// Create RSDT, XSDT structures and allocate buffers.
|
||||||
//
|
//
|
||||||
TotalSize = sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 1.0 RSDT
|
TotalSize = sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 2.0/3.0 XSDT
|
||||||
|
NewMaxTableNumber * sizeof (UINT64);
|
||||||
|
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
|
TotalSize += sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 1.0 RSDT
|
||||||
NewMaxTableNumber * sizeof (UINT32) +
|
NewMaxTableNumber * sizeof (UINT32) +
|
||||||
sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 2.0/3.0 RSDT
|
sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 2.0/3.0 RSDT
|
||||||
NewMaxTableNumber * sizeof (UINT32) +
|
NewMaxTableNumber * sizeof (UINT32);
|
||||||
sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 2.0/3.0 XSDT
|
}
|
||||||
NewMaxTableNumber * sizeof (UINT64);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Allocate memory in the lower 32 bit of address range for
|
// Allocate memory in the lower 32 bit of address range for
|
||||||
|
@ -355,7 +369,7 @@ ReallocateAcpiTableBuffer (
|
||||||
//
|
//
|
||||||
PageAddress = 0xFFFFFFFF;
|
PageAddress = 0xFFFFFFFF;
|
||||||
Status = gBS->AllocatePages (
|
Status = gBS->AllocatePages (
|
||||||
AllocateMaxAddress,
|
mAcpiTableAllocType,
|
||||||
EfiACPIReclaimMemory,
|
EfiACPIReclaimMemory,
|
||||||
EFI_SIZE_TO_PAGES (TotalSize),
|
EFI_SIZE_TO_PAGES (TotalSize),
|
||||||
&PageAddress
|
&PageAddress
|
||||||
|
@ -369,35 +383,45 @@ ReallocateAcpiTableBuffer (
|
||||||
ZeroMem (Pointer, TotalSize);
|
ZeroMem (Pointer, TotalSize);
|
||||||
|
|
||||||
AcpiTableInstance->Rsdt1 = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;
|
AcpiTableInstance->Rsdt1 = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
Pointer += (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + NewMaxTableNumber * sizeof (UINT32));
|
Pointer += (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + NewMaxTableNumber * sizeof (UINT32));
|
||||||
AcpiTableInstance->Rsdt3 = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;
|
AcpiTableInstance->Rsdt3 = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;
|
||||||
Pointer += (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + NewMaxTableNumber * sizeof (UINT32));
|
Pointer += (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + NewMaxTableNumber * sizeof (UINT32));
|
||||||
|
}
|
||||||
AcpiTableInstance->Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;
|
AcpiTableInstance->Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update RSDP to point to the new Rsdt and Xsdt address.
|
// Update RSDP to point to the new Rsdt and Xsdt address.
|
||||||
//
|
//
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
AcpiTableInstance->Rsdp1->RsdtAddress = (UINT32) (UINTN) AcpiTableInstance->Rsdt1;
|
AcpiTableInstance->Rsdp1->RsdtAddress = (UINT32) (UINTN) AcpiTableInstance->Rsdt1;
|
||||||
AcpiTableInstance->Rsdp3->RsdtAddress = (UINT32) (UINTN) AcpiTableInstance->Rsdt3;
|
AcpiTableInstance->Rsdp3->RsdtAddress = (UINT32) (UINTN) AcpiTableInstance->Rsdt3;
|
||||||
|
}
|
||||||
CurrentData = (UINT64) (UINTN) AcpiTableInstance->Xsdt;
|
CurrentData = (UINT64) (UINTN) AcpiTableInstance->Xsdt;
|
||||||
CopyMem (&AcpiTableInstance->Rsdp3->XsdtAddress, &CurrentData, sizeof (UINT64));
|
CopyMem (&AcpiTableInstance->Rsdp3->XsdtAddress, &CurrentData, sizeof (UINT64));
|
||||||
|
|
||||||
//
|
//
|
||||||
// copy the original Rsdt1, Rsdt3 and Xsdt structure to new buffer
|
// copy the original Rsdt1, Rsdt3 and Xsdt structure to new buffer
|
||||||
//
|
//
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
CopyMem (AcpiTableInstance->Rsdt1, TempPrivateData.Rsdt1, (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + mEfiAcpiMaxNumTables * sizeof (UINT32)));
|
CopyMem (AcpiTableInstance->Rsdt1, TempPrivateData.Rsdt1, (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + mEfiAcpiMaxNumTables * sizeof (UINT32)));
|
||||||
CopyMem (AcpiTableInstance->Rsdt3, TempPrivateData.Rsdt3, (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + mEfiAcpiMaxNumTables * sizeof (UINT32)));
|
CopyMem (AcpiTableInstance->Rsdt3, TempPrivateData.Rsdt3, (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + mEfiAcpiMaxNumTables * sizeof (UINT32)));
|
||||||
|
}
|
||||||
CopyMem (AcpiTableInstance->Xsdt, TempPrivateData.Xsdt, (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + mEfiAcpiMaxNumTables * sizeof (UINT64)));
|
CopyMem (AcpiTableInstance->Xsdt, TempPrivateData.Xsdt, (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + mEfiAcpiMaxNumTables * sizeof (UINT64)));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Calculate orignal ACPI table buffer size
|
// Calculate orignal ACPI table buffer size
|
||||||
//
|
//
|
||||||
TotalSize = sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 1.0 RSDT
|
TotalSize = sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 2.0/3.0 XSDT
|
||||||
|
mEfiAcpiMaxNumTables * sizeof (UINT64);
|
||||||
|
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
|
TotalSize += sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 1.0 RSDT
|
||||||
mEfiAcpiMaxNumTables * sizeof (UINT32) +
|
mEfiAcpiMaxNumTables * sizeof (UINT32) +
|
||||||
sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 2.0/3.0 RSDT
|
sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 2.0/3.0 RSDT
|
||||||
mEfiAcpiMaxNumTables * sizeof (UINT32) +
|
mEfiAcpiMaxNumTables * sizeof (UINT32);
|
||||||
sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 2.0/3.0 XSDT
|
}
|
||||||
mEfiAcpiMaxNumTables * sizeof (UINT64);
|
|
||||||
gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)TempPrivateData.Rsdt1, EFI_SIZE_TO_PAGES (TotalSize));
|
gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)TempPrivateData.Rsdt1, EFI_SIZE_TO_PAGES (TotalSize));
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -504,7 +528,7 @@ AddTableToList (
|
||||||
// All other tables are ACPI reclaim memory, no alignment requirements.
|
// All other tables are ACPI reclaim memory, no alignment requirements.
|
||||||
//
|
//
|
||||||
Status = gBS->AllocatePages (
|
Status = gBS->AllocatePages (
|
||||||
AllocateMaxAddress,
|
mAcpiTableAllocType,
|
||||||
EfiACPIReclaimMemory,
|
EfiACPIReclaimMemory,
|
||||||
CurrentTableList->NumberOfPages,
|
CurrentTableList->NumberOfPages,
|
||||||
&CurrentTableList->PageAddress
|
&CurrentTableList->PageAddress
|
||||||
|
@ -621,13 +645,18 @@ AddTableToList (
|
||||||
);
|
);
|
||||||
AcpiTableInstance->Fadt3->FirmwareCtrl = 0;
|
AcpiTableInstance->Fadt3->FirmwareCtrl = 0;
|
||||||
}
|
}
|
||||||
|
if ((UINT64)(UINTN)AcpiTableInstance->Dsdt3 < BASE_4GB) {
|
||||||
AcpiTableInstance->Fadt3->Dsdt = (UINT32) (UINTN) AcpiTableInstance->Dsdt3;
|
AcpiTableInstance->Fadt3->Dsdt = (UINT32) (UINTN) AcpiTableInstance->Dsdt3;
|
||||||
|
ZeroMem (&AcpiTableInstance->Fadt3->XDsdt, sizeof (UINT64));
|
||||||
|
} else {
|
||||||
Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Dsdt3;
|
Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Dsdt3;
|
||||||
CopyMem (
|
CopyMem (
|
||||||
&AcpiTableInstance->Fadt3->XDsdt,
|
&AcpiTableInstance->Fadt3->XDsdt,
|
||||||
&Buffer64,
|
&Buffer64,
|
||||||
sizeof (UINT64)
|
sizeof (UINT64)
|
||||||
);
|
);
|
||||||
|
AcpiTableInstance->Fadt3->Dsdt = 0;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// RSDP OEM information is updated to match the FADT OEM information
|
// RSDP OEM information is updated to match the FADT OEM information
|
||||||
|
@ -638,6 +667,7 @@ AddTableToList (
|
||||||
6
|
6
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
//
|
//
|
||||||
// RSDT OEM information is updated to match FADT OEM information.
|
// RSDT OEM information is updated to match FADT OEM information.
|
||||||
//
|
//
|
||||||
|
@ -652,6 +682,7 @@ AddTableToList (
|
||||||
sizeof (UINT64)
|
sizeof (UINT64)
|
||||||
);
|
);
|
||||||
AcpiTableInstance->Rsdt3->OemRevision = AcpiTableInstance->Fadt3->Header.OemRevision;
|
AcpiTableInstance->Rsdt3->OemRevision = AcpiTableInstance->Fadt3->Header.OemRevision;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// XSDT OEM information is updated to match FADT OEM information.
|
// XSDT OEM information is updated to match FADT OEM information.
|
||||||
|
@ -818,7 +849,9 @@ AddTableToList (
|
||||||
// If FADT already exists, update table pointers.
|
// If FADT already exists, update table pointers.
|
||||||
//
|
//
|
||||||
if (AcpiTableInstance->Fadt3 != NULL) {
|
if (AcpiTableInstance->Fadt3 != NULL) {
|
||||||
|
if ((UINT64)(UINTN)AcpiTableInstance->Dsdt3 < BASE_4GB) {
|
||||||
AcpiTableInstance->Fadt3->Dsdt = (UINT32) (UINTN) AcpiTableInstance->Dsdt3;
|
AcpiTableInstance->Fadt3->Dsdt = (UINT32) (UINTN) AcpiTableInstance->Dsdt3;
|
||||||
|
}
|
||||||
Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Dsdt3;
|
Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Dsdt3;
|
||||||
CopyMem (
|
CopyMem (
|
||||||
&AcpiTableInstance->Fadt3->XDsdt,
|
&AcpiTableInstance->Fadt3->XDsdt,
|
||||||
|
@ -917,6 +950,8 @@ AddTableToList (
|
||||||
Status = ReallocateAcpiTableBuffer (AcpiTableInstance);
|
Status = ReallocateAcpiTableBuffer (AcpiTableInstance);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
//
|
//
|
||||||
// At this time, it is assumed that RSDT and XSDT maintain parallel lists of tables.
|
// At this time, it is assumed that RSDT and XSDT maintain parallel lists of tables.
|
||||||
// If it becomes necessary to maintain separate table lists, changes will be required.
|
// If it becomes necessary to maintain separate table lists, changes will be required.
|
||||||
|
@ -928,6 +963,7 @@ AddTableToList (
|
||||||
AcpiTableInstance->NumberOfTableEntries3 *
|
AcpiTableInstance->NumberOfTableEntries3 *
|
||||||
sizeof (UINT32)
|
sizeof (UINT32)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// This pointer must not be directly dereferenced as the XSDT entries may not
|
// This pointer must not be directly dereferenced as the XSDT entries may not
|
||||||
|
@ -941,6 +977,7 @@ AddTableToList (
|
||||||
sizeof (UINT64)
|
sizeof (UINT64)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
//
|
//
|
||||||
// Add entry to the RSDT
|
// Add entry to the RSDT
|
||||||
//
|
//
|
||||||
|
@ -950,6 +987,7 @@ AddTableToList (
|
||||||
// Update RSDT length
|
// Update RSDT length
|
||||||
//
|
//
|
||||||
AcpiTableInstance->Rsdt3->Length = AcpiTableInstance->Rsdt3->Length + sizeof (UINT32);
|
AcpiTableInstance->Rsdt3->Length = AcpiTableInstance->Rsdt3->Length + sizeof (UINT32);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add entry to XSDT, XSDT expects 64 bit pointers, but
|
// Add entry to XSDT, XSDT expects 64 bit pointers, but
|
||||||
|
@ -1046,7 +1084,7 @@ EFI_STATUS
|
||||||
RemoveTableFromRsdt (
|
RemoveTableFromRsdt (
|
||||||
IN OUT EFI_ACPI_TABLE_LIST * Table,
|
IN OUT EFI_ACPI_TABLE_LIST * Table,
|
||||||
IN OUT UINTN *NumberOfTableEntries,
|
IN OUT UINTN *NumberOfTableEntries,
|
||||||
IN OUT EFI_ACPI_DESCRIPTION_HEADER * Rsdt,
|
IN OUT EFI_ACPI_DESCRIPTION_HEADER * Rsdt OPTIONAL,
|
||||||
IN OUT EFI_ACPI_DESCRIPTION_HEADER * Xsdt OPTIONAL
|
IN OUT EFI_ACPI_DESCRIPTION_HEADER * Xsdt OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -1060,7 +1098,7 @@ RemoveTableFromRsdt (
|
||||||
//
|
//
|
||||||
ASSERT (Table);
|
ASSERT (Table);
|
||||||
ASSERT (NumberOfTableEntries);
|
ASSERT (NumberOfTableEntries);
|
||||||
ASSERT (Rsdt);
|
ASSERT (Rsdt || Xsdt);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Find the table entry in the RSDT and XSDT
|
// Find the table entry in the RSDT and XSDT
|
||||||
|
@ -1070,7 +1108,11 @@ RemoveTableFromRsdt (
|
||||||
// At this time, it is assumed that RSDT and XSDT maintain parallel lists of tables.
|
// At this time, it is assumed that RSDT and XSDT maintain parallel lists of tables.
|
||||||
// If it becomes necessary to maintain separate table lists, changes will be required.
|
// If it becomes necessary to maintain separate table lists, changes will be required.
|
||||||
//
|
//
|
||||||
|
if (Rsdt != NULL) {
|
||||||
CurrentRsdtEntry = (UINT32 *) ((UINT8 *) Rsdt + sizeof (EFI_ACPI_DESCRIPTION_HEADER) + Index * sizeof (UINT32));
|
CurrentRsdtEntry = (UINT32 *) ((UINT8 *) Rsdt + sizeof (EFI_ACPI_DESCRIPTION_HEADER) + Index * sizeof (UINT32));
|
||||||
|
} else {
|
||||||
|
CurrentRsdtEntry = NULL;
|
||||||
|
}
|
||||||
if (Xsdt != NULL) {
|
if (Xsdt != NULL) {
|
||||||
//
|
//
|
||||||
// This pointer must not be directly dereferenced as the XSDT entries may not
|
// This pointer must not be directly dereferenced as the XSDT entries may not
|
||||||
|
@ -1092,7 +1134,7 @@ RemoveTableFromRsdt (
|
||||||
//
|
//
|
||||||
// Check if we have found the corresponding entry in both RSDT and XSDT
|
// Check if we have found the corresponding entry in both RSDT and XSDT
|
||||||
//
|
//
|
||||||
if (*CurrentRsdtEntry == (UINT32) (UINTN) Table->Table &&
|
if ((CurrentRsdtEntry == NULL || *CurrentRsdtEntry == (UINT32) (UINTN) Table->Table) &&
|
||||||
((Xsdt == NULL) || CurrentTablePointer64 == (UINT64) (UINTN) Table->Table)
|
((Xsdt == NULL) || CurrentTablePointer64 == (UINT64) (UINTN) Table->Table)
|
||||||
) {
|
) {
|
||||||
//
|
//
|
||||||
|
@ -1100,8 +1142,10 @@ RemoveTableFromRsdt (
|
||||||
// We actually copy all + 1 to copy the initialized value of memory over
|
// We actually copy all + 1 to copy the initialized value of memory over
|
||||||
// the last entry.
|
// the last entry.
|
||||||
//
|
//
|
||||||
|
if (Rsdt != NULL) {
|
||||||
CopyMem (CurrentRsdtEntry, CurrentRsdtEntry + 1, (*NumberOfTableEntries - Index) * sizeof (UINT32));
|
CopyMem (CurrentRsdtEntry, CurrentRsdtEntry + 1, (*NumberOfTableEntries - Index) * sizeof (UINT32));
|
||||||
Rsdt->Length = Rsdt->Length - sizeof (UINT32);
|
Rsdt->Length = Rsdt->Length - sizeof (UINT32);
|
||||||
|
}
|
||||||
if (Xsdt != NULL) {
|
if (Xsdt != NULL) {
|
||||||
CopyMem (CurrentXsdtEntry, ((UINT64 *) CurrentXsdtEntry) + 1, (*NumberOfTableEntries - Index) * sizeof (UINT64));
|
CopyMem (CurrentXsdtEntry, ((UINT64 *) CurrentXsdtEntry) + 1, (*NumberOfTableEntries - Index) * sizeof (UINT64));
|
||||||
Xsdt->Length = Xsdt->Length - sizeof (UINT64);
|
Xsdt->Length = Xsdt->Length - sizeof (UINT64);
|
||||||
|
@ -1117,12 +1161,14 @@ RemoveTableFromRsdt (
|
||||||
//
|
//
|
||||||
// Checksum the tables
|
// Checksum the tables
|
||||||
//
|
//
|
||||||
|
if (Rsdt != NULL) {
|
||||||
AcpiPlatformChecksum (
|
AcpiPlatformChecksum (
|
||||||
Rsdt,
|
Rsdt,
|
||||||
Rsdt->Length,
|
Rsdt->Length,
|
||||||
OFFSET_OF (EFI_ACPI_DESCRIPTION_HEADER,
|
OFFSET_OF (EFI_ACPI_DESCRIPTION_HEADER,
|
||||||
Checksum)
|
Checksum)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (Xsdt != NULL) {
|
if (Xsdt != NULL) {
|
||||||
AcpiPlatformChecksum (
|
AcpiPlatformChecksum (
|
||||||
|
@ -1508,12 +1554,14 @@ ChecksumCommonTables (
|
||||||
//
|
//
|
||||||
// RSDP ACPI 1.0 checksum for 1.0 table. This is only the first 20 bytes of the structure
|
// RSDP ACPI 1.0 checksum for 1.0 table. This is only the first 20 bytes of the structure
|
||||||
//
|
//
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
AcpiPlatformChecksum (
|
AcpiPlatformChecksum (
|
||||||
AcpiTableInstance->Rsdp1,
|
AcpiTableInstance->Rsdp1,
|
||||||
sizeof (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER),
|
sizeof (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER),
|
||||||
OFFSET_OF (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER,
|
OFFSET_OF (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER,
|
||||||
Checksum)
|
Checksum)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// RSDP ACPI 1.0 checksum for 2.0/3.0 table. This is only the first 20 bytes of the structure
|
// RSDP ACPI 1.0 checksum for 2.0/3.0 table. This is only the first 20 bytes of the structure
|
||||||
|
@ -1535,6 +1583,7 @@ ChecksumCommonTables (
|
||||||
ExtendedChecksum)
|
ExtendedChecksum)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
//
|
//
|
||||||
// RSDT checksums
|
// RSDT checksums
|
||||||
//
|
//
|
||||||
|
@ -1551,6 +1600,7 @@ ChecksumCommonTables (
|
||||||
OFFSET_OF (EFI_ACPI_DESCRIPTION_HEADER,
|
OFFSET_OF (EFI_ACPI_DESCRIPTION_HEADER,
|
||||||
Checksum)
|
Checksum)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// XSDT checksum
|
// XSDT checksum
|
||||||
|
@ -1593,6 +1643,16 @@ AcpiTableAcpiTableConstructor (
|
||||||
//
|
//
|
||||||
ASSERT (AcpiTableInstance);
|
ASSERT (AcpiTableInstance);
|
||||||
|
|
||||||
|
//
|
||||||
|
// If ACPI v1.0b is among the ACPI versions we aim to support, we have to
|
||||||
|
// ensure that all memory allocations are below 4 GB.
|
||||||
|
//
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
|
mAcpiTableAllocType = AllocateMaxAddress;
|
||||||
|
} else {
|
||||||
|
mAcpiTableAllocType = AllocateAnyPages;
|
||||||
|
}
|
||||||
|
|
||||||
InitializeListHead (&AcpiTableInstance->TableList);
|
InitializeListHead (&AcpiTableInstance->TableList);
|
||||||
AcpiTableInstance->CurrentHandle = 1;
|
AcpiTableInstance->CurrentHandle = 1;
|
||||||
|
|
||||||
|
@ -1606,12 +1666,14 @@ AcpiTableAcpiTableConstructor (
|
||||||
//
|
//
|
||||||
// Create RSDP table
|
// Create RSDP table
|
||||||
//
|
//
|
||||||
RsdpTableSize = sizeof (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER) +
|
RsdpTableSize = sizeof (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER);
|
||||||
sizeof (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER);
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
|
RsdpTableSize += sizeof (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER);
|
||||||
|
}
|
||||||
|
|
||||||
PageAddress = 0xFFFFFFFF;
|
PageAddress = 0xFFFFFFFF;
|
||||||
Status = gBS->AllocatePages (
|
Status = gBS->AllocatePages (
|
||||||
AllocateMaxAddress,
|
mAcpiTableAllocType,
|
||||||
EfiACPIReclaimMemory,
|
EfiACPIReclaimMemory,
|
||||||
EFI_SIZE_TO_PAGES (RsdpTableSize),
|
EFI_SIZE_TO_PAGES (RsdpTableSize),
|
||||||
&PageAddress
|
&PageAddress
|
||||||
|
@ -1625,18 +1687,23 @@ AcpiTableAcpiTableConstructor (
|
||||||
ZeroMem (Pointer, RsdpTableSize);
|
ZeroMem (Pointer, RsdpTableSize);
|
||||||
|
|
||||||
AcpiTableInstance->Rsdp1 = (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) Pointer;
|
AcpiTableInstance->Rsdp1 = (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) Pointer;
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
Pointer += sizeof (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER);
|
Pointer += sizeof (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER);
|
||||||
|
}
|
||||||
AcpiTableInstance->Rsdp3 = (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) Pointer;
|
AcpiTableInstance->Rsdp3 = (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) Pointer;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create RSDT, XSDT structures
|
// Create RSDT, XSDT structures
|
||||||
//
|
//
|
||||||
TotalSize = sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 1.0 RSDT
|
TotalSize = sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 2.0/3.0 XSDT
|
||||||
|
mEfiAcpiMaxNumTables * sizeof (UINT64);
|
||||||
|
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
|
TotalSize += sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 1.0 RSDT
|
||||||
mEfiAcpiMaxNumTables * sizeof (UINT32) +
|
mEfiAcpiMaxNumTables * sizeof (UINT32) +
|
||||||
sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 2.0/3.0 RSDT
|
sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 2.0/3.0 RSDT
|
||||||
mEfiAcpiMaxNumTables * sizeof (UINT32) +
|
mEfiAcpiMaxNumTables * sizeof (UINT32);
|
||||||
sizeof (EFI_ACPI_DESCRIPTION_HEADER) + // for ACPI 2.0/3.0 XSDT
|
}
|
||||||
mEfiAcpiMaxNumTables * sizeof (UINT64);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Allocate memory in the lower 32 bit of address range for
|
// Allocate memory in the lower 32 bit of address range for
|
||||||
|
@ -1649,7 +1716,7 @@ AcpiTableAcpiTableConstructor (
|
||||||
//
|
//
|
||||||
PageAddress = 0xFFFFFFFF;
|
PageAddress = 0xFFFFFFFF;
|
||||||
Status = gBS->AllocatePages (
|
Status = gBS->AllocatePages (
|
||||||
AllocateMaxAddress,
|
mAcpiTableAllocType,
|
||||||
EfiACPIReclaimMemory,
|
EfiACPIReclaimMemory,
|
||||||
EFI_SIZE_TO_PAGES (TotalSize),
|
EFI_SIZE_TO_PAGES (TotalSize),
|
||||||
&PageAddress
|
&PageAddress
|
||||||
|
@ -1664,30 +1731,37 @@ AcpiTableAcpiTableConstructor (
|
||||||
ZeroMem (Pointer, TotalSize);
|
ZeroMem (Pointer, TotalSize);
|
||||||
|
|
||||||
AcpiTableInstance->Rsdt1 = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;
|
AcpiTableInstance->Rsdt1 = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
Pointer += (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + EFI_ACPI_MAX_NUM_TABLES * sizeof (UINT32));
|
Pointer += (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + EFI_ACPI_MAX_NUM_TABLES * sizeof (UINT32));
|
||||||
AcpiTableInstance->Rsdt3 = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;
|
AcpiTableInstance->Rsdt3 = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;
|
||||||
Pointer += (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + EFI_ACPI_MAX_NUM_TABLES * sizeof (UINT32));
|
Pointer += (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + EFI_ACPI_MAX_NUM_TABLES * sizeof (UINT32));
|
||||||
|
}
|
||||||
AcpiTableInstance->Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;
|
AcpiTableInstance->Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize RSDP
|
// Initialize RSDP
|
||||||
//
|
//
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
CurrentData = EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE;
|
CurrentData = EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE;
|
||||||
CopyMem (&AcpiTableInstance->Rsdp1->Signature, &CurrentData, sizeof (UINT64));
|
CopyMem (&AcpiTableInstance->Rsdp1->Signature, &CurrentData, sizeof (UINT64));
|
||||||
CopyMem (AcpiTableInstance->Rsdp1->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Rsdp1->OemId));
|
CopyMem (AcpiTableInstance->Rsdp1->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Rsdp1->OemId));
|
||||||
AcpiTableInstance->Rsdp1->Reserved = EFI_ACPI_RESERVED_BYTE;
|
AcpiTableInstance->Rsdp1->Reserved = EFI_ACPI_RESERVED_BYTE;
|
||||||
AcpiTableInstance->Rsdp1->RsdtAddress = (UINT32) (UINTN) AcpiTableInstance->Rsdt1;
|
AcpiTableInstance->Rsdp1->RsdtAddress = (UINT32) (UINTN) AcpiTableInstance->Rsdt1;
|
||||||
|
}
|
||||||
|
|
||||||
CurrentData = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE;
|
CurrentData = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE;
|
||||||
CopyMem (&AcpiTableInstance->Rsdp3->Signature, &CurrentData, sizeof (UINT64));
|
CopyMem (&AcpiTableInstance->Rsdp3->Signature, &CurrentData, sizeof (UINT64));
|
||||||
CopyMem (AcpiTableInstance->Rsdp3->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Rsdp3->OemId));
|
CopyMem (AcpiTableInstance->Rsdp3->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Rsdp3->OemId));
|
||||||
AcpiTableInstance->Rsdp3->Revision = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION;
|
AcpiTableInstance->Rsdp3->Revision = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION;
|
||||||
AcpiTableInstance->Rsdp3->RsdtAddress = (UINT32) (UINTN) AcpiTableInstance->Rsdt3;
|
|
||||||
AcpiTableInstance->Rsdp3->Length = sizeof (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER);
|
AcpiTableInstance->Rsdp3->Length = sizeof (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER);
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
|
AcpiTableInstance->Rsdp3->RsdtAddress = (UINT32) (UINTN) AcpiTableInstance->Rsdt3;
|
||||||
|
}
|
||||||
CurrentData = (UINT64) (UINTN) AcpiTableInstance->Xsdt;
|
CurrentData = (UINT64) (UINTN) AcpiTableInstance->Xsdt;
|
||||||
CopyMem (&AcpiTableInstance->Rsdp3->XsdtAddress, &CurrentData, sizeof (UINT64));
|
CopyMem (&AcpiTableInstance->Rsdp3->XsdtAddress, &CurrentData, sizeof (UINT64));
|
||||||
SetMem (AcpiTableInstance->Rsdp3->Reserved, 3, EFI_ACPI_RESERVED_BYTE);
|
SetMem (AcpiTableInstance->Rsdp3->Reserved, 3, EFI_ACPI_RESERVED_BYTE);
|
||||||
|
|
||||||
|
if ((PcdGet32 (PcdAcpiExposedTableVersions) & EFI_ACPI_TABLE_VERSION_1_0B) != 0) {
|
||||||
//
|
//
|
||||||
// Initialize Rsdt
|
// Initialize Rsdt
|
||||||
//
|
//
|
||||||
|
@ -1722,8 +1796,9 @@ AcpiTableAcpiTableConstructor (
|
||||||
//
|
//
|
||||||
// We always reserve first one for FADT
|
// We always reserve first one for FADT
|
||||||
//
|
//
|
||||||
AcpiTableInstance->NumberOfTableEntries3 = 1;
|
|
||||||
AcpiTableInstance->Rsdt3->Length = AcpiTableInstance->Rsdt3->Length + sizeof(UINT32);
|
AcpiTableInstance->Rsdt3->Length = AcpiTableInstance->Rsdt3->Length + sizeof(UINT32);
|
||||||
|
}
|
||||||
|
AcpiTableInstance->NumberOfTableEntries3 = 1;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize Xsdt
|
// Initialize Xsdt
|
||||||
|
|
Loading…
Reference in New Issue