]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c
UefiCpuPkg: Clean up source files
[mirror_edk2.git] / UefiCpuPkg / CpuIo2Smm / CpuIo2Smm.c
index 20b8350fe4a4e189a80dd64b05bd8de65af8cc73..619249300f853c36df1a6b7f0a12188b65789367 100644 (file)
@@ -1,14 +1,14 @@
 /** @file\r
   Produces the SMM CPU I/O Protocol.\r
 \r
-Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\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
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\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
@@ -48,17 +48,17 @@ UINT8 mStride[] = {
 \r
   @param[in]  MmioOperation  TRUE for an MMIO operation, FALSE for I/O Port operation.\r
   @param[in]  Width          Signifies the width of the I/O operations.\r
-  @param[in]  Address        The base address of the I/O operations.  The caller is \r
-                             responsible for aligning the Address if required. \r
+  @param[in]  Address        The base address of the I/O operations.  The caller is\r
+                             responsible for aligning the Address if required.\r
   @param[in]  Count          The number of I/O operations to perform.\r
-  @param[in]  Buffer         For read operations, the destination buffer to store \r
-                             the results.  For write operations, the source buffer \r
+  @param[in]  Buffer         For read operations, the destination buffer to store\r
+                             the results.  For write operations, the source buffer\r
                              from which to write data.\r
 \r
   @retval EFI_SUCCESS            The data was read from or written to the device.\r
   @retval EFI_UNSUPPORTED        The Address is not valid for this system.\r
   @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.\r
-                                 \r
+\r
 **/\r
 EFI_STATUS\r
 CpuIoCheckParameter (\r
@@ -92,20 +92,20 @@ CpuIoCheckParameter (
   if (!MmioOperation && (Width == SMM_IO_UINT64)) {\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
@@ -113,7 +113,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
@@ -122,7 +122,7 @@ CpuIoCheckParameter (
       return EFI_UNSUPPORTED;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Check to see if Address is aligned\r
   //\r
@@ -136,23 +136,23 @@ CpuIoCheckParameter (
 /**\r
   Reads memory-mapped registers.\r
 \r
-  The I/O operations are carried out exactly as requested.  The caller is \r
-  responsible for any alignment and I/O width issues that the bus, device, \r
+  The I/O operations are carried out exactly as requested.  The caller is\r
+  responsible for any alignment and I/O width issues that the bus, device,\r
   platform, or type of I/O might require.\r
 \r
   @param[in]  This     The EFI_SMM_CPU_IO2_PROTOCOL instance.\r
   @param[in]  Width    Signifies the width of the I/O operations.\r
-  @param[in]  Address  The base address of the I/O operations.  The caller is \r
-                       responsible for aligning the Address if required. \r
+  @param[in]  Address  The base address of the I/O operations.  The caller is\r
+                       responsible for aligning the Address if required.\r
   @param[in]  Count    The number of I/O operations to perform.\r
-  @param[out] Buffer   For read operations, the destination buffer to store \r
-                       the results.  For write operations, the source buffer \r
+  @param[out] Buffer   For read operations, the destination buffer to store\r
+                       the results.  For write operations, the source buffer\r
                        from which to write data.\r
 \r
   @retval EFI_SUCCESS            The data was read from or written to the device.\r
   @retval EFI_UNSUPPORTED        The Address is not valid for this system.\r
   @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.\r
-  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a \r
+  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a\r
                                  lack of resources\r
 \r
 **/\r
@@ -196,23 +196,23 @@ CpuMemoryServiceRead (
 /**\r
   Writes memory-mapped registers.\r
 \r
-  The I/O operations are carried out exactly as requested.  The caller is \r
-  responsible for any alignment and I/O width issues that the bus, device, \r
+  The I/O operations are carried out exactly as requested.  The caller is\r
+  responsible for any alignment and I/O width issues that the bus, device,\r
   platform, or type of I/O might require.\r
 \r
   @param[in]  This     The EFI_SMM_CPU_IO2_PROTOCOL instance.\r
   @param[in]  Width    Signifies the width of the I/O operations.\r
-  @param[in]  Address  The base address of the I/O operations.  The caller is \r
-                       responsible for aligning the Address if required. \r
+  @param[in]  Address  The base address of the I/O operations.  The caller is\r
+                       responsible for aligning the Address if required.\r
   @param[in]  Count    The number of I/O operations to perform.\r
-  @param[in]  Buffer   For read operations, the destination buffer to store \r
-                       the results.  For write operations, the source buffer \r
+  @param[in]  Buffer   For read operations, the destination buffer to store\r
+                       the results.  For write operations, the source buffer\r
                        from which to write data.\r
 \r
   @retval EFI_SUCCESS            The data was read from or written to the device.\r
   @retval EFI_UNSUPPORTED        The Address is not valid for this system.\r
   @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.\r
-  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a \r
+  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a\r
                                  lack of resources\r
 \r
 **/\r
@@ -256,23 +256,23 @@ CpuMemoryServiceWrite (
 /**\r
   Reads I/O registers.\r
 \r
-  The I/O operations are carried out exactly as requested.  The caller is \r
-  responsible for any alignment and I/O width issues that the bus, device, \r
+  The I/O operations are carried out exactly as requested.  The caller is\r
+  responsible for any alignment and I/O width issues that the bus, device,\r
   platform, or type of I/O might require.\r
 \r
   @param[in]  This     The EFI_SMM_CPU_IO2_PROTOCOL instance.\r
   @param[in]  Width    Signifies the width of the I/O operations.\r
-  @param[in]  Address  The base address of the I/O operations.  The caller is \r
-                       responsible for aligning the Address if required. \r
+  @param[in]  Address  The base address of the I/O operations.  The caller is\r
+                       responsible for aligning the Address if required.\r
   @param[in]  Count    The number of I/O operations to perform.\r
-  @param[out] Buffer   For read operations, the destination buffer to store \r
-                       the results.  For write operations, the source buffer \r
+  @param[out] Buffer   For read operations, the destination buffer to store\r
+                       the results.  For write operations, the source buffer\r
                        from which to write data.\r
 \r
   @retval EFI_SUCCESS            The data was read from or written to the device.\r
   @retval EFI_UNSUPPORTED        The Address is not valid for this system.\r
   @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.\r
-  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a \r
+  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a\r
                                  lack of resources\r
 \r
 **/\r
@@ -315,23 +315,23 @@ CpuIoServiceRead (
 /**\r
   Write I/O registers.\r
 \r
-  The I/O operations are carried out exactly as requested.  The caller is \r
-  responsible for any alignment and I/O width issues that the bus, device, \r
+  The I/O operations are carried out exactly as requested.  The caller is\r
+  responsible for any alignment and I/O width issues that the bus, device,\r
   platform, or type of I/O might require.\r
 \r
   @param[in]  This     The EFI_SMM_CPU_IO2_PROTOCOL instance.\r
   @param[in]  Width    Signifies the width of the I/O operations.\r
-  @param[in]  Address  The base address of the I/O operations.  The caller is \r
-                       responsible for aligning the Address if required. \r
+  @param[in]  Address  The base address of the I/O operations.  The caller is\r
+                       responsible for aligning the Address if required.\r
   @param[in]  Count    The number of I/O operations to perform.\r
-  @param[in]  Buffer   For read operations, the destination buffer to store \r
-                       the results.  For write operations, the source buffer \r
+  @param[in]  Buffer   For read operations, the destination buffer to store\r
+                       the results.  For write operations, the source buffer\r
                        from which to write data.\r
 \r
   @retval EFI_SUCCESS            The data was read from or written to the device.\r
   @retval EFI_UNSUPPORTED        The Address is not valid for this system.\r
   @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.\r
-  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a \r
+  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a\r
                                  lack of resources\r
 \r
 **/\r
@@ -370,7 +370,7 @@ CpuIoServiceWrite (
       IoWrite32 ((UINTN)Address, *((UINT32 *)Uint8Buffer));\r
     }\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -408,6 +408,6 @@ SmmCpuIo2Initialize (
                     &mSmmCpuIo2\r
                     );\r
   ASSERT_EFI_ERROR (Status);\r
-  \r
+\r
   return Status;\r
 }\r