]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportAcpiSupportProtocol.c
IntelFrameworkModulePkg: Clean up source files
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / Acpi / AcpiSupportDxe / AcpiSupportAcpiSupportProtocol.c
index 6443c3acd0e9de7feec8c324f11faa7b38f8bed4..aeacd02f6ab98d85a954eef1b9103e2d7c4f3beb 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ACPI Support Protocol implementation\r
 \r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -19,9 +19,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 #include "AcpiSupport.h"\r
 //\r
-// The maximum number of tables that pre-allocated. \r
+// The maximum number of tables that pre-allocated.\r
 //\r
-UINTN         mEfiAcpiMaxNumTables = EFI_ACPI_MAX_NUM_TABLES; \r
+UINTN         mEfiAcpiMaxNumTables = EFI_ACPI_MAX_NUM_TABLES;\r
 /**\r
   This function adds an ACPI table to the table list.  It will detect FACS and\r
   allocate the correct type of memory and properly align the table.\r
@@ -91,10 +91,10 @@ ChecksumCommonTables (
   );\r
 \r
 /**\r
-  This function returns a table specified by an index if it exists.  \r
-  \r
-  The function returns a buffer containing the table that the caller must free.  \r
-  The function also returns a handle used to identify the table for update or \r
+  This function returns a table specified by an index if it exists.\r
+\r
+  The function returns a buffer containing the table that the caller must free.\r
+  The function also returns a handle used to identify the table for update or\r
   deletion using the SetAcpiTable function.\r
 \r
   @param This        Instance of the protocol.\r
@@ -165,7 +165,7 @@ GetAcpiTable (
 }\r
 /**\r
   This function adds, removes, or updates ACPI tables.  If the address is not\r
-  null and the handle value is null, the table is added.  If both the address and \r
+  null and the handle value is null, the table is added.  If both the address and\r
   handle are not null, the table at handle is updated with the table at address.\r
   If the address is null and the handle is not, the table at handle is deleted.\r
 \r
@@ -371,7 +371,7 @@ PublishTables (
   @param  TableKey             Reurns a key to refer to the ACPI table.\r
 \r
   @return EFI_SUCCESS            The table was successfully inserted.\r
-  @return EFI_INVALID_PARAMETER  Either AcpiTableBuffer is NULL, TableKey is NULL, or AcpiTableBufferSize \r
+  @return EFI_INVALID_PARAMETER  Either AcpiTableBuffer is NULL, TableKey is NULL, or AcpiTableBufferSize\r
                                  and the size field embedded in the ACPI table pointed to by AcpiTableBuffer\r
                                  are not in sync.\r
   @return EFI_OUT_OF_RESOURCES   Insufficient resources exist to complete the request.\r
@@ -427,7 +427,7 @@ InstallAcpiTable (
                             );\r
   }\r
   FreePool (AcpiTableBufferConst);\r
-  \r
+\r
   return Status;\r
 }\r
 /**\r
@@ -500,7 +500,7 @@ ReallocateAcpiTableBuffer (
   EFI_STATUS                 Status;\r
   UINT64                     CurrentData;\r
 \r
-  CopyMem (&TempPrivateData, AcpiSupportInstance, sizeof (EFI_ACPI_SUPPORT_INSTANCE)); \r
+  CopyMem (&TempPrivateData, AcpiSupportInstance, sizeof (EFI_ACPI_SUPPORT_INSTANCE));\r
   //\r
   // Enlarge the max table number from mEfiAcpiMaxNumTables to mEfiAcpiMaxNumTables + EFI_ACPI_MAX_NUM_TABLES\r
   //\r
@@ -538,7 +538,7 @@ ReallocateAcpiTableBuffer (
 \r
   Pointer = (UINT8 *) (UINTN) PageAddress;\r
   ZeroMem (Pointer, TotalSize);\r
-  \r
+\r
   AcpiSupportInstance->Rsdt1 = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;\r
   Pointer += (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + NewMaxTableNumber * sizeof (UINT32));\r
   AcpiSupportInstance->Rsdt3 = (EFI_ACPI_DESCRIPTION_HEADER *) Pointer;\r
@@ -554,12 +554,12 @@ ReallocateAcpiTableBuffer (
   CopyMem (&AcpiSupportInstance->Rsdp3->XsdtAddress, &CurrentData, sizeof (UINT64));\r
 \r
   //\r
-  // copy the original Rsdt1, Rsdt3 and Xsdt structure to new buffer \r
+  // copy the original Rsdt1, Rsdt3 and Xsdt structure to new buffer\r
   //\r
-  CopyMem (AcpiSupportInstance->Rsdt1, TempPrivateData.Rsdt1, (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + mEfiAcpiMaxNumTables * sizeof (UINT32))); \r
-  CopyMem (AcpiSupportInstance->Rsdt3, TempPrivateData.Rsdt3, (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + mEfiAcpiMaxNumTables * sizeof (UINT32))); \r
+  CopyMem (AcpiSupportInstance->Rsdt1, TempPrivateData.Rsdt1, (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + mEfiAcpiMaxNumTables * sizeof (UINT32)));\r
+  CopyMem (AcpiSupportInstance->Rsdt3, TempPrivateData.Rsdt3, (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + mEfiAcpiMaxNumTables * sizeof (UINT32)));\r
   CopyMem (AcpiSupportInstance->Xsdt, TempPrivateData.Xsdt, (sizeof (EFI_ACPI_DESCRIPTION_HEADER) + mEfiAcpiMaxNumTables * sizeof (UINT64)));\r
-  \r
+\r
   //\r
   // Calculate orignal ACPI table buffer size\r
   //\r
@@ -570,10 +570,10 @@ ReallocateAcpiTableBuffer (
               sizeof (EFI_ACPI_DESCRIPTION_HEADER) +         // for ACPI 2.0/3.0 XSDT\r
               mEfiAcpiMaxNumTables * sizeof (UINT64);\r
   gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)TempPrivateData.Rsdt1, EFI_SIZE_TO_PAGES (TotalSize));\r
-  \r
+\r
   //\r
   // Update the Max ACPI table number\r
-  // \r
+  //\r
   mEfiAcpiMaxNumTables = NewMaxTableNumber;\r
   return EFI_SUCCESS;\r
 }\r
@@ -650,7 +650,7 @@ AddTableToList (
   //\r
   // Allocation memory type depends on the type of the table\r
   //\r
-  if ((CurrentTableSignature == EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) || \r
+  if ((CurrentTableSignature == EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) ||\r
       (CurrentTableSignature == EFI_ACPI_4_0_UEFI_ACPI_DATA_TABLE_SIGNATURE)) {\r
     //\r
     // Allocate memory for the FACS.  This structure must be aligned\r
@@ -778,7 +778,7 @@ AddTableToList (
 \r
       //\r
       // Update pointers in FADT.  If tables don't exist this will put NULL pointers there.\r
-      // Note: If the FIRMWARE_CTRL is non-zero, then X_FIRMWARE_CTRL must be zero, and \r
+      // Note: If the FIRMWARE_CTRL is non-zero, then X_FIRMWARE_CTRL must be zero, and\r
       // vice-versa.\r
       //\r
       if ((UINT64)(UINTN)AcpiSupportInstance->Facs3 < BASE_4GB) {\r
@@ -913,7 +913,7 @@ AddTableToList (
       //\r
       if (AcpiSupportInstance->Fadt3 != NULL) {\r
         //\r
-        // Note: If the FIRMWARE_CTRL is non-zero, then X_FIRMWARE_CTRL must be zero, and \r
+        // Note: If the FIRMWARE_CTRL is non-zero, then X_FIRMWARE_CTRL must be zero, and\r
         // vice-versa.\r
         //\r
         if ((UINT64)(UINTN)AcpiSupportInstance->Facs3 < BASE_4GB) {\r
@@ -984,7 +984,7 @@ AddTableToList (
           );\r
       }\r
     }\r
-    \r
+\r
      if ((Version & EFI_ACPI_TABLE_VERSION_2_0) != 0 ||\r
         (Version & EFI_ACPI_TABLE_VERSION_3_0) != 0) {\r
       //\r
@@ -1014,7 +1014,7 @@ AddTableToList (
           Checksum)\r
           );\r
       }\r
-    }        \r
+    }\r
     //\r
     // Checksum the table\r
     //\r
@@ -1094,7 +1094,7 @@ AddTableToList (
        if (AcpiSupportInstance->NumberOfTableEntries3 >= mEfiAcpiMaxNumTables) {\r
          Status = ReallocateAcpiTableBuffer (AcpiSupportInstance);\r
          ASSERT_EFI_ERROR (Status);\r
-       }      \r
+       }\r
       //\r
       // At this time, it is assumed that RSDT and XSDT maintain parallel lists of tables.\r
       // If it becomes necessary to maintain separate table lists, changes will be required.\r
@@ -1159,7 +1159,7 @@ AddTableToList (
 \r
   @param  Handle      Table to find.\r
   @param  TableList   Table list to search\r
-  @param  Table       Pointer to table found. \r
+  @param  Table       Pointer to table found.\r
 \r
   @return EFI_SUCCESS    The function completed successfully.\r
   @return EFI_NOT_FOUND  No table found matching the handle specified.\r
@@ -1207,7 +1207,7 @@ FindTableByHandle (
   For Acpi 1.0 tables, pass in the Rsdt.\r
   For Acpi 2.0 tables, pass in both Rsdt and Xsdt.\r
 \r
-  @param  Table                 Pointer to table found. \r
+  @param  Table                 Pointer to table found.\r
   @param  NumberOfTableEntries  Current number of table entries in the RSDT/XSDT\r
   @param  Rsdt                  Pointer to the RSDT to remove from\r
   @param  Xsdt                  Pointer to the Xsdt to remove from\r
@@ -1417,11 +1417,11 @@ DeleteTable (
       //\r
       if (Version & EFI_ACPI_TABLE_VERSION_2_0 & Table->Version) {\r
         Table->Version = Table->Version &~EFI_ACPI_TABLE_VERSION_2_0;\r
-      }      \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
-      \r
+\r
       //\r
       // Remove from Rsdt and Xsdt.  We don't care about the return value\r
       // because it is acceptable for the table to not exist in Rsdt/Xsdt.\r
@@ -1435,7 +1435,7 @@ DeleteTable (
           AcpiSupportInstance->Xsdt\r
           );\r
       }\r
-    }    \r
+    }\r
     //\r
     // Free the table, clean up any dependent tables and our private data pointers.\r
     //\r
@@ -1495,7 +1495,7 @@ DeleteTable (
             Checksum)\r
             );\r
         }\r
-      }    \r
+      }\r
       break;\r
 \r
     case EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE:\r
@@ -1520,7 +1520,7 @@ DeleteTable (
         }\r
       }\r
 \r
-      \r
+\r
       if ((Version & EFI_ACPI_TABLE_VERSION_2_0) != 0 ||\r
           (Version & EFI_ACPI_TABLE_VERSION_3_0) != 0) {\r
         AcpiSupportInstance->Dsdt3 = NULL;\r
@@ -1733,12 +1733,12 @@ ChecksumCommonTables (
     OFFSET_OF (EFI_ACPI_DESCRIPTION_HEADER,\r
     Checksum)\r
     );\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
-/** \r
+/**\r
   Constructor for the ACPI support protocol to initializes instance data.\r
-  \r
+\r
   @param AcpiSupportInstance   Instance to construct\r
 \r
   @retval EFI_SUCCESS             Instance initialized.\r
@@ -1769,7 +1769,7 @@ AcpiSupportAcpiSupportConstructor (
 \r
   AcpiSupportInstance->AcpiTableProtocol.InstallAcpiTable   = InstallAcpiTable;\r
   AcpiSupportInstance->AcpiTableProtocol.UninstallAcpiTable = UninstallAcpiTable;\r
-  \r
+\r
   //\r
   // Create RSDP table\r
   //\r