MdeModulePkg/IntelFrameworkModulePkg ACPI: Follow the new UEFI 2.4a spec to return EFI_ACCESS_DENIED for duplicated FADT, FACS or DSDT installation.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15496 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
ACPI Support Protocol implementation
|
||||
|
||||
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions
|
||||
@@ -375,6 +375,9 @@ PublishTables (
|
||||
and the size field embedded in the ACPI table pointed to by AcpiTableBuffer
|
||||
are not in sync.
|
||||
@return EFI_OUT_OF_RESOURCES Insufficient resources exist to complete the request.
|
||||
@retval EFI_ACCESS_DENIED The table signature matches a table already
|
||||
present in the system and platform policy
|
||||
does not allow duplicate tables of this type.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -410,13 +413,13 @@ InstallAcpiTable (
|
||||
//
|
||||
AcpiTableBufferConst = AllocateCopyPool (AcpiTableBufferSize, AcpiTableBuffer);
|
||||
*TableKey = 0;
|
||||
Status = AcpiSupport->SetAcpiTable (
|
||||
AcpiSupport,
|
||||
AcpiTableBufferConst,
|
||||
TRUE,
|
||||
EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0,
|
||||
TableKey
|
||||
);
|
||||
Status = AddTableToList (
|
||||
AcpiSupportInstance,
|
||||
AcpiTableBufferConst,
|
||||
TRUE,
|
||||
EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0,
|
||||
TableKey
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = AcpiSupport->PublishTables (
|
||||
AcpiSupport,
|
||||
@@ -457,13 +460,11 @@ UninstallAcpiTable (
|
||||
//
|
||||
// Uninstall the ACPI table by using ACPI support protocol
|
||||
//
|
||||
Status = AcpiSupport->SetAcpiTable (
|
||||
AcpiSupport,
|
||||
NULL,
|
||||
FALSE,
|
||||
EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0,
|
||||
&TableKey
|
||||
);
|
||||
Status = RemoveTableFromList (
|
||||
AcpiSupportInstance,
|
||||
EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0,
|
||||
TableKey
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = AcpiSupport->PublishTables (
|
||||
AcpiSupport,
|
||||
@@ -588,8 +589,9 @@ ReallocateAcpiTableBuffer (
|
||||
|
||||
@return EFI_SUCCESS The function completed successfully.
|
||||
@return EFI_OUT_OF_RESOURCES Could not allocate a required resource.
|
||||
@return EFI_ABORTED The table is a duplicate of a table that is required
|
||||
to be unique.
|
||||
@retval EFI_ACCESS_DENIED The table signature matches a table already
|
||||
present in the system and platform policy
|
||||
does not allow duplicate tables of this type.
|
||||
**/
|
||||
EFI_STATUS
|
||||
AddTableToList (
|
||||
@@ -724,7 +726,7 @@ AddTableToList (
|
||||
) {
|
||||
gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages);
|
||||
gBS->FreePool (CurrentTableList);
|
||||
return EFI_ABORTED;
|
||||
return EFI_ACCESS_DENIED;
|
||||
}
|
||||
//
|
||||
// Add the table to the appropriate table version
|
||||
@@ -865,7 +867,7 @@ AddTableToList (
|
||||
) {
|
||||
gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages);
|
||||
gBS->FreePool (CurrentTableList);
|
||||
return EFI_ABORTED;
|
||||
return EFI_ACCESS_DENIED;
|
||||
}
|
||||
//
|
||||
// FACS is referenced by FADT and is not part of RSDT
|
||||
@@ -949,7 +951,7 @@ AddTableToList (
|
||||
) {
|
||||
gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages);
|
||||
gBS->FreePool (CurrentTableList);
|
||||
return EFI_ABORTED;
|
||||
return EFI_ACCESS_DENIED;
|
||||
}
|
||||
//
|
||||
// DSDT is referenced by FADT and is not part of RSDT
|
||||
|
Reference in New Issue
Block a user