]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportAcpiSupportProtocol.c
MdeModulePkg/IntelFrameworkModulePkg ACPI: Follow the new UEFI 2.4a spec to return...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / Acpi / AcpiSupportDxe / AcpiSupportAcpiSupportProtocol.c
index 3bcff22dcff6e45d8b355064aa7882511befc362..6443c3acd0e9de7feec8c324f11faa7b38f8bed4 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ACPI Support Protocol implementation\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -375,6 +375,9 @@ PublishTables (
                                  and the size field embedded in the ACPI table pointed to by AcpiTableBuffer\r
                                  are not in sync.\r
   @return EFI_OUT_OF_RESOURCES   Insufficient resources exist to complete the request.\r
+  @retval EFI_ACCESS_DENIED      The table signature matches a table already\r
+                                 present in the system and platform policy\r
+                                 does not allow duplicate tables of this type.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -410,13 +413,13 @@ InstallAcpiTable (
   //\r
   AcpiTableBufferConst = AllocateCopyPool (AcpiTableBufferSize, AcpiTableBuffer);\r
   *TableKey = 0;\r
-  Status = AcpiSupport->SetAcpiTable (\r
-                          AcpiSupport,\r
-                          AcpiTableBufferConst,\r
-                          TRUE,\r
-                          EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0,\r
-                          TableKey\r
-                          );\r
+  Status = AddTableToList (\r
+             AcpiSupportInstance,\r
+             AcpiTableBufferConst,\r
+             TRUE,\r
+             EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0,\r
+             TableKey\r
+             );\r
   if (!EFI_ERROR (Status)) {\r
     Status = AcpiSupport->PublishTables (\r
                             AcpiSupport,\r
@@ -457,13 +460,11 @@ UninstallAcpiTable (
   //\r
   // Uninstall the ACPI table by using ACPI support protocol\r
   //\r
-  Status = AcpiSupport->SetAcpiTable (\r
-                          AcpiSupport,\r
-                          NULL,\r
-                          FALSE,\r
-                          EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0,\r
-                          &TableKey\r
-                          );\r
+  Status = RemoveTableFromList (\r
+             AcpiSupportInstance,\r
+             EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0,\r
+             TableKey\r
+             );\r
   if (!EFI_ERROR (Status)) {\r
     Status = AcpiSupport->PublishTables (\r
                             AcpiSupport,\r
@@ -588,8 +589,9 @@ ReallocateAcpiTableBuffer (
 \r
   @return EFI_SUCCESS               The function completed successfully.\r
   @return EFI_OUT_OF_RESOURCES      Could not allocate a required resource.\r
-  @return EFI_ABORTED               The table is a duplicate of a table that is required\r
-                                    to be unique.\r
+  @retval EFI_ACCESS_DENIED         The table signature matches a table already\r
+                                    present in the system and platform policy\r
+                                    does not allow duplicate tables of this type.\r
 **/\r
 EFI_STATUS\r
 AddTableToList (\r
@@ -724,7 +726,7 @@ AddTableToList (
         ) {\r
       gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages);\r
       gBS->FreePool (CurrentTableList);\r
-      return EFI_ABORTED;\r
+      return EFI_ACCESS_DENIED;\r
     }\r
     //\r
     // Add the table to the appropriate table version\r
@@ -865,7 +867,7 @@ AddTableToList (
         ) {\r
       gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages);\r
       gBS->FreePool (CurrentTableList);\r
-      return EFI_ABORTED;\r
+      return EFI_ACCESS_DENIED;\r
     }\r
     //\r
     // FACS is referenced by FADT and is not part of RSDT\r
@@ -949,7 +951,7 @@ AddTableToList (
         ) {\r
       gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages);\r
       gBS->FreePool (CurrentTableList);\r
-      return EFI_ABORTED;\r
+      return EFI_ACCESS_DENIED;\r
     }\r
     //\r
     // DSDT is referenced by FADT and is not part of RSDT\r