]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuIoPei/CpuIoPei.c
UefiCpuPkg: Clean up source files
[mirror_edk2.git] / UefiCpuPkg / CpuIoPei / CpuIoPei.c
index b6d538b166776f2941b88d70c6c789353d7c5a93..30d2ae968219b02caa3489c56dc9dd17233b5e95 100644 (file)
@@ -1,16 +1,16 @@
 /** @file\r
   Produces the CPU I/O PPI.\r
 \r
-Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
 Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>\r
 \r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 **/\r
 \r
@@ -54,7 +54,7 @@ EFI_PEI_PPI_DESCRIPTOR gPpiList = {
   &gEfiPeiCpuIoPpiInstalledGuid,\r
   NULL\r
 };\r
-  \r
+\r
 //\r
 // Lookup table for increment values based on transfer widths\r
 //\r
@@ -103,9 +103,9 @@ UINT8 mOutStride[] = {
   @retval EFI_SUCCESS            The parameters for this request pass the checks.\r
   @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.\r
   @retval EFI_INVALID_PARAMETER  Buffer is NULL.\r
-  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, \r
+  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,\r
                                  and Count is not valid for this EFI system.\r
-                                 \r
+\r
 **/\r
 EFI_STATUS\r
 CpuIoCheckParameter (\r
@@ -148,20 +148,20 @@ CpuIoCheckParameter (
   if (!MmioOperation && (Width == EfiPeiCpuIoWidthUint64)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
-  // Check to see if any address associated with this transfer exceeds the maximum \r
+  // Check to see if any address associated with this transfer exceeds the maximum\r
   // allowed address.  The maximum address implied by the parameters passed in is\r
   // Address + Size * Count.  If the following condition is met, then the transfer\r
   // is not supported.\r
   //\r
   //    Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS) + 1\r
   //\r
-  // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count \r
+  // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count\r
   // can also be the maximum integer value supported by the CPU, this range\r
   // check must be adjusted to avoid all overflow conditions.\r
-  //   \r
-  // The following form of the range check is equivalent but assumes that \r
+  //\r
+  // The following form of the range check is equivalent but assumes that\r
   // MAX_ADDRESS and MAX_IO_PORT_ADDRESS are of the form (2^n - 1).\r
   //\r
   Limit = (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS);\r
@@ -169,7 +169,7 @@ CpuIoCheckParameter (
     if (Address > Limit) {\r
       return EFI_UNSUPPORTED;\r
     }\r
-  } else {  \r
+  } else {\r
     MaxCount = RShiftU64 (Limit, Width);\r
     if (MaxCount < (Count - 1)) {\r
       return EFI_UNSUPPORTED;\r
@@ -178,7 +178,7 @@ CpuIoCheckParameter (
       return EFI_UNSUPPORTED;\r
     }\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -196,7 +196,7 @@ CpuIoCheckParameter (
   @retval EFI_SUCCESS            The function completed successfully.\r
   @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.\r
   @retval EFI_INVALID_PARAMETER  Buffer is NULL.\r
-  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, \r
+  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,\r
                                  and Count is not valid for this EFI system.\r
 \r
 **/\r
@@ -270,7 +270,7 @@ CpuMemoryServiceRead (
   @retval EFI_SUCCESS            The function completed successfully.\r
   @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.\r
   @retval EFI_INVALID_PARAMETER  Buffer is NULL.\r
-  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, \r
+  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,\r
                                  and Count is not valid for this EFI system.\r
 \r
 **/\r
@@ -344,7 +344,7 @@ CpuMemoryServiceWrite (
   @retval EFI_SUCCESS            The function completed successfully.\r
   @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.\r
   @retval EFI_INVALID_PARAMETER  Buffer is NULL.\r
-  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, \r
+  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,\r
                                  and Count is not valid for this EFI system.\r
 \r
 **/\r
@@ -438,7 +438,7 @@ CpuIoServiceRead (
   @retval EFI_SUCCESS            The function completed successfully.\r
   @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.\r
   @retval EFI_INVALID_PARAMETER  Buffer is NULL.\r
-  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, \r
+  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,\r
                                  and Count is not valid for this EFI system.\r
 \r
 **/\r
@@ -517,14 +517,14 @@ CpuIoServiceWrite (
       }\r
     }\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
   8-bit I/O read operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -545,7 +545,7 @@ CpuIoRead8 (
 /**\r
   16-bit I/O read operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -567,7 +567,7 @@ CpuIoRead16 (
 /**\r
   32-bit I/O read operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -589,7 +589,7 @@ CpuIoRead32 (
 /**\r
   64-bit I/O read operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -611,7 +611,7 @@ CpuIoRead64 (
 /**\r
   8-bit I/O write operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -633,7 +633,7 @@ CpuIoWrite8 (
 /**\r
   16-bit I/O write operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -655,7 +655,7 @@ CpuIoWrite16 (
 /**\r
   32-bit I/O write operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -677,7 +677,7 @@ CpuIoWrite32 (
 /**\r
   64-bit I/O write operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -699,7 +699,7 @@ CpuIoWrite64 (
 /**\r
   8-bit memory read operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -721,7 +721,7 @@ CpuMemRead8 (
 /**\r
   16-bit memory read operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -743,7 +743,7 @@ CpuMemRead16 (
 /**\r
   32-bit memory read operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -765,7 +765,7 @@ CpuMemRead32 (
 /**\r
   64-bit memory read operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -787,7 +787,7 @@ CpuMemRead64 (
 /**\r
   8-bit memory write operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -809,7 +809,7 @@ CpuMemWrite8 (
 /**\r
   16-bit memory write operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -831,7 +831,7 @@ CpuMemWrite16 (
 /**\r
   32-bit memory write operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -853,7 +853,7 @@ CpuMemWrite32 (
 /**\r
   64-bit memory write operations.\r
 \r
-  @param[in] PeiServices  An indirect pointer to the PEI Services Table published \r
+  @param[in] PeiServices  An indirect pointer to the PEI Services Table published\r
                           by the PEI Foundation.\r
   @param[in] This         Pointer to local data for the interface.\r
   @param[in] Address      The physical address of the access.\r
@@ -878,7 +878,7 @@ CpuMemWrite64 (
   This function is the Entry point of the CPU I/O PEIM which installs CpuIoPpi.\r
 \r
   @param[in]  FileHandle   Pointer to image file handle.\r
-  @param[in]  PeiServices  Pointer to PEI Services Table   \r
+  @param[in]  PeiServices  Pointer to PEI Services Table\r
 \r
   @retval EFI_SUCCESS  CPU I/O PPI successfully installed\r
 \r
@@ -896,12 +896,12 @@ CpuIoInitialize (
   // Register so it will be automatically shadowed to memory\r
   //\r
   Status = PeiServicesRegisterForShadow (FileHandle);\r
-  \r
+\r
   //\r
   // Make CpuIo pointer in PeiService table point to gCpuIoPpi\r
   //\r
   (*((EFI_PEI_SERVICES **)PeiServices))->CpuIo = &gCpuIoPpi;\r
-  \r
+\r
   if (Status == EFI_ALREADY_STARTED) {\r
     //\r
     // Shadow completed and running from memory\r
@@ -911,6 +911,6 @@ CpuIoInitialize (
     Status = PeiServicesInstallPpi (&gPpiList);\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r