]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg AcpiTableDxe: Cover EFI_ACPI_TABLE_VERSION_5_0.
authorStar Zeng <star.zeng@intel.com>
Wed, 17 Jun 2015 02:51:47 +0000 (02:51 +0000)
committerlzeng14 <lzeng14@Edk2>
Wed, 17 Jun 2015 02:51:47 +0000 (02:51 +0000)
Follow PI 1.4 spec,
1. Cover EFI_ACPI_TABLE_VERSION_5_0.
2. Update TableKey parameter description in the
EFI_ACPI_SDT_PROTOCOL.GetAcpiTable() section.
3. Update EFI_ACPI_SDT_PROTOCOL.GetAcpiTable() description.

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@17649 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c
MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.h
MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h
MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c

index 93f26606d0ed35786170535906579689e7ee23e1..57fdc7844e93df74f8e4f943ec82f21d60886c9f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ACPI Sdt Protocol Driver\r
 \r
-  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. <BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -19,7 +19,7 @@
 \r
 GLOBAL_REMOVE_IF_UNREFERENCED\r
 EFI_ACPI_SDT_PROTOCOL  mAcpiSdtProtocolTemplate = {\r
-  EFI_ACPI_TABLE_VERSION_NONE | EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0 | EFI_ACPI_TABLE_VERSION_4_0,\r
+  EFI_ACPI_TABLE_VERSION_NONE | EFI_ACPI_TABLE_VERSION_1_0B | ACPI_TABLE_VERSION_GTE_2_0,\r
   GetAcpiTable2,\r
   RegisterNotify,\r
   Open,\r
@@ -204,16 +204,18 @@ SdtNotifyAcpiList (
   - Root System Description Table (RSDT)\r
   - Extended System Description Table (XSDT)\r
   Version is updated with a bit map containing all the versions of ACPI of which the table is a\r
-  member.\r
+  member. For tables installed via the EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() interface,\r
+  the function returns the value of EFI_ACPI_STD_PROTOCOL.AcpiVersion.\r
   \r
   @param[in]    Index       The zero-based index of the table to retrieve.\r
   @param[out]   Table       Pointer for returning the table buffer.\r
   @param[out]   Version     On return, updated with the ACPI versions to which this table belongs. Type\r
                             EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the\r
                             EFI_ACPI_SDT_PROTOCOL.    \r
-  @param[out]   TableKey    On return, points to the table key for the specified ACPI system definition table. This\r
-                            is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.  \r
-                            \r
+  @param[out]   TableKey    On return, points to the table key for the specified ACPI system definition table.\r
+                            This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.\r
+                            The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable()\r
+                            to uninstall the table.\r
   @retval EFI_SUCCESS       The function completed successfully.\r
   @retval EFI_NOT_FOUND     The requested index is too large and a table was not found.                                  \r
 **/  \r
index 2eca1e432fac1680d5dd92ab1a6079fe842e679d..f11bdee9ac9dbb2e5b5451ea7172ba790494b84f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ACPI Sdt Protocol Driver\r
 \r
-  Copyright (c) 2010, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. <BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -155,15 +155,18 @@ struct _AML_BYTE_ENCODING {
   - Root System Description Table (RSDT)\r
   - Extended System Description Table (XSDT)\r
   Version is updated with a bit map containing all the versions of ACPI of which the table is a\r
-  member.\r
+  member. For tables installed via the EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() interface,\r
+  the function returns the value of EFI_ACPI_STD_PROTOCOL.AcpiVersion.\r
   \r
   @param[in]    Index       The zero-based index of the table to retrieve.\r
   @param[out]   Table       Pointer for returning the table buffer.\r
   @param[out]   Version     On return, updated with the ACPI versions to which this table belongs. Type\r
                             EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the\r
                             EFI_ACPI_SDT_PROTOCOL.    \r
-  @param[out]   TableKey    On return, points to the table key for the specified ACPI system definition table. This\r
-                            is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.  \r
+  @param[out]   TableKey    On return, points to the table key for the specified ACPI system definition table.\r
+                            This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.\r
+                            The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable()\r
+                            to uninstall the table.\r
                             \r
   @retval EFI_SUCCESS       The function completed successfully.\r
   @retval EFI_NOT_FOUND     The requested index is too large and a table was not found.                                  \r
index 6541a8450168e6d30f6d5fd78d49055144824d5b..646032099588668856caa1f5dcd962398cdd72c6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ACPI Table Protocol Driver\r
 \r
-  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
 #include "AcpiSdt.h"\r
 \r
 //\r
-// From Protocol/AcpiSupport.h\r
+// Great than or equal to 2.0.\r
 //\r
-\r
-//\r
-// ACPI Version bitmap definition:\r
-//\r
-// EFI_ACPI_TABLE_VERSION_1_0B - ACPI Version 1.0b\r
-// EFI_ACPI_TABLE_VERSION_2_0 - ACPI Version 2.0\r
-// EFI_ACPI_TABLE_VERSION_3_0 - ACPI Version 3.0\r
-// EFI_ACPI_TABLE_VERSION_NONE - No ACPI Versions.  This might be used\r
-//  to create memory-based operation regions or other information\r
-//  that is not part of the ACPI "tree" but must still be found\r
-//  in ACPI memory space and/or managed by the core ACPI driver.\r
-//\r
-// Note that EFI provides discrete GUIDs for each version of ACPI\r
-// that is supported.  It is expected that each EFI GUIDed\r
-// version of ACPI will also have a corresponding bitmap\r
-// definition.  This allows maintenance of separate ACPI trees\r
-// for each distinctly different version of ACPI.\r
-//\r
-#define EFI_ACPI_TABLE_VERSION      UINT32\r
-\r
-#define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)\r
-#define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)\r
-#define EFI_ACPI_TABLE_VERSION_2_0  (1 << 2)\r
-#define EFI_ACPI_TABLE_VERSION_3_0  (1 << 3)\r
+#define ACPI_TABLE_VERSION_GTE_2_0 (EFI_ACPI_TABLE_VERSION_2_0  | \\r
+                                    EFI_ACPI_TABLE_VERSION_3_0  | \\r
+                                    EFI_ACPI_TABLE_VERSION_4_0  | \\r
+                                    EFI_ACPI_TABLE_VERSION_5_0)\r
 \r
 //\r
 // Private Driver Data\r
index 247c398c4fe0047abdce436e0ed0ad6e9d723ea0..d016f341cacde3eab471b6639e4aff72cbf39a1e 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ACPI Table Protocol Implementation\r
 \r
-  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -134,8 +134,7 @@ PublishTables (
     CurrentRsdtEntry  = (UINT32 *) ((UINT8 *) AcpiTableInstance->Rsdt1 + sizeof (EFI_ACPI_DESCRIPTION_HEADER));\r
     *CurrentRsdtEntry = (UINT32) (UINTN) AcpiTableInstance->Fadt1;\r
   }\r
-  if ((Version & EFI_ACPI_TABLE_VERSION_2_0) != 0 ||\r
-      (Version & EFI_ACPI_TABLE_VERSION_3_0) != 0) {\r
+  if ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0) {\r
     CurrentRsdtEntry  = (UINT32 *) ((UINT8 *) AcpiTableInstance->Rsdt3 + sizeof (EFI_ACPI_DESCRIPTION_HEADER));\r
     *CurrentRsdtEntry = (UINT32) (UINTN) AcpiTableInstance->Fadt3;\r
     CurrentXsdtEntry  = (VOID *) ((UINT8 *) AcpiTableInstance->Xsdt + sizeof (EFI_ACPI_DESCRIPTION_HEADER));\r
@@ -170,8 +169,7 @@ PublishTables (
     AcpiTableInstance->TablesInstalled1 = TRUE;\r
   }\r
 \r
-  if (((Version & EFI_ACPI_TABLE_VERSION_2_0) != 0 ||\r
-       (Version & EFI_ACPI_TABLE_VERSION_3_0) != 0) &&\r
+  if ((Version & ACPI_TABLE_VERSION_GTE_2_0) &&\r
       !AcpiTableInstance->TablesInstalled3) {\r
     Status = gBS->InstallConfigurationTable (&gEfiAcpiTableGuid, AcpiTableInstance->Rsdp3);\r
     if (EFI_ERROR (Status)) {\r
@@ -240,13 +238,13 @@ InstallAcpiTable (
              AcpiTableInstance,\r
              AcpiTableBufferConst,\r
              TRUE,\r
-             EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0,\r
+             EFI_ACPI_TABLE_VERSION_1_0B | ACPI_TABLE_VERSION_GTE_2_0,\r
              TableKey\r
              );\r
   if (!EFI_ERROR (Status)) {\r
     Status = PublishTables (\r
                AcpiTableInstance,\r
-               EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0\r
+               EFI_ACPI_TABLE_VERSION_1_0B | ACPI_TABLE_VERSION_GTE_2_0\r
                );\r
   }\r
   FreePool (AcpiTableBufferConst);\r
@@ -258,7 +256,7 @@ InstallAcpiTable (
     if (!EFI_ERROR (Status)) {\r
       SdtNotifyAcpiList (\r
         AcpiTableInstance,\r
-        EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0,\r
+        EFI_ACPI_TABLE_VERSION_1_0B | ACPI_TABLE_VERSION_GTE_2_0,\r
         *TableKey\r
         );\r
     }\r
@@ -298,13 +296,13 @@ UninstallAcpiTable (
   //\r
   Status = RemoveTableFromList (\r
              AcpiTableInstance,\r
-             EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0,\r
+             EFI_ACPI_TABLE_VERSION_1_0B | ACPI_TABLE_VERSION_GTE_2_0,\r
              TableKey\r
              );\r
   if (!EFI_ERROR (Status)) {\r
     Status = PublishTables (\r
                AcpiTableInstance,\r
-               EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0\r
+               EFI_ACPI_TABLE_VERSION_1_0B | ACPI_TABLE_VERSION_GTE_2_0\r
                );\r
   }\r
 \r
@@ -559,8 +557,7 @@ AddTableToList (
     // Check that the table has not been previously added.\r
     //\r
     if (((Version & EFI_ACPI_TABLE_VERSION_1_0B) != 0 && AcpiTableInstance->Fadt1 != NULL) ||\r
-        ((Version & EFI_ACPI_TABLE_VERSION_2_0)  != 0 && AcpiTableInstance->Fadt3 != NULL) ||\r
-        ((Version & EFI_ACPI_TABLE_VERSION_3_0)  != 0 && AcpiTableInstance->Fadt3 != NULL)\r
+        ((Version & ACPI_TABLE_VERSION_GTE_2_0)  != 0 && AcpiTableInstance->Fadt3 != NULL)\r
         ) {\r
       gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages);\r
       gBS->FreePool (CurrentTableList);\r
@@ -607,8 +604,7 @@ AddTableToList (
       AcpiTableInstance->Rsdt1->OemRevision = AcpiTableInstance->Fadt1->Header.OemRevision;\r
     }\r
 \r
-    if ((Version & EFI_ACPI_TABLE_VERSION_2_0) != 0 ||\r
-        (Version & EFI_ACPI_TABLE_VERSION_3_0) != 0) {\r
+    if ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0) {\r
       //\r
       // Save a pointer to the table\r
       //\r
@@ -696,8 +692,7 @@ AddTableToList (
     // Check that the table has not been previously added.\r
     //\r
     if (((Version & EFI_ACPI_TABLE_VERSION_1_0B) != 0 && AcpiTableInstance->Facs1 != NULL) ||\r
-        ((Version & EFI_ACPI_TABLE_VERSION_2_0)  != 0 && AcpiTableInstance->Facs3 != NULL) ||\r
-        ((Version & EFI_ACPI_TABLE_VERSION_3_0)  != 0 && AcpiTableInstance->Facs3 != NULL)\r
+        ((Version & ACPI_TABLE_VERSION_GTE_2_0)  != 0 && AcpiTableInstance->Facs3 != NULL)\r
         ) {\r
       gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages);\r
       gBS->FreePool (CurrentTableList);\r
@@ -735,8 +730,7 @@ AddTableToList (
       }\r
     }\r
 \r
-    if ((Version & EFI_ACPI_TABLE_VERSION_2_0) != 0 ||\r
-        (Version & EFI_ACPI_TABLE_VERSION_3_0) != 0) {\r
+    if ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0) {\r
       //\r
       // Save a pointer to the table\r
       //\r
@@ -782,8 +776,7 @@ AddTableToList (
     // Check that the table has not been previously added.\r
     //\r
     if (((Version & EFI_ACPI_TABLE_VERSION_1_0B) != 0 && AcpiTableInstance->Dsdt1 != NULL) ||\r
-        ((Version & EFI_ACPI_TABLE_VERSION_2_0)  != 0 && AcpiTableInstance->Dsdt3 != NULL) ||\r
-        ((Version & EFI_ACPI_TABLE_VERSION_3_0)  != 0 && AcpiTableInstance->Dsdt3 != NULL)\r
+        ((Version & ACPI_TABLE_VERSION_GTE_2_0)  != 0 && AcpiTableInstance->Dsdt3 != NULL)\r
         ) {\r
       gBS->FreePages (CurrentTableList->PageAddress, CurrentTableList->NumberOfPages);\r
       gBS->FreePool (CurrentTableList);\r
@@ -821,8 +814,7 @@ AddTableToList (
       }\r
     }\r
     \r
-    if ((Version & EFI_ACPI_TABLE_VERSION_2_0) != 0 ||\r
-        (Version & EFI_ACPI_TABLE_VERSION_3_0) != 0) {\r
+    if ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0) {\r
       //\r
       // Save a pointer to the table\r
       //\r
@@ -922,8 +914,7 @@ AddTableToList (
   //\r
   // Add to ACPI 2.0/3.0  table tree\r
   //\r
-  if ((Version & EFI_ACPI_TABLE_VERSION_2_0) != 0 ||\r
-      (Version & EFI_ACPI_TABLE_VERSION_3_0) != 0) {\r
+  if ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0) {\r
      if (AddToRsdt) {\r
        //\r
        // If the table number exceed the gEfiAcpiMaxNumTables, enlarge the table buffer\r
@@ -1255,17 +1246,11 @@ DeleteTable (
       }\r
     }\r
 \r
-    if ((Version & EFI_ACPI_TABLE_VERSION_2_0 & Table->Version) ||\r
-        (Version & EFI_ACPI_TABLE_VERSION_3_0 & Table->Version)) {\r
+    if (Version & ACPI_TABLE_VERSION_GTE_2_0 & Table->Version) {\r
       //\r
       // Remove this version from the table\r
       //\r
-      if (Version & EFI_ACPI_TABLE_VERSION_2_0 & Table->Version) {\r
-        Table->Version = Table->Version &~EFI_ACPI_TABLE_VERSION_2_0;\r
-      }      \r
-      if (Version & EFI_ACPI_TABLE_VERSION_3_0 & Table->Version) {\r
-        Table->Version = Table->Version &~EFI_ACPI_TABLE_VERSION_3_0;\r
-      }\r
+      Table->Version = Table->Version &~(Version & ACPI_TABLE_VERSION_GTE_2_0);\r
       \r
       //\r
       // Remove from Rsdt and Xsdt.  We don't care about the return value\r
@@ -1291,8 +1276,7 @@ DeleteTable (
         AcpiTableInstance->Fadt1 = NULL;\r
       }\r
 \r
-      if ((Version & EFI_ACPI_TABLE_VERSION_2_0) != 0 ||\r
-          (Version & EFI_ACPI_TABLE_VERSION_3_0) != 0) {\r
+      if ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0) {\r
         AcpiTableInstance->Fadt3 = NULL;\r
       }\r
       break;\r
@@ -1319,8 +1303,7 @@ DeleteTable (
         }\r
       }\r
 \r
-      if ((Version & EFI_ACPI_TABLE_VERSION_2_0) != 0 ||\r
-          (Version & EFI_ACPI_TABLE_VERSION_3_0) != 0) {\r
+      if ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0) {\r
         AcpiTableInstance->Facs3 = NULL;\r
 \r
         //\r
@@ -1366,8 +1349,7 @@ DeleteTable (
       }\r
 \r
       \r
-      if ((Version & EFI_ACPI_TABLE_VERSION_2_0) != 0 ||\r
-          (Version & EFI_ACPI_TABLE_VERSION_3_0) != 0) {\r
+      if ((Version & ACPI_TABLE_VERSION_GTE_2_0) != 0) {\r
         AcpiTableInstance->Dsdt3 = NULL;\r
 \r
         //\r