]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h
IntelFrameworkPkg/DxeIoLibCpuIo: Add new Fifo routines in IoLib class
[mirror_edk2.git] / IntelFrameworkPkg / Library / DxeIoLibCpuIo / DxeCpuIoLibInternal.h
index e0e54243b4032b85e604c16c01b997f2d656b4cf..c15bca8ee482d440890ff4aca794c71c197737d4 100644 (file)
@@ -1,8 +1,13 @@
 /** @file\r
   Internal include file of DXE CPU IO Library.\r
-\r
-  Copyright (c) 2006, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
+  It includes all necessary protocol/library class's header file\r
+  for implementation of IoLib library instance. It is included \r
+  all source code of this library instance.\r
+  \r
+  Copyright (c) 2006 - 2010, 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
 #ifndef _DXE_CPUIO_LIB_INTERNAL_H_\r
 #define _DXE_CPUIO_LIB_INTERNAL_H_\r
 \r
-//\r
-// The package level header files this module uses\r
-//\r
+\r
 #include <FrameworkDxe.h>\r
 \r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
 #include <Protocol/CpuIo.h>\r
-#include <Protocol/PciRootBridgeIo.h>\r
 \r
-//\r
-// The Library classes this module consumes\r
-//\r
 #include <Library/IoLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/DebugLib.h>\r
   Reads registers in the EFI CPU I/O space.\r
 \r
   Reads the I/O port specified by Port with registers width specified by Width.\r
-  The read value is returned. If such operations are not supported, then ASSERT().\r
+  The read value is returned.\r
+\r
   This function must guarantee that all I/O read and write operations are serialized.\r
+  If such operations are not supported, then ASSERT().\r
 \r
   @param  Port          The base address of the I/O operation.\r
                         The caller is responsible for aligning the Address if required.\r
 UINT64\r
 EFIAPI\r
 IoReadWorker (\r
-  IN      UINTN                     Port,\r
-  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width\r
+  IN      UINTN                      Port,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH  Width\r
   );\r
 \r
 /**\r
   Writes registers in the EFI CPU I/O space.\r
 \r
   Writes the I/O port specified by Port with registers width and value specified by Width\r
-  and Data respectively.  Data is returned. If such operations are not supported, then ASSERT().\r
+  and Data respectively. Data is returned.\r
+\r
   This function must guarantee that all I/O read and write operations are serialized.\r
+  If such operations are not supported, then ASSERT().\r
 \r
   @param  Port          The base address of the I/O operation.\r
                         The caller is responsible for aligning the Address if required.\r
   @param  Width         The width of the I/O operation.\r
   @param  Data          The value to write to the I/O port.\r
 \r
-  @return The paramter of Data.\r
+  @return The parameter of Data.\r
 \r
 **/\r
 UINT64\r
 EFIAPI\r
 IoWriteWorker (\r
-  IN      UINTN                     Port,\r
-  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
-  IN      UINT64                    Data\r
+  IN      UINTN                      Port,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH  Width,\r
+  IN      UINT64                     Data\r
+  );\r
+\r
+/**\r
+  Reads registers in the EFI CPU I/O space.\r
+\r
+  Reads the I/O port specified by Port with registers width specified by Width.\r
+  The port is read Count times, and the read data is stored in the provided Buffer.\r
+\r
+  This function must guarantee that all I/O read and write operations are serialized.\r
+  If such operations are not supported, then ASSERT().\r
+\r
+  @param  Port          The base address of the I/O operation.\r
+                        The caller is responsible for aligning the Address if required.\r
+  @param  Width         The width of the I/O operation.\r
+  @param  Count         The number of times to read I/O port.\r
+  @param  Buffer        The buffer to store the read data into.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+IoReadFifoWorker (\r
+  IN      UINTN                      Port,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH  Width,\r
+  IN      UINTN                      Count,\r
+  IN      VOID                       *Buffer\r
+  );\r
+\r
+/**\r
+  Writes registers in the EFI CPU I/O space.\r
+\r
+  Writes the I/O port specified by Port with registers width specified by Width.\r
+  The port is written Count times, and the write data is retrieved from the provided Buffer.\r
+\r
+  This function must guarantee that all I/O read and write operations are serialized.\r
+  If such operations are not supported, then ASSERT().\r
+\r
+  @param  Port          The base address of the I/O operation.\r
+                        The caller is responsible for aligning the Address if required.\r
+  @param  Width         The width of the I/O operation.\r
+  @param  Count         The number of times to write I/O port.\r
+  @param  Buffer        The buffer to store the read data into.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+IoWriteFifoWorker (\r
+  IN      UINTN                      Port,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH  Width,\r
+  IN      UINTN                      Count,\r
+  IN      VOID                       *Buffer\r
   );\r
 \r
 /**\r
@@ -112,7 +162,8 @@ MmioReadWorker (
   @param  Address       The MMIO register to read.\r
                         The caller is responsible for aligning the Address if required.\r
   @param  Width         The width of the I/O operation.\r
-\r
+  @param  Data          The value to write to the I/O port.\r
+  \r
   @return Data read from registers in the EFI system memory space.\r
 \r
 **/\r