]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
ShellPkg/UefiShellAcpiViewCommandLib: Fix ECC issues
[mirror_edk2.git] / ShellPkg / Library / UefiShellAcpiViewCommandLib / Parsers / Iort / IortParser.c
index 503a745718d23082c7bc4b0bc920355a839fc895..704dfc407cca00d217e3e7e69fadd6dcbd2c094a 100644 (file)
@@ -1,4 +1,4 @@
-/**\r
+/** @file\r
   IORT table parser\r
 \r
   Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.\r
@@ -23,8 +23,9 @@
 // Local variables\r
 STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;\r
 \r
-/** The EIORT_NODE enum describes the IORT Node types.\r
-*/\r
+/**\r
+  The EIORT_NODE enum describes the IORT Node types.\r
+**/\r
 typedef enum IortNode {\r
   EIORT_NODE_ITS_GROUP,        ///< ITS Group node\r
   EIORT_NODE_NAMED_COMPONENT,  ///< Named Component node\r
@@ -51,12 +52,13 @@ STATIC CONST UINT32* PmuInterruptOffset;
 \r
 STATIC CONST UINT32* ItsCount;\r
 \r
-/** This function validates the ID Mapping array count for the ITS node.\r
+/**\r
+  This function validates the ID Mapping array count for the ITS node.\r
 \r
   @param [in] Ptr     Pointer to the start of the field data.\r
   @param [in] Context Pointer to context specific information e.g. this\r
                       could be a pointer to the ACPI table header.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 EFIAPI\r
@@ -65,12 +67,13 @@ ValidateItsIdMappingCount (
   IN VOID*  Context\r
   );\r
 \r
-/** This function validates the ID Mapping array offset for the ITS node.\r
+/**\r
+  This function validates the ID Mapping array offset for the ITS node.\r
 \r
   @param [in] Ptr     Pointer to the start of the field data.\r
   @param [in] Context Pointer to context specific information e.g. this\r
                       could be a pointer to the ACPI table header.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 EFIAPI\r
@@ -79,14 +82,14 @@ ValidateItsIdArrayReference (
   IN VOID*  Context\r
   );\r
 \r
-/** Helper Macro for populating the IORT Node header in the ACPI_PARSER\r
-    array.\r
+/**\r
+  Helper Macro for populating the IORT Node header in the ACPI_PARSER array.\r
 \r
   @param [out] ValidateIdMappingCount    Optional pointer to a function for\r
                                          validating the ID Mapping count.\r
   @param [out] ValidateIdArrayReference  Optional pointer to a function for\r
                                          validating the ID Array reference.\r
-*/\r
+**/\r
 #define PARSE_IORT_NODE_HEADER(ValidateIdMappingCount,                   \\r
                                ValidateIdArrayReference)                 \\r
   { L"Type", 1, 0, L"%d", NULL, (VOID**)&IortNodeType, NULL, NULL },     \\r
