]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Update Acpiview PPTT parser to ACPI 6.4
authorChris Jones <christopher.jones@arm.com>
Wed, 8 Dec 2021 16:06:26 +0000 (16:06 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 10 Dec 2021 20:06:52 +0000 (20:06 +0000)
Bugzilla: 3697 (https://bugzilla.tianocore.org/show_bug.cgi?id=3697)

Update the Acpiview PPTT parser to use Acpi64.h. As part of the changes,
remove support for parsing PPTT type 2 ID structure.

Mantis ID for removing PPTT type 2 structure:
2072 (https://mantis.uefi.org/mantis/view.php?id=2072)

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c

index f47b92f8c55ba5a479571a0bea378c75dfde13ed..7be249819e70dee9547c3fecc0763f473aa9ce92 100644 (file)
@@ -1,11 +1,11 @@
 /** @file\r
   PPTT table parser\r
 \r
-  Copyright (c) 2019 - 2020, ARM Limited. All rights reserved.\r
+  Copyright (c) 2019 - 2021, ARM Limited. All rights reserved.\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
   @par Reference(s):\r
-    - ACPI 6.3 Specification - January 2019\r
+    - ACPI 6.4 Specification - January 2021\r
     - ARM Architecture Reference Manual ARMv8 (D.a)\r
 **/\r
 \r
@@ -161,8 +161,8 @@ ValidateCacheAttributes (
   )\r
 {\r
   // Reference: Advanced Configuration and Power Interface (ACPI) Specification\r
-  //            Version 6.2 Errata A, September 2017\r
-  // Table 5-153: Cache Type Structure\r
+  //            Version 6.4, January 2021\r
+  // Table 5-140: Cache Type Structure\r
   UINT8  Attributes;\r
 \r
   Attributes = *(UINT8 *)Ptr;\r
@@ -227,22 +227,6 @@ STATIC CONST ACPI_PARSER  CacheTypeStructureParser[] = {
   { L"Line size",           2, 22, L"%d",   NULL, NULL, ValidateCacheLineSize,      NULL }\r
 };\r
 \r
-/**\r
-  An ACPI_PARSER array describing the ID Type Structure - Type 2.\r
-**/\r
-STATIC CONST ACPI_PARSER  IdStructureParser[] = {\r
-  { L"Type",       1, 0,  L"0x%x", NULL,       NULL, NULL, NULL },\r
-  { L"Length",     1, 1,  L"%d",   NULL,       NULL, NULL, NULL },\r
-  { L"Reserved",   2, 2,  L"0x%x", NULL,       NULL, NULL, NULL },\r
-\r
-  { L"VENDOR_ID",  4, 4,  NULL,    Dump4Chars, NULL, NULL, NULL },\r
-  { L"LEVEL_1_ID", 8, 8,  L"0x%x", NULL,       NULL, NULL, NULL },\r
-  { L"LEVEL_2_ID", 8, 16, L"0x%x", NULL,       NULL, NULL, NULL },\r
-  { L"MAJOR_REV",  2, 24, L"0x%x", NULL,       NULL, NULL, NULL },\r
-  { L"MINOR_REV",  2, 26, L"0x%x", NULL,       NULL, NULL, NULL },\r
-  { L"SPIN_REV",   2, 28, L"0x%x", NULL,       NULL, NULL, NULL },\r
-};\r
-\r
 /**\r
   This function parses the Processor Hierarchy Node Structure (Type 0).\r
 \r
@@ -340,29 +324,6 @@ DumpCacheTypeStructure (
     );\r
 }\r
 \r
-/**\r
-  This function parses the ID Structure (Type 2).\r
-\r
-  @param [in] Ptr     Pointer to the start of the ID Structure data.\r
-  @param [in] Length  Length of the ID Structure.\r
-**/\r
-STATIC\r
-VOID\r
-DumpIDStructure (\r
-  IN UINT8  *Ptr,\r
-  IN UINT8  Length\r
-  )\r
-{\r
-  ParseAcpi (\r
-    TRUE,\r
-    2,\r
-    "ID Structure",\r
-    Ptr,\r
-    Length,\r
-    PARSER_PARAMS (IdStructureParser)\r
-    );\r
-}\r
-\r
 /**\r
   This function parses the ACPI PPTT table.\r
   When trace is enabled this function parses the PPTT table and\r
@@ -371,7 +332,6 @@ DumpIDStructure (
   This function parses the following processor topology structures:\r
     - Processor hierarchy node structure (Type 0)\r
     - Cache Type Structure (Type 1)\r
-    - ID structure (Type 2)\r
 \r
   This function also performs validation of the ACPI table fields.\r
 \r
@@ -451,22 +411,23 @@ ParseAcpiPptt (
     Print (L"0x%x\n", Offset);\r
 \r
     switch (*ProcessorTopologyStructureType) {\r
-      case EFI_ACPI_6_2_PPTT_TYPE_PROCESSOR:\r
+      case EFI_ACPI_6_4_PPTT_TYPE_PROCESSOR:\r
         DumpProcessorHierarchyNodeStructure (\r
           ProcessorTopologyStructurePtr,\r
           *ProcessorTopologyStructureLength\r
           );\r
         break;\r
-      case EFI_ACPI_6_2_PPTT_TYPE_CACHE:\r
+      case EFI_ACPI_6_4_PPTT_TYPE_CACHE:\r
         DumpCacheTypeStructure (\r
           ProcessorTopologyStructurePtr,\r
           *ProcessorTopologyStructureLength\r
           );\r
         break;\r
-      case EFI_ACPI_6_2_PPTT_TYPE_ID:\r
-        DumpIDStructure (\r
-          ProcessorTopologyStructurePtr,\r
-          *ProcessorTopologyStructureLength\r
+      case EFI_ACPI_6_3_PPTT_TYPE_ID:\r
+        IncrementErrorCount ();\r
+        Print (\r
+          L"ERROR: PPTT Type 2 - Processor ID has been removed and must not be"\r
+          L"used.\n"\r
           );\r
         break;\r
       default:\r
index 0ad7bf4c845f3c065764680c01eaa27796b09226..09bdddb56e5bd70dec44bdbdcba88373f93daa66 100644 (file)
@@ -62,7 +62,7 @@ ACPI_TABLE_PARSER  ParserList[] = {
     ParseAcpiMcfg },\r
   { EFI_ACPI_6_4_PLATFORM_COMMUNICATIONS_CHANNEL_TABLE_SIGNATURE,\r
     ParseAcpiPcct },\r
-  { EFI_ACPI_6_2_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SIGNATURE,\r
+  { EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SIGNATURE,\r
     ParseAcpiPptt },\r
   { RSDP_TABLE_INFO,                                                                                     ParseAcpiRsdp },\r
   { EFI_ACPI_6_2_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE,                                            ParseAcpiSlit },\r