]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
ShellPkg: Apply uncrustify changes
[mirror_edk2.git] / ShellPkg / Library / UefiShellAcpiViewCommandLib / AcpiView.c
index 9a5b013fb234e2a09a12a690607b5b871dffde72..9cdfcb3fae2aa85d3ed3835ae90f5230f685e0fa 100644 (file)
 #include "AcpiView.h"\r
 #include "AcpiViewConfig.h"\r
 \r
-#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)\r
-#include "Arm/SbbrValidator.h"\r
+#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)\r
+  #include "Arm/SbbrValidator.h"\r
 #endif\r
 \r
-STATIC UINT32             mTableCount;\r
-STATIC UINT32             mBinTableCount;\r
+STATIC UINT32  mTableCount;\r
+STATIC UINT32  mBinTableCount;\r
 \r
 /**\r
   This function dumps the ACPI table to a file.\r
@@ -42,13 +42,13 @@ STATIC UINT32             mBinTableCount;
 STATIC\r
 BOOLEAN\r
 DumpAcpiTableToFile (\r
-  IN CONST UINT8*  Ptr,\r
-  IN CONST UINTN   Length\r
+  IN CONST UINT8  *Ptr,\r
+  IN CONST UINTN  Length\r
   )\r
 {\r
-  CHAR16              FileNameBuffer[MAX_FILE_NAME_LEN];\r
-  UINTN               TransferBytes;\r
-  SELECTED_ACPI_TABLE *SelectedTable;\r
+  CHAR16               FileNameBuffer[MAX_FILE_NAME_LEN];\r
+  UINTN                TransferBytes;\r
+  SELECTED_ACPI_TABLE  *SelectedTable;\r
 \r
   GetSelectedAcpiTable (&SelectedTable);\r
 \r
@@ -78,7 +78,7 @@ DumpAcpiTableToFile (
 BOOLEAN\r
 ProcessTableReportOptions (\r
   IN CONST UINT32  Signature,\r
-  IN CONST UINT8*  TablePtr,\r
+  IN CONST UINT8   *TablePtr,\r
   IN CONST UINT32  Length\r
   )\r
 {\r
@@ -92,9 +92,9 @@ ProcessTableReportOptions (
   // set local variables to suppress incorrect compiler/analyzer warnings\r
   //\r
   OriginalAttribute = 0;\r
-  SignaturePtr = (UINT8*)(UINTN)&Signature;\r
-  Log = FALSE;\r
-  HighLight = GetColourHighlighting ();\r
+  SignaturePtr      = (UINT8 *)(UINTN)&Signature;\r
+  Log               = FALSE;\r
+  HighLight         = GetColourHighlighting ();\r
   GetSelectedAcpiTable (&SelectedTable);\r
 \r
   switch (GetReportOption ()) {\r
@@ -103,9 +103,10 @@ ProcessTableReportOptions (
       break;\r
     case ReportSelected:\r
       if (Signature == SelectedTable->Type) {\r
-        Log = TRUE;\r
+        Log                  = TRUE;\r
         SelectedTable->Found = TRUE;\r
       }\r
+\r
       break;\r
     case ReportTableList:\r
       if (mTableCount == 0) {\r
@@ -113,15 +114,19 @@ ProcessTableReportOptions (
           OriginalAttribute = gST->ConOut->Mode->Attribute;\r
           gST->ConOut->SetAttribute (\r
                          gST->ConOut,\r
-                         EFI_TEXT_ATTR(EFI_CYAN,\r
-                           ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4))\r
+                         EFI_TEXT_ATTR (\r
+                           EFI_CYAN,\r
+                           ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)\r
+                           )\r
                          );\r
         }\r
+\r
         Print (L"\nInstalled Table(s):\n");\r
         if (HighLight) {\r
           gST->ConOut->SetAttribute (gST->ConOut, OriginalAttribute);\r
         }\r
       }\r
+\r
       Print (\r
         L"\t%4d. %c%c%c%c\n",\r
         ++mTableCount,\r
@@ -136,6 +141,7 @@ ProcessTableReportOptions (
         SelectedTable->Found = TRUE;\r
         DumpAcpiTableToFile (TablePtr, Length);\r
       }\r
+\r
       break;\r
     case ReportMax:\r
       // We should never be here.\r
@@ -148,10 +154,13 @@ ProcessTableReportOptions (
       OriginalAttribute = gST->ConOut->Mode->Attribute;\r
       gST->ConOut->SetAttribute (\r
                      gST->ConOut,\r
-                     EFI_TEXT_ATTR(EFI_LIGHTBLUE,\r
-                       ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4))\r
+                     EFI_TEXT_ATTR (\r
+                       EFI_LIGHTBLUE,\r
+                       ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)\r
+                       )\r
                      );\r
     }\r
+\r
     Print (\r
       L"\n\n --------------- %c%c%c%c Table --------------- \n\n",\r
       SignaturePtr[0],\r
@@ -167,8 +176,6 @@ ProcessTableReportOptions (
   return Log;\r
 }\r
 \r
-\r
-\r
 /**\r
   This function iterates the configuration table entries in the\r
   system table, retrieves the RSDP pointer and starts parsing the ACPI tables.\r
@@ -182,17 +189,17 @@ ProcessTableReportOptions (
 EFI_STATUS\r
 EFIAPI\r
 AcpiView (\r
-  IN EFI_SYSTEM_TABLESystemTable\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
   EFI_STATUS               Status;\r
   UINTN                    Index;\r
-  EFI_CONFIGURATION_TABLEEfiConfigurationTable;\r
+  EFI_CONFIGURATION_TABLE  *EfiConfigurationTable;\r
   BOOLEAN                  FoundAcpiTable;\r
   UINTN                    OriginalAttribute;\r
   UINTN                    PrintAttribute;\r
   EREPORT_OPTION           ReportOption;\r
-  UINT8*                   RsdpPtr;\r
+  UINT8                    *RsdpPtr;\r
   UINT32                   RsdpLength;\r
   UINT8                    RsdpRevision;\r
   PARSE_ACPI_TABLE_PROC    RsdpParserProc;\r
@@ -203,10 +210,10 @@ AcpiView (
   // set local variables to suppress incorrect compiler/analyzer warnings\r
   //\r
   EfiConfigurationTable = NULL;\r
-  OriginalAttribute = 0;\r
+  OriginalAttribute     = 0;\r
 \r
   // Reset Table counts\r
-  mTableCount = 0;\r
+  mTableCount    = 0;\r
   mBinTableCount = 0;\r
 \r
   // Reset The error/warning counters\r
@@ -219,16 +226,19 @@ AcpiView (
   // Search the table for an entry that matches the ACPI Table Guid\r
   FoundAcpiTable = FALSE;\r
   for (Index = 0; Index < SystemTable->NumberOfTableEntries; Index++) {\r
-    if (CompareGuid (&gEfiAcpiTableGuid,\r
-          &(SystemTable->ConfigurationTable[Index].VendorGuid))) {\r
+    if (CompareGuid (\r
+          &gEfiAcpiTableGuid,\r
+          &(SystemTable->ConfigurationTable[Index].VendorGuid)\r
+          ))\r
+    {\r
       EfiConfigurationTable = &SystemTable->ConfigurationTable[Index];\r
-      FoundAcpiTable = TRUE;\r
+      FoundAcpiTable        = TRUE;\r
       break;\r
     }\r
   }\r
 \r
   if (FoundAcpiTable) {\r
-    RsdpPtr = (UINT8*)EfiConfigurationTable->VendorTable;\r
+    RsdpPtr = (UINT8 *)EfiConfigurationTable->VendorTable;\r
 \r
     // The RSDP revision is 1 byte starting at offset 15\r
     RsdpRevision = *(RsdpPtr + RSDP_REVISION_OFFSET);\r
@@ -240,14 +250,15 @@ AcpiView (
       return EFI_UNSUPPORTED;\r
     }\r
 \r
-#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)\r
+ #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)\r
     if (GetMandatoryTableValidate ()) {\r
       ArmSbbrResetTableCounts ();\r
     }\r
-#endif\r
+\r
+ #endif\r
 \r
     // The RSDP length is 4 bytes starting at offset 20\r
-    RsdpLength = *(UINT32*)(RsdpPtr + RSDP_LENGTH_OFFSET);\r
+    RsdpLength = *(UINT32 *)(RsdpPtr + RSDP_LENGTH_OFFSET);\r
 \r
     Trace = ProcessTableReportOptions (RSDP_TABLE_INFO, RsdpPtr, RsdpLength);\r
 \r
@@ -265,7 +276,6 @@ AcpiView (
       RsdpLength,\r
       RsdpRevision\r
       );\r
-\r
   } else {\r
     IncrementErrorCount ();\r
     Print (\r
@@ -274,45 +284,50 @@ AcpiView (
     return EFI_NOT_FOUND;\r
   }\r
 \r
-#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)\r
+ #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)\r
   if (GetMandatoryTableValidate ()) {\r
     ArmSbbrReqsValidate ((ARM_SBBR_VERSION)GetMandatoryTableSpec ());\r
   }\r
-#endif\r
+\r
+ #endif\r
 \r
   ReportOption = GetReportOption ();\r
   if (ReportTableList != ReportOption) {\r
     if (((ReportSelected == ReportOption)  ||\r
          (ReportDumpBinFile == ReportOption)) &&\r
-        (!SelectedTable->Found)) {\r
+        (!SelectedTable->Found))\r
+    {\r
       Print (L"\nRequested ACPI Table not found.\n");\r
     } else if (GetConsistencyChecking () &&\r
-               (ReportDumpBinFile != ReportOption)) {\r
+               (ReportDumpBinFile != ReportOption))\r
+    {\r
       OriginalAttribute = gST->ConOut->Mode->Attribute;\r
 \r
       Print (L"\nTable Statistics:\n");\r
 \r
       if (GetColourHighlighting ()) {\r
         PrintAttribute = (GetErrorCount () > 0) ?\r
-                            EFI_TEXT_ATTR (\r
-                              EFI_RED,\r
-                              ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)\r
-                              ) :\r
-                            OriginalAttribute;\r
+                         EFI_TEXT_ATTR (\r
+                           EFI_RED,\r
+                           ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)\r
+                           ) :\r
+                         OriginalAttribute;\r
         gST->ConOut->SetAttribute (gST->ConOut, PrintAttribute);\r
       }\r
+\r
       Print (L"\t%d Error(s)\n", GetErrorCount ());\r
 \r
       if (GetColourHighlighting ()) {\r
         PrintAttribute = (GetWarningCount () > 0) ?\r
-                            EFI_TEXT_ATTR (\r
-                              EFI_RED,\r
-                              ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)\r
-                              ) :\r
-                            OriginalAttribute;\r
+                         EFI_TEXT_ATTR (\r
+                           EFI_RED,\r
+                           ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)\r
+                           ) :\r
+                         OriginalAttribute;\r
 \r
         gST->ConOut->SetAttribute (gST->ConOut, PrintAttribute);\r
       }\r
+\r
       Print (L"\t%d Warning(s)\n", GetWarningCount ());\r
 \r
       if (GetColourHighlighting ()) {\r
@@ -320,5 +335,6 @@ AcpiView (
       }\r
     }\r
   }\r
+\r
   return EFI_SUCCESS;\r
 }\r