]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: acpiview: MADT: Remove redundant forward declarations
authorKrzysztof Koch <krzysztof.koch@arm.com>
Fri, 19 Jul 2019 01:04:59 +0000 (18:04 -0700)
committerJaben Carsey <jaben.carsey@intel.com>
Fri, 19 Jul 2019 15:32:56 +0000 (08:32 -0700)
Remove redundant forward function declarations by repositioning
blocks of code. This way the code structure is consistent across
ACPI table parsers and the code becomes more concise.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c

index 59c3df0cc8a080497b517baf36fc63f1e4ab866f..338295d30e35c366a60505225cf57145a8e73d93 100644 (file)
@@ -35,7 +35,15 @@ EFIAPI
 ValidateGICDSystemVectorBase (\r
   IN UINT8* Ptr,\r
   IN VOID*  Context\r
-  );\r
+)\r
+{\r
+  if (*(UINT32*)Ptr != 0) {\r
+    IncrementErrorCount ();\r
+    Print (\r
+      L"\nERROR: System Vector Base must be zero."\r
+    );\r
+  }\r
+}\r
 \r
 /**\r
   This function validates the SPE Overflow Interrupt in the GICC.\r
@@ -50,7 +58,41 @@ EFIAPI
 ValidateSpeOverflowInterrupt (\r
   IN UINT8* Ptr,\r
   IN VOID*  Context\r
-  );\r
+  )\r
+{\r
+  UINT16 SpeOverflowInterrupt;\r
+\r
+  SpeOverflowInterrupt = *(UINT16*)Ptr;\r
+\r
+  // SPE not supported by this processor\r
+  if (SpeOverflowInterrupt == 0) {\r
+    return;\r
+  }\r
+\r
+  if ((SpeOverflowInterrupt < ARM_PPI_ID_MIN) ||\r
+      ((SpeOverflowInterrupt > ARM_PPI_ID_MAX) &&\r
+       (SpeOverflowInterrupt < ARM_PPI_ID_EXTENDED_MIN)) ||\r
+      (SpeOverflowInterrupt > ARM_PPI_ID_EXTENDED_MAX)) {\r
+    IncrementErrorCount ();\r
+    Print (\r
+      L"\nERROR: SPE Overflow Interrupt ID of %d is not in the allowed PPI ID "\r
+        L"ranges of %d-%d or %d-%d (for GICv3.1 or later).",\r
+      SpeOverflowInterrupt,\r
+      ARM_PPI_ID_MIN,\r
+      ARM_PPI_ID_MAX,\r
+      ARM_PPI_ID_EXTENDED_MIN,\r
+      ARM_PPI_ID_EXTENDED_MAX\r
+    );\r
+  } else if (SpeOverflowInterrupt != ARM_PPI_ID_PMBIRQ) {\r
+    IncrementWarningCount();\r
+    Print (\r
+      L"\nWARNING: SPE Overflow Interrupt ID of %d is not compliant with SBSA "\r
+        L"Level 3 PPI ID assignment: %d.",\r
+      SpeOverflowInterrupt,\r
+      ARM_PPI_ID_PMBIRQ\r
+    );\r
+  }\r
+}\r
 \r
 /**\r
   An ACPI_PARSER array describing the GICC Interrupt Controller Structure.\r
@@ -158,78 +200,6 @@ STATIC CONST ACPI_PARSER MadtInterruptControllerHeaderParser[] = {
   {L"Reserved", 2, 2, NULL, NULL, NULL, NULL, NULL}\r
 };\r
 \r
-/**\r
-  This function validates the System Vector Base in the GICD.\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
-STATIC\r
-VOID\r
-EFIAPI\r
-ValidateGICDSystemVectorBase (\r
-  IN UINT8* Ptr,\r
-  IN VOID*  Context\r
-)\r
-{\r
-  if (*(UINT32*)Ptr != 0) {\r
-    IncrementErrorCount ();\r
-    Print (\r
-      L"\nERROR: System Vector Base must be zero."\r
-    );\r
-  }\r
-}\r
-\r
-/**\r
-  This function validates the SPE Overflow Interrupt in the GICC.\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
-STATIC\r
-VOID\r
-EFIAPI\r
-ValidateSpeOverflowInterrupt (\r
-  IN UINT8* Ptr,\r
-  IN VOID*  Context\r
-  )\r
-{\r
-  UINT16 SpeOverflowInterrupt;\r
-\r
-  SpeOverflowInterrupt = *(UINT16*)Ptr;\r
-\r
-  // SPE not supported by this processor\r
-  if (SpeOverflowInterrupt == 0) {\r
-    return;\r
-  }\r
-\r
-  if ((SpeOverflowInterrupt < ARM_PPI_ID_MIN) ||\r
-      ((SpeOverflowInterrupt > ARM_PPI_ID_MAX) &&\r
-       (SpeOverflowInterrupt < ARM_PPI_ID_EXTENDED_MIN)) ||\r
-      (SpeOverflowInterrupt > ARM_PPI_ID_EXTENDED_MAX)) {\r
-    IncrementErrorCount ();\r
-    Print (\r
-      L"\nERROR: SPE Overflow Interrupt ID of %d is not in the allowed PPI ID "\r
-        L"ranges of %d-%d or %d-%d (for GICv3.1 or later).",\r
-      SpeOverflowInterrupt,\r
-      ARM_PPI_ID_MIN,\r
-      ARM_PPI_ID_MAX,\r
-      ARM_PPI_ID_EXTENDED_MIN,\r
-      ARM_PPI_ID_EXTENDED_MAX\r
-    );\r
-  } else if (SpeOverflowInterrupt != ARM_PPI_ID_PMBIRQ) {\r
-    IncrementWarningCount();\r
-    Print (\r
-      L"\nWARNING: SPE Overflow Interrupt ID of %d is not compliant with SBSA "\r
-        L"Level 3 PPI ID assignment: %d.",\r
-      SpeOverflowInterrupt,\r
-      ARM_PPI_ID_PMBIRQ\r
-    );\r
-  }\r
-}\r
-\r
 /**\r
   This function parses the ACPI MADT table.\r
   When trace is enabled this function parses the MADT table and\r