@@ -98,8 +101,9 @@ ValidateItsIdArrayReference (
   { L"Reference to ID Array", 4, 12, L"0x%x", NULL,                      \\r
     (VOID**)&IortIdMappingOffset, ValidateIdArrayReference, NULL }\r
 \r
-/** An ACPI_PARSER array describing the ACPI IORT Table\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the ACPI IORT Table\r
+**/\r
 STATIC CONST ACPI_PARSER IortParser[] = {\r
   PARSE_ACPI_HEADER (&AcpiHdrInfo),\r
   {L"Number of IORT Nodes", 4, 36, L"%d", NULL,\r
@@ -109,14 +113,16 @@ STATIC CONST ACPI_PARSER IortParser[] = {
   {L"Reserved", 4, 44, L"0x%x", NULL, NULL, NULL, NULL}\r
 };\r
 \r
-/** An ACPI_PARSER array describing the IORT node header structure.\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the IORT node header structure.\r
+**/\r
 STATIC CONST ACPI_PARSER IortNodeHeaderParser[] = {\r
   PARSE_IORT_NODE_HEADER (NULL, NULL)\r
 };\r
 \r
-/** An ACPI_PARSER array describing the IORT SMMUv1/2 node.\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the IORT SMMUv1/2 node.\r
+**/\r
 STATIC CONST ACPI_PARSER IortNodeSmmuV1V2Parser[] = {\r
   PARSE_IORT_NODE_HEADER (NULL, NULL),\r
   {L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},\r
@@ -141,15 +147,17 @@ STATIC CONST ACPI_PARSER IortNodeSmmuV1V2Parser[] = {
   {L"SMMU_NSgCfgIrpt interrupt flags", 4, 72, L"0x%x", NULL, NULL, NULL, NULL}\r
 };\r
 \r
-/** An ACPI_PARSER array describing the SMMUv1/2 Node Interrupt Array.\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the SMMUv1/2 Node Interrupt Array.\r
+**/\r
 STATIC CONST ACPI_PARSER InterruptArrayParser[] = {\r
   {L"  Interrupt GSIV", 4, 0, L"0x%x", NULL, NULL, NULL, NULL},\r
   {L"  Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL}\r
 };\r
 \r
-/** An ACPI_PARSER array describing the IORT ID Mapping.\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the IORT ID Mapping.\r
+**/\r
 STATIC CONST ACPI_PARSER IortNodeIdMappingParser[] = {\r
   {L"  Input base", 4, 0, L"0x%x", NULL, NULL, NULL, NULL},\r
   {L"  Number of IDs", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},\r
@@ -158,8 +166,9 @@ STATIC CONST ACPI_PARSER IortNodeIdMappingParser[] = {
   {L"  Flags", 4, 16, L"0x%x", NULL, NULL, NULL, NULL}\r
 };\r
 \r
-/** An ACPI_PARSER array describing the IORT SMMUv3 node.\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the IORT SMMUv3 node.\r
+**/\r
 STATIC CONST ACPI_PARSER IortNodeSmmuV3Parser[] = {\r
   PARSE_IORT_NODE_HEADER (NULL, NULL),\r
   {L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},\r
@@ -173,8 +182,9 @@ STATIC CONST ACPI_PARSER IortNodeSmmuV3Parser[] = {
   {L"Sync", 4, 56, L"0x%x", NULL, NULL, NULL, NULL}\r
 };\r
 \r
-/** An ACPI_PARSER array describing the IORT ITS node.\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the IORT ITS node.\r
+**/\r
 STATIC CONST ACPI_PARSER IortNodeItsParser[] = {\r
   PARSE_IORT_NODE_HEADER (\r
     ValidateItsIdMappingCount,\r
@@ -183,14 +193,16 @@ STATIC CONST ACPI_PARSER IortNodeItsParser[] = {
   {L"  Number of ITSs", 4, 16, L"%d", NULL, (VOID**)&ItsCount, NULL}\r
 };\r
 \r
-/** An ACPI_PARSER array describing the ITS ID.\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the ITS ID.\r
+**/\r
 STATIC CONST ACPI_PARSER ItsIdParser[] = {\r
   { L"  GIC ITS Identifier", 4, 0, L"%d", NULL, NULL, NULL }\r
 };\r
 \r
-/** An ACPI_PARSER array describing the IORT Names Component node.\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the IORT Names Component node.\r
+**/\r
 STATIC CONST ACPI_PARSER IortNodeNamedComponentParser[] = {\r
   PARSE_IORT_NODE_HEADER (NULL, NULL),\r
   {L"Node Flags", 4, 16, L"%d", NULL, NULL, NULL, NULL},\r
@@ -198,8 +210,9 @@ STATIC CONST ACPI_PARSER IortNodeNamedComponentParser[] = {
   {L"Device memory address size limit", 1, 28, L"%d", NULL, NULL, NULL, NULL}\r
 };\r
 \r
-/** An ACPI_PARSER array describing the IORT Root Complex node.\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the IORT Root Complex node.\r
+**/\r
 STATIC CONST ACPI_PARSER IortNodeRootComplexParser[] = {\r
   PARSE_IORT_NODE_HEADER (NULL, NULL),\r
   {L"Memory access properties", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},\r
@@ -207,8 +220,9 @@ STATIC CONST ACPI_PARSER IortNodeRootComplexParser[] = {
   {L"PCI Segment number", 4, 28, L"0x%x", NULL, NULL, NULL, NULL}\r
 };\r
 \r
-/** An ACPI_PARSER array describing the IORT PMCG node.\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the IORT PMCG node.\r
+**/\r
 STATIC CONST ACPI_PARSER IortNodePmcgParser[] = {\r
   PARSE_IORT_NODE_HEADER (NULL, NULL),\r
   {L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},\r
@@ -216,18 +230,19 @@ STATIC CONST ACPI_PARSER IortNodePmcgParser[] = {
   {L"Node reference", 4, 28, L"0x%x", NULL, NULL, NULL, NULL},\r
 };\r
 \r
-/** This function validates the ID Mapping array count for the ITS node.\r
+/**\r
+  This function validates the ID Mapping array count for the ITS node.\r
 \r
   @param [in] Ptr     Pointer to the start of the field data.\r
   @param [in] Context Pointer to context specific information e.g. this\r
                       could be a pointer to the ACPI table header.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 EFIAPI\r
 ValidateItsIdMappingCount (\r
   IN UINT8* Ptr,\r
-  VOID*     Context\r
+  IN VOID*     Context\r
   )\r
 {\r
   if (*(UINT32*)Ptr != 0) {\r
@@ -236,12 +251,13 @@ ValidateItsIdMappingCount (
   }\r
 }\r
 \r
-/** This function validates the ID Mapping array offset for the ITS node.\r
+/**\r
+  This function validates the ID Mapping array offset for the ITS node.\r
 \r
   @param [in] Ptr     Pointer to the start of the field data.\r
   @param [in] Context Pointer to context specific information e.g. this\r
                       could be a pointer to the ACPI table header.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 EFIAPI\r
@@ -256,13 +272,14 @@ ValidateItsIdArrayReference (
   }\r
 }\r
 \r
-/** This function parses the IORT Node Id Mapping array.\r
+/**\r
+  This function parses the IORT Node Id Mapping array.\r
 \r
   @param [in] Ptr            Pointer to the start of the IORT Table.\r
   @param [in] MappingCount   The ID Mapping count.\r
   @param [in] MappingOffset  The offset of the ID Mapping array\r
                              from the start of the IORT table.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 DumpIortNodeIdMappings (\r
@@ -298,14 +315,15 @@ DumpIortNodeIdMappings (
   }\r
 }\r
 \r
-/** This function parses the IORT SMMUv1/2 node.\r
+/**\r
+  This function parses the IORT SMMUv1/2 node.\r
 \r
   @param [in] Ptr            Pointer to the start of the buffer.\r
   @param [in] Length         Length of the buffer.\r
   @param [in] MappingCount   The ID Mapping count.\r
   @param [in] MappingOffset  The offset of the ID Mapping array\r
                              from the start of the IORT table.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 DumpIortNodeSmmuV1V2 (\r
@@ -377,14 +395,15 @@ DumpIortNodeSmmuV1V2 (
   }\r
 }\r
 \r
-/** This function parses the IORT SMMUv3 node.\r
+/**\r
+  This function parses the IORT SMMUv3 node.\r
 \r
   @param [in] Ptr            Pointer to the start of the buffer.\r
   @param [in] Length         Length of the buffer.\r
   @param [in] MappingCount   The ID Mapping count.\r
   @param [in] MappingOffset  The offset of the ID Mapping array\r
                              from the start of the IORT table.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 DumpIortNodeSmmuV3 (\r
@@ -408,11 +427,12 @@ DumpIortNodeSmmuV3 (
   }\r
 }\r
 \r
-/** This function parses the IORT ITS node.\r
+/**\r
+  This function parses the IORT ITS node.\r
 \r
   @param [in] Ptr            Pointer to the start of the buffer.\r
   @param [in] Length         Length of the buffer.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 DumpIortNodeIts (\r
@@ -458,14 +478,15 @@ DumpIortNodeIts (
   // Note: ITS does not have the ID Mappings Array\r
 }\r
 \r
-/** This function parses the IORT Named Component node.\r
+/**\r
+  This function parses the IORT Named Component node.\r
 \r
   @param [in] Ptr            Pointer to the start of the buffer.\r
   @param [in] Length         Length of the buffer.\r
   @param [in] MappingCount   The ID Mapping count.\r
   @param [in] MappingOffset  The offset of the ID Mapping array\r
                              from the start of the IORT table.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 DumpIortNodeNamedComponent (\r
@@ -504,14 +525,15 @@ DumpIortNodeNamedComponent (
   }\r
 }\r
 \r
-/** This function parses the IORT Root Complex node.\r
+/**\r
+  This function parses the IORT Root Complex node.\r
 \r
   @param [in] Ptr            Pointer to the start of the buffer.\r
   @param [in] Length         Length of the buffer.\r
   @param [in] MappingCount   The ID Mapping count.\r
   @param [in] MappingOffset  The offset of the ID Mapping array\r
                              from the start of the IORT table.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 DumpIortNodeRootComplex (\r
@@ -535,14 +557,15 @@ DumpIortNodeRootComplex (
   }\r
 }\r
 \r
-/** This function parses the IORT PMCG node.\r
+/**\r
+  This function parses the IORT PMCG node.\r
 \r
   @param [in] Ptr            Pointer to the start of the buffer.\r
   @param [in] Length         Length of the buffer.\r
   @param [in] MappingCount   The ID Mapping count.\r
   @param [in] MappingOffset  The offset of the ID Mapping array\r
                              from the start of the IORT table.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 DumpIortNodePmcg (\r
@@ -574,9 +597,9 @@ DumpIortNodePmcg (
   }\r
 }\r
 \r
-/** This function parses the ACPI IORT table.\r
-  When trace is enabled this function parses the IORT table and\r
-  traces the ACPI fields.\r
+/**\r
+  This function parses the ACPI IORT table.\r
+  When trace is enabled this function parses the IORT table and traces the ACPI fields.\r
 \r
   This function also parses the following nodes:\r
     - ITS Group\r
@@ -592,7 +615,7 @@ DumpIortNodePmcg (
   @param [in] Ptr                Pointer to the start of the buffer.\r
   @param [in] AcpiTableLength    Length of the ACPI table.\r
   @param [in] AcpiTableRevision  Revision of the ACPI table.\r
-*/\r
+**/\r
 VOID\r
 EFIAPI\r
 ParseAcpiIort (\r