/** @file\r
- I/O and MMIO Library Services\r
+ Provide services to access I/O Ports and MMIO registers.\r
\r
- Copyright (c) 2006, Intel Corporation\r
- All rights reserved. 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
+Copyright (c) 2006 - 2008, Intel Corporation\r
+All rights reserved. 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
- Module Name: IoLib.h\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
#ifndef __IO_LIB_H__\r
#define __IO_LIB_H__\r
\r
+/**\r
+ Macro that converts PCI Segment and I/O Port to an address that can be\r
+ passed to the I/O Library functions.\r
+ \r
+ Computes an address that is compatible with the I/O Library functions. \r
+ The unused upper bits of Segment, and Port are stripped prior to the \r
+ generation of the address.\r
+ \r
+ @param Segment PCI Segment number. Range 0..65535.\r
+ @param Port I/O Port number. Range 0..65535.\r
+ \r
+ @return An address that the I/o Library functions need.\r
+\r
+**/\r
+\r
#define IO_LIB_ADDRESS(Segment,Port) \\r
( ((Port) & 0xffff) | (((Segment) & 0xffff) << 16) )\r
\r
serialized.\r
\r
If 16-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 16-bit boundary, then ASSERT().\r
\r
@param Port The I/O port to read.\r
\r
operations are serialized.\r
\r
If 16-bit I/O port operations are not supported, then ASSERT().\r
-\r
+ If Port is not aligned on a 16-bit boundary, then ASSERT().\r
+ \r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
operations are serialized.\r
\r
If 16-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 16-bit boundary, then ASSERT().\r
\r
@param Port The I/O port to write.\r
@param OrData The value to OR with the read value from the I/O port.\r
are serialized.\r
\r
If 16-bit I/O port operations are not supported, then ASSERT().\r
-\r
+ If Port is not aligned on a 16-bit boundary, then ASSERT().\r
+ \r
@param Port The I/O port to write.\r
@param AndData The value to AND with the read value from the I/O port.\r
\r
I/O read and write operations are serialized.\r
\r
If 16-bit I/O port operations are not supported, then ASSERT().\r
-\r
+ If Port is not aligned on a 16-bit boundary, then ASSERT().\r
+ \r
@param Port The I/O port to write.\r
@param AndData The value to AND with the read value from the I/O port.\r
@param OrData The value to OR with the result of the AND operation.\r
the StartBit and the EndBit. The value of the bit field is returned.\r
\r
If 16-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 16-bit boundary, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
left bits in Value are stripped.\r
\r
If 16-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 16-bit boundary, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
operations are serialized. Extra left bits in OrData are stripped.\r
\r
If 16-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 16-bit boundary, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
are serialized. Extra left bits in AndData are stripped.\r
\r
If 16-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 16-bit boundary, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
AndData and OrData are stripped.\r
\r
If 16-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 16-bit boundary, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
serialized.\r
\r
If 32-bit I/O port operations are not supported, then ASSERT().\r
-\r
+ If Port is not aligned on a 32-bit boundary, then ASSERT().\r
+ \r
@param Port The I/O port to read.\r
\r
@return The value read.\r
operations are serialized.\r
\r
If 32-bit I/O port operations are not supported, then ASSERT().\r
-\r
+ If Port is not aligned on a 32-bit boundary, then ASSERT().\r
+ \r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
operations are serialized.\r
\r
If 32-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 32-bit boundary, then ASSERT().\r
\r
@param Port The I/O port to write.\r
@param OrData The value to OR with the read value from the I/O port.\r
are serialized.\r
\r
If 32-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 32-bit boundary, then ASSERT().\r
\r
@param Port The I/O port to write.\r
@param AndData The value to AND with the read value from the I/O port.\r
I/O read and write operations are serialized.\r
\r
If 32-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 32-bit boundary, then ASSERT().\r
\r
@param Port The I/O port to write.\r
@param AndData The value to AND with the read value from the I/O port.\r
the StartBit and the EndBit. The value of the bit field is returned.\r
\r
If 32-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 32-bit boundary, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
left bits in Value are stripped.\r
\r
If 32-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 32-bit boundary, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
operations are serialized. Extra left bits in OrData are stripped.\r
\r
If 32-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 32-bit boundary, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
are serialized. Extra left bits in AndData are stripped.\r
\r
If 32-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 32-bit boundary, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
AndData and OrData are stripped.\r
\r
If 32-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 32-bit boundary, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
serialized.\r
\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 64-bit boundary, then ASSERT().\r
\r
@param Port The I/O port to read.\r
\r
operations are serialized.\r
\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 64-bit boundary, then ASSERT().\r
\r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
operations are serialized.\r
\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 64-bit boundary, then ASSERT().\r
\r
@param Port The I/O port to write.\r
@param OrData The value to OR with the read value from the I/O port.\r
are serialized.\r
\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 64-bit boundary, then ASSERT().\r
\r
@param Port The I/O port to write.\r
@param AndData The value to AND with the read value from the I/O port.\r
I/O read and write operations are serialized.\r
\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 64-bit boundary, then ASSERT().\r
\r
@param Port The I/O port to write.\r
@param AndData The value to AND with the read value from the I/O port.\r
the StartBit and the EndBit. The value of the bit field is returned.\r
\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 64-bit boundary, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
left bits in Value are stripped.\r
\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 64-bit boundary, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
operations are serialized. Extra left bits in OrData are stripped.\r
\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 64-bit boundary, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
are serialized. Extra left bits in AndData are stripped.\r
\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 64-bit boundary, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
AndData and OrData are stripped.\r
\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
+ If Port is not aligned on a 64-bit boundary, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
operations are serialized.\r
\r
If 16-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 16-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to read.\r
\r
and write operations are serialized.\r
\r
If 16-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 16-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
all MMIO read and write operations are serialized.\r
\r
If 16-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 16-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to write.\r
@param OrData The value to OR with the read value from the MMIO register.\r
read and write operations are serialized.\r
\r
If 16-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 16-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to write.\r
@param AndData The value to AND with the read value from the MMIO register.\r
must guarantee that all MMIO read and write operations are serialized.\r
\r
If 16-bit MMIO register operations are not supported, then ASSERT().\r
-\r
+ If Address is not aligned on a 16-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to write.\r
@param AndData The value to AND with the read value from the MMIO register.\r
the StartBit and the EndBit. The value of the bit field is returned.\r
\r
If 16-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 16-bit boundary, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
MMIO register are preserved. The new value of the 16-bit register is returned.\r
\r
If 16-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 16-bit boundary, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
are stripped.\r
\r
If 16-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 16-bit boundary, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
stripped.\r
\r
If 16-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 16-bit boundary, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
serialized. Extra left bits in both AndData and OrData are stripped.\r
\r
If 16-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 16-bit boundary, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
operations are serialized.\r
\r
If 32-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 32-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to read.\r
\r
and write operations are serialized.\r
\r
If 32-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 32-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
all MMIO read and write operations are serialized.\r
\r
If 32-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 32-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to write.\r
@param OrData The value to OR with the read value from the MMIO register.\r
read and write operations are serialized.\r
\r
If 32-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 32-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to write.\r
@param AndData The value to AND with the read value from the MMIO register.\r
must guarantee that all MMIO read and write operations are serialized.\r
\r
If 32-bit MMIO register operations are not supported, then ASSERT().\r
-\r
+ If Address is not aligned on a 32-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to write.\r
@param AndData The value to AND with the read value from the MMIO register.\r
the StartBit and the EndBit. The value of the bit field is returned.\r
\r
If 32-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 32-bit boundary, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
MMIO register are preserved. The new value of the 32-bit register is returned.\r
\r
If 32-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 32-bit boundary, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
are stripped.\r
\r
If 32-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 32-bit boundary, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
stripped.\r
\r
If 32-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 32-bit boundary, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
serialized. Extra left bits in both AndData and OrData are stripped.\r
\r
If 32-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 32-bit boundary, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
operations are serialized.\r
\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 64-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to read.\r
\r
and write operations are serialized.\r
\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 64-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
all MMIO read and write operations are serialized.\r
\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 64-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to write.\r
@param OrData The value to OR with the read value from the MMIO register.\r
read and write operations are serialized.\r
\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 64-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to write.\r
@param AndData The value to AND with the read value from the MMIO register.\r
must guarantee that all MMIO read and write operations are serialized.\r
\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
-\r
+ If Address is not aligned on a 64-bit boundary, then ASSERT().\r
\r
@param Address The MMIO register to write.\r
@param AndData The value to AND with the read value from the MMIO register.\r
the StartBit and the EndBit. The value of the bit field is returned.\r
\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 64-bit boundary, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
MMIO register are preserved. The new value of the 64-bit register is returned.\r
\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 64-bit boundary, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
are stripped.\r
\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 64-bit boundary, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
stripped.\r
\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 64-bit boundary, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
serialized. Extra left bits in both AndData and OrData are stripped.\r
\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
+ If Address is not aligned on a 64-bit boundary, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, then ASSERT().\r
If EndBit is less than StartBit, then ASSERT().\r
IN UINT64 OrData\r
);\r
\r
+/**\r
+ Copy data from MMIO region to system memory by using 8-bit access.\r
+\r
+ Copy data from MMIO region specified by starting address StartAddress \r
+ to system memory specified by Buffer by using 8-bit access. The total \r
+ number of byte to be copied is specified by Length. Buffer is returned.\r
+ \r
+ If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+\r
+ @param StartAddress Starting address for the MMIO region to be copied from.\r
+ @param Length The size, in bytes, of Buffer.\r
+ @param Buffer Pointer to a system memory buffer receiving the data read.\r
+\r
+ @return Buffer\r
+\r
+**/\r
+UINT8 *\r
+EFIAPI\r
+MmioReadBuffer8 (\r
+ IN UINTN StartAddress,\r
+ IN UINTN Length,\r
+ OUT UINT8 *Buffer\r
+ );\r
+\r
+/**\r
+ Copy data from MMIO region to system memory by using 16-bit access.\r
+\r
+ Copy data from MMIO region specified by starting address StartAddress \r
+ to system memory specified by Buffer by using 16-bit access. The total \r
+ number of byte to be copied is specified by Length. Buffer is returned.\r
+ \r
+ If StartAddress is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+ If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+ If Length is not aligned on a 16-bit boundary, then ASSERT().\r
+ If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+ @param StartAddress Starting address for the MMIO region to be copied from.\r
+ @param Length The size, in bytes, of Buffer.\r
+ @param Buffer Pointer to a system memory buffer receiving the data read.\r
+\r
+ @return Buffer\r
+\r
+**/\r
+UINT16 *\r
+EFIAPI\r
+MmioReadBuffer16 (\r
+ IN UINTN StartAddress,\r
+ IN UINTN Length,\r
+ OUT UINT16 *Buffer\r
+ );\r
+\r
+/**\r
+ Copy data from MMIO region to system memory by using 32-bit access.\r
+\r
+ Copy data from MMIO region specified by starting address StartAddress \r
+ to system memory specified by Buffer by using 32-bit access. The total \r
+ number of byte to be copied is specified by Length. Buffer is returned.\r
+ \r
+ If StartAddress is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
+ If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+ If Length is not aligned on a 32-bit boundary, then ASSERT().\r
+ If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
+ @param StartAddress Starting address for the MMIO region to be copied from.\r
+ @param Length The size, in bytes, of Buffer.\r
+ @param Buffer Pointer to a system memory buffer receiving the data read.\r
+\r
+ @return Buffer\r
+\r
+**/\r
+UINT32 *\r
+EFIAPI\r
+MmioReadBuffer32 (\r
+ IN UINTN StartAddress,\r
+ IN UINTN Length,\r
+ OUT UINT32 *Buffer\r
+ );\r
+\r
+/**\r
+ Copy data from MMIO region to system memory by using 64-bit access.\r
+\r
+ Copy data from MMIO region specified by starting address StartAddress \r
+ to system memory specified by Buffer by using 64-bit access. The total \r
+ number of byte to be copied is specified by Length. Buffer is returned.\r
+ \r
+ If StartAddress is not aligned on a 64-bit boundary, then ASSERT().\r
+\r
+ If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+ If Length is not aligned on a 64-bit boundary, then ASSERT().\r
+ If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+\r
+ @param StartAddress Starting address for the MMIO region to be copied from.\r
+ @param Length The size, in bytes, of Buffer.\r
+ @param Buffer Pointer to a system memory buffer receiving the data read.\r
+\r
+ @return Buffer\r
+\r
+**/\r
+UINT64 *\r
+EFIAPI\r
+MmioReadBuffer64 (\r
+ IN UINTN StartAddress,\r
+ IN UINTN Length,\r
+ OUT UINT64 *Buffer\r
+ );\r
+\r
+/**\r
+ Copy data from system memory to MMIO region by using 8-bit access.\r
+\r
+ Copy data from system memory specified by Buffer to MMIO region specified \r
+ by starting address StartAddress by using 8-bit access. The total number \r
+ of byte to be copied is specified by Length. Buffer is returned.\r
+ \r
+ If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().\r
+\r
+\r
+ @param StartAddress Starting address for the MMIO region to be copied to.\r
+ @param Length The size, in bytes, of Buffer.\r
+ @param Buffer Pointer to a system memory buffer containing the data to write.\r
+\r
+ @return Size in bytes of the copy.\r
+\r
+**/\r
+UINT8 *\r
+EFIAPI\r
+MmioWriteBuffer8 (\r
+ IN UINTN StartAddress,\r
+ IN UINTN Length,\r
+ IN CONST UINT8 *Buffer\r
+ );\r
+\r
+/**\r
+ Copy data from system memory to MMIO region by using 16-bit access.\r
+\r
+ Copy data from system memory specified by Buffer to MMIO region specified \r
+ by starting address StartAddress by using 16-bit access. The total number \r
+ of byte to be copied is specified by Length. Length is returned.\r
+ \r
+ If StartAddress is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+ If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().\r
+\r
+ If Length is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+ If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+ @param StartAddress Starting address for the MMIO region to be copied to.\r
+ @param Length The size, in bytes, of Buffer.\r
+ @param Buffer Pointer to a system memory buffer containing the data to write.\r
+\r
+ @return Size in bytes of the copy.\r
+\r
+**/\r
+UINT16 *\r
+EFIAPI\r
+MmioWriteBuffer16 (\r
+ IN UINTN StartAddress,\r
+ IN UINTN Length,\r
+ IN CONST UINT16 *Buffer\r
+ );\r
+\r
+/**\r
+ Copy data from system memory to MMIO region by using 32-bit access.\r
+\r
+ Copy data from system memory specified by Buffer to MMIO region specified \r
+ by starting address StartAddress by using 32-bit access. The total number \r
+ of byte to be copied is specified by Length. Length is returned.\r
+ \r
+ If StartAddress is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
+ If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().\r
+\r
+ If Length is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
+ If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
+ @param StartAddress Starting address for the MMIO region to be copied to.\r
+ @param Length The size, in bytes, of Buffer.\r
+ @param Buffer Pointer to a system memory buffer containing the data to write.\r
+\r
+ @return Size in bytes of the copy.\r
+\r
+**/\r
+UINT32 *\r
+EFIAPI\r
+MmioWriteBuffer32 (\r
+ IN UINTN StartAddress,\r
+ IN UINTN Length,\r
+ IN CONST UINT32 *Buffer\r
+ );\r
+\r
+/**\r
+ Copy data from system memory to MMIO region by using 64-bit access.\r
+\r
+ Copy data from system memory specified by Buffer to MMIO region specified \r
+ by starting address StartAddress by using 64-bit access. The total number \r
+ of byte to be copied is specified by Length. Length is returned.\r
+ \r
+ If StartAddress is not aligned on a 64-bit boundary, then ASSERT().\r
+\r
+ If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().\r
+\r
+ If Length is not aligned on a 64-bit boundary, then ASSERT().\r
+\r
+ If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+\r
+ @param StartAddress Starting address for the MMIO region to be copied to.\r
+ @param Length The size, in bytes, of Buffer.\r
+ @param Buffer Pointer to a system memory buffer containing the data to write.\r
+\r
+ @return Size in bytes of the copy.\r
+\r
+**/\r
+UINT64 *\r
+EFIAPI\r
+MmioWriteBuffer64 (\r
+ IN UINTN StartAddress,\r
+ IN UINTN Length,\r
+ IN CONST UINT64 *Buffer\r
+ );\r
+\r
+\r
#endif\r
+\r