]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIo.c
IntelFrameworkModulePkg: Clean up source files
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Isa / IsaIoDxe / IsaIo.c
index 2e4361fc0d5e22f669d2ac547499f06ff16f1993..837f46001de77d02b853c4a18bf960af2349337e 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
-  The implementation for EFI_ISA_IO_PROTOCOL. \r
-  \r
-Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  The implementation for EFI_ISA_IO_PROTOCOL.\r
+\r
+Copyright (c) 2010 - 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
@@ -18,11 +18,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 // Module Variables\r
 //\r
 EFI_ISA_IO_PROTOCOL mIsaIoInterface = {\r
-  {    \r
+  {\r
     IsaIoMemRead,\r
     IsaIoMemWrite\r
   },\r
-  {   \r
+  {\r
     IsaIoIoRead,\r
     IsaIoIoWrite\r
   },\r
@@ -86,9 +86,9 @@ EFI_ISA_DMA_REGISTERS  mDmaRegisters[8] = {
   @param[in] IsaIoDevice         The ISA device to be verified.\r
   @param[in] Type                The Access type. The input must be either IsaAccessTypeMem or IsaAccessTypeIo.\r
   @param[in] Width               The width of the memory operation.\r
-  @param[in] Count               The number of memory operations to perform. \r
-  @param[in] Offset              The offset in ISA memory space to start the memory operation.  \r
-  \r
+  @param[in] Count               The number of memory operations to perform.\r
+  @param[in] Offset              The offset in ISA memory space to start the memory operation.\r
+\r
   @retval EFI_SUCCESS            Verify success.\r
   @retval EFI_INVALID_PARAMETER  One of the parameters has an invalid value.\r
   @retval EFI_UNSUPPORTED        The device ont support the access type.\r
@@ -163,7 +163,7 @@ IsaIoAttribute (
     case EFI_ACPI_IO_DECODE_16_BIT:\r
       Attribute |= EFI_ISA_ACPI_IO_DECODE_16_BITS;\r
       break;\r
-      \r
+\r
     case EFI_ACPI_IO_DECODE_10_BIT:\r
       Attribute |= EFI_ISA_ACPI_IO_DECODE_10_BITS;\r
       break;\r
@@ -244,7 +244,7 @@ IsaDmaAttribute (
   UINT32             Attribute;\r
 \r
   Attribute = EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE;\r
-  \r
+\r
   switch (Information & EFI_ACPI_DMA_SPEED_TYPE_MASK) {\r
     case EFI_ACPI_DMA_SPEED_TYPE_COMPATIBILITY:\r
       Attribute |= EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_COMPATIBLE;\r
@@ -424,7 +424,7 @@ AcpiResourceToIsaResource (
   @param[in] IsaIoDevice            The isa device to be initialized.\r
   @param[in] DevicePath             The device path of the isa device.\r
   @param[in] Resources              The ACPI resource list.\r
-  \r
+\r
 **/\r
 VOID\r
 InitializeIsaIoInstance (\r
@@ -452,7 +452,7 @@ InitializeIsaIoInstance (
   ResourcePtr = Resources;\r
   Index       = 0;\r
   while (ResourcePtr.SmallHeader->Byte != ACPI_END_TAG_DESCRIPTOR) {\r
-    \r
+\r
     Index += AcpiResourceToIsaResource (ResourcePtr, NULL);\r
 \r
     if (ResourcePtr.SmallHeader->Bits.Type == 0) {\r
@@ -498,7 +498,7 @@ InitializeIsaIoInstance (
                               + sizeof (*ResourcePtr.LargeHeader));\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Convert the ACPI End Tag\r
   //\r
@@ -510,8 +510,8 @@ InitializeIsaIoInstance (
 \r
   @param[in]  This              A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
   @param[in]  Width             Specifies the width of the I/O operation.\r
-  @param[in]  Offset            The offset in ISA I/O space to start the I/O operation.  \r
-  @param[in]  Count             The number of I/O operations to perform. \r
+  @param[in]  Offset            The offset in ISA I/O space to start the I/O operation.\r
+  @param[in]  Count             The number of I/O operations to perform.\r
   @param[out] Buffer            The destination buffer to store the results\r
 \r
   @retval EFI_SUCCESS           The data was read from the device sucessfully.\r
@@ -572,8 +572,8 @@ IsaIoIoRead (
 \r
   @param[in] This                A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
   @param[in] Width               Specifies the width of the I/O operation.\r
-  @param[in] Offset              The offset in ISA I/O space to start the I/O operation.  \r
-  @param[in] Count               The number of I/O operations to perform. \r
+  @param[in] Offset              The offset in ISA I/O space to start the I/O operation.\r
+  @param[in] Count               The number of I/O operations to perform.\r
   @param[in] Buffer              The source buffer to write data from\r
 \r
   @retval EFI_SUCCESS            The data was writen to the device sucessfully.\r
@@ -633,7 +633,7 @@ IsaIoIoWrite (
   Writes an 8-bit I/O Port\r
 \r
   @param[in] This                A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
-  @param[in] Offset              The offset in ISA IO space to start the IO operation.  \r
+  @param[in] Offset              The offset in ISA IO space to start the IO operation.\r
   @param[in] Value               The data to write port.\r
 \r
   @retval EFI_SUCCESS            Success.\r
@@ -685,8 +685,8 @@ WritePort (
   @param[in] PageOffset          The page's offest.\r
   @param[in] CountOffset         The count's offset.\r
   @param[in] BaseAddress         The base address.\r
-  @param[in] Count               The number of I/O operations to perform. \r
-  \r
+  @param[in] Count               The number of I/O operations to perform.\r
+\r
   @retval EFI_SUCCESS            Success.\r
   @retval EFI_INVALID_PARAMETER  Parameter is invalid.\r
   @retval EFI_UNSUPPORTED        The address range specified by these Offsets and Count is not valid.\r
@@ -822,10 +822,10 @@ IsaIoFlush (
 \r
   @param[in]  This               A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
   @param[in]  Width              Specifies the width of the memory operation.\r
-  @param[in]  Offset             The offset in ISA memory space to start the memory operation.  \r
-  @param[in]  Count              The number of memory operations to perform. \r
+  @param[in]  Offset             The offset in ISA memory space to start the memory operation.\r
+  @param[in]  Count              The number of memory operations to perform.\r
   @param[out] Buffer             The destination buffer to store the results\r
\r
+\r
   @retval EFI_SUCCESS            The data was read from the device successfully.\r
   @retval EFI_UNSUPPORTED        The Offset is not valid for this device.\r
   @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.\r
@@ -889,10 +889,10 @@ IsaIoMemRead (
 /**\r
   Performs an ISA Memory Write Cycle\r
 \r
-  @param[in] This                A pointer to the EFI_ISA_IO_PROTOCOL instance.  \r
+  @param[in] This                A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
   @param[in] Width               Specifies the width of the memory operation.\r
-  @param[in] Offset              The offset in ISA memory space to start the memory operation.  \r
-  @param[in] Count               The number of memory operations to perform. \r
+  @param[in] Offset              The offset in ISA memory space to start the memory operation.\r
+  @param[in] Count               The number of memory operations to perform.\r
   @param[in] Buffer              The source buffer to write data from\r
 \r
   @retval EFI_SUCCESS            The data was written to the device sucessfully.\r
@@ -960,7 +960,7 @@ IsaIoMemWrite (
 \r
   @param[in]  This               A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
   @param[in]  Width              Specifies the width of the memory copy operation.\r
-  @param[in]  DestOffset         The offset of the destination \r
+  @param[in]  DestOffset         The offset of the destination\r
   @param[in]  SrcOffset          The offset of the source\r
   @param[in]  Count              The number of memory copy  operations to perform\r
 \r
@@ -1041,18 +1041,18 @@ IsaIoCopyMem (
   only supports slave read/write operation to save code size.\r
 \r
   @param This                    A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
-  @param Operation               Indicates the type of DMA (slave or bus master), and if \r
-                                 the DMA operation is going to read or write to system memory. \r
-  @param ChannelNumber           The slave channel number to use for this DMA operation. \r
-                                 If Operation and ChannelAttributes shows that this device \r
-                                 performs bus mastering DMA, then this field is ignored.  \r
-                                 The legal range for this field is 0..7.  \r
+  @param Operation               Indicates the type of DMA (slave or bus master), and if\r
+                                 the DMA operation is going to read or write to system memory.\r
+  @param ChannelNumber           The slave channel number to use for this DMA operation.\r
+                                 If Operation and ChannelAttributes shows that this device\r
+                                 performs bus mastering DMA, then this field is ignored.\r
+                                 The legal range for this field is 0..7.\r
   @param ChannelAttributes       The attributes of the DMA channel to use for this DMA operation\r
-  @param HostAddress             The system memory address to map to the device.  \r
-  @param NumberOfBytes           On input the number of bytes to map.  On output the number \r
+  @param HostAddress             The system memory address to map to the device.\r
+  @param NumberOfBytes           On input the number of bytes to map.  On output the number\r
                                  of bytes that were mapped.\r
-  @param DeviceAddress           The resulting map address for the bus master device to use \r
-                                 to access the hosts HostAddress.  \r
+  @param DeviceAddress           The resulting map address for the bus master device to use\r
+                                 to access the hosts HostAddress.\r
   @param Mapping                 A resulting value to pass to EFI_ISA_IO.Unmap().\r
 \r
   @retval EFI_SUCCESS            The range was mapped for the returned NumberOfBytes.\r
@@ -1083,7 +1083,7 @@ IsaIoMapOnlySupportSlaveReadWrite (
   UINT8                 DmaMask;\r
   UINT8                 DmaClear;\r
   UINT8                 DmaChannelMode;\r
-  \r
+\r
   if ((NULL == This) ||\r
       (NULL == HostAddress) ||\r
       (NULL == NumberOfBytes) ||\r
@@ -1102,7 +1102,7 @@ IsaIoMapOnlySupportSlaveReadWrite (
   // Make sure the Operation parameter is valid.\r
   // Light IsaIo only supports two operations.\r
   //\r
-  if (!(Operation == EfiIsaIoOperationSlaveRead || \r
+  if (!(Operation == EfiIsaIoOperationSlaveRead ||\r
         Operation == EfiIsaIoOperationSlaveWrite)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -1188,7 +1188,7 @@ IsaIoMapOnlySupportSlaveReadWrite (
     //\r
     *DeviceAddress = PhysicalAddress;\r
   }\r
-  \r
+\r
   //\r
   // Figure out what to program into the DMA Channel Mode Register\r
   //\r
@@ -1273,22 +1273,22 @@ IsaIoMapOnlySupportSlaveReadWrite (
 }\r
 \r
 /**\r
-  Maps a memory region for DMA. This implementation implement the \r
+  Maps a memory region for DMA. This implementation implement the\r
   the full mapping support.\r
 \r
   @param This                    A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
-  @param Operation               Indicates the type of DMA (slave or bus master), and if \r
-                                 the DMA operation is going to read or write to system memory. \r
-  @param ChannelNumber           The slave channel number to use for this DMA operation. \r
-                                 If Operation and ChannelAttributes shows that this device \r
-                                 performs bus mastering DMA, then this field is ignored.  \r
-                                 The legal range for this field is 0..7.  \r
+  @param Operation               Indicates the type of DMA (slave or bus master), and if\r
+                                 the DMA operation is going to read or write to system memory.\r
+  @param ChannelNumber           The slave channel number to use for this DMA operation.\r
+                                 If Operation and ChannelAttributes shows that this device\r
+                                 performs bus mastering DMA, then this field is ignored.\r
+                                 The legal range for this field is 0..7.\r
   @param ChannelAttributes       The attributes of the DMA channel to use for this DMA operation\r
-  @param HostAddress             The system memory address to map to the device.  \r
-  @param NumberOfBytes           On input the number of bytes to map.  On output the number \r
+  @param HostAddress             The system memory address to map to the device.\r
+  @param NumberOfBytes           On input the number of bytes to map.  On output the number\r
                                  of bytes that were mapped.\r
-  @param DeviceAddress           The resulting map address for the bus master device to use \r
-                                 to access the hosts HostAddress.  \r
+  @param DeviceAddress           The resulting map address for the bus master device to use\r
+                                 to access the hosts HostAddress.\r
   @param Mapping                 A resulting value to pass to EFI_ISA_IO.Unmap().\r
 \r
   @retval EFI_SUCCESS           - The range was mapped for the returned NumberOfBytes.\r
@@ -1602,18 +1602,18 @@ IsaIoMapFullSupport (
   Maps a memory region for DMA\r
 \r
   @param This                    A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
-  @param Operation               Indicates the type of DMA (slave or bus master), and if \r
-                                 the DMA operation is going to read or write to system memory. \r
-  @param ChannelNumber           The slave channel number to use for this DMA operation. \r
-                                 If Operation and ChannelAttributes shows that this device \r
-                                 performs bus mastering DMA, then this field is ignored.  \r
-                                 The legal range for this field is 0..7.  \r
+  @param Operation               Indicates the type of DMA (slave or bus master), and if\r
+                                 the DMA operation is going to read or write to system memory.\r
+  @param ChannelNumber           The slave channel number to use for this DMA operation.\r
+                                 If Operation and ChannelAttributes shows that this device\r
+                                 performs bus mastering DMA, then this field is ignored.\r
+                                 The legal range for this field is 0..7.\r
   @param ChannelAttributes       The attributes of the DMA channel to use for this DMA operation\r
-  @param HostAddress             The system memory address to map to the device.  \r
-  @param NumberOfBytes           On input the number of bytes to map.  On output the number \r
+  @param HostAddress             The system memory address to map to the device.\r
+  @param NumberOfBytes           On input the number of bytes to map.  On output the number\r
                                  of bytes that were mapped.\r
-  @param DeviceAddress           The resulting map address for the bus master device to use \r
-                                 to access the hosts HostAddress.  \r
+  @param DeviceAddress           The resulting map address for the bus master device to use\r
+                                 to access the hosts HostAddress.\r
   @param Mapping                 A resulting value to pass to EFI_ISA_IO.Unmap().\r
 \r
   @retval EFI_SUCCESS            The range was mapped for the returned NumberOfBytes.\r
@@ -1642,7 +1642,7 @@ IsaIoMap (
     return EFI_UNSUPPORTED;\r
   }\r
   //\r
-  // Set Feature Flag PcdIsaBusSupportBusMaster to FALSE to disable support for \r
+  // Set Feature Flag PcdIsaBusSupportBusMaster to FALSE to disable support for\r
   // ISA Bus Master.\r
   //\r
   // So we just return EFI_UNSUPPORTED for these functions.\r
@@ -1685,7 +1685,7 @@ IsaIoMap (
 \r
   @retval EFI_SUCCESS            The requested memory pages were allocated.\r
   @retval EFI_INVALID_PARAMETER  Type is invalid or MemoryType is invalid or HostAddress is NULL\r
-  @retval EFI_UNSUPPORTED        Attributes is unsupported or the memory range specified \r
+  @retval EFI_UNSUPPORTED        Attributes is unsupported or the memory range specified\r
                                  by HostAddress, Pages, and Type is not available for common buffer use.\r
   @retval EFI_OUT_OF_RESOURCES   The memory pages could not be allocated.\r
 **/\r
@@ -1704,7 +1704,7 @@ IsaIoAllocateBuffer (
   EFI_PHYSICAL_ADDRESS  PhysicalAddress;\r
 \r
   //\r
-  // Set Feature Flag PcdIsaBusOnlySupportSlaveDma to FALSE to disable support for \r
+  // Set Feature Flag PcdIsaBusOnlySupportSlaveDma to FALSE to disable support for\r
   // ISA Bus Master.\r
   // Or unset Feature Flag PcdIsaBusSupportDma to disable support for ISA DMA.\r
   //\r
@@ -1758,7 +1758,7 @@ IsaIoAllocateBuffer (
 }\r
 \r
 /**\r
-  Frees memory that was allocated with EFI_ISA_IO.AllocateBuffer(). \r
+  Frees memory that was allocated with EFI_ISA_IO.AllocateBuffer().\r
 \r
   @param[in] This                A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
   @param[in] Pages               The number of pages to free.\r
@@ -1778,7 +1778,7 @@ IsaIoFreeBuffer (
   EFI_STATUS  Status;\r
 \r
   //\r
-  // Set Feature Flag PcdIsaBusOnlySupportSlaveDma to FALSE to disable support for \r
+  // Set Feature Flag PcdIsaBusOnlySupportSlaveDma to FALSE to disable support for\r
   // ISA Bus Master.\r
   // Or unset Feature Flag PcdIsaBusSupportDma to disable support for ISA DMA.\r
   //\r