/** @file
I/O Library MMIO Buffer Functions.
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "BaseIoLibIntrinsicInternal.h"
/**
Copy data from the MMIO region to system memory by using 8-bit access.
Copy data from the MMIO region specified by starting address StartAddress
to system memory specified by Buffer by using 8-bit access. The total
number of byte to be copied is specified by Length. Buffer is returned.
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param StartAddress The starting address for the MMIO region to be copied from.
@param Length The size, in bytes, of Buffer.
@param Buffer The pointer to a system memory buffer receiving the data read.
@return Buffer
**/
UINT8 *
)
{
while (Length-- != 0) {
}
return ReturnBuffer;
}
/**
Copy data from the MMIO region to system memory by using 16-bit access.
Copy data from the MMIO region specified by starting address StartAddress
to system memory specified by Buffer by using 16-bit access. The total
number of byte to be copied is specified by Length. Buffer is returned.
If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Length is not aligned on a 16-bit boundary, then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
@param StartAddress The starting address for the MMIO region to be copied from.
@param Length The size, in bytes, of Buffer.
@param Buffer The pointer to a system memory buffer receiving the data read.
@return Buffer
**/
UINT16 *
)
{
while (Length != 0) {
StartAddress += sizeof (UINT16);
}
return ReturnBuffer;
}
/**
Copy data from the MMIO region to system memory by using 32-bit access.
Copy data from the MMIO region specified by starting address StartAddress
to system memory specified by Buffer by using 32-bit access. The total
number of byte to be copied is specified by Length. Buffer is returned.
If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Length is not aligned on a 32-bit boundary, then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
@param StartAddress The starting address for the MMIO region to be copied from.
@param Length The size, in bytes, of Buffer.
@param Buffer The pointer to a system memory buffer receiving the data read.
@return Buffer
**/
UINT32 *
)
{
while (Length != 0) {
StartAddress += sizeof (UINT32);
}
return ReturnBuffer;
}
/**
Copy data from the MMIO region to system memory by using 64-bit access.
Copy data from the MMIO region specified by starting address StartAddress
to system memory specified by Buffer by using 64-bit access. The total
number of byte to be copied is specified by Length. Buffer is returned.
If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Length is not aligned on a 64-bit boundary, then ASSERT().
If Buffer is not aligned on a 64-bit boundary, then ASSERT().
@param StartAddress The starting address for the MMIO region to be copied from.
@param Length The size, in bytes, of Buffer.
@param Buffer The pointer to a system memory buffer receiving the data read.
@return Buffer
**/
UINT64 *
)
{
while (Length != 0) {
StartAddress += sizeof (UINT64);
}
return ReturnBuffer;
}
/**
Copy data from system memory to the MMIO region by using 8-bit access.
Copy data from system memory specified by Buffer to the MMIO region specified
by starting address StartAddress by using 8-bit access. The total number
of byte to be copied is specified by Length. Buffer is returned.
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
@param StartAddress The starting address for the MMIO region to be copied to.
@param Length The size, in bytes, of Buffer.
@param Buffer The pointer to a system memory buffer containing the data to write.
@return Buffer
**/
UINT8 *
)
{
while (Length-- != 0) {
}
return ReturnBuffer;
}
/**
Copy data from system memory to the MMIO region by using 16-bit access.
Copy data from system memory specified by Buffer to the MMIO region specified
by starting address StartAddress by using 16-bit access. The total number
of byte to be copied is specified by Length. Buffer is returned.
If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
If Length is not aligned on a 16-bit boundary, then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
@param StartAddress The starting address for the MMIO region to be copied to.
@param Length The size, in bytes, of Buffer.
@param Buffer The pointer to a system memory buffer containing the data to write.
@return Buffer
**/
UINT16 *
)
{
while (Length != 0) {
StartAddress += sizeof (UINT16);
}
return ReturnBuffer;
}
/**
Copy data from system memory to the MMIO region by using 32-bit access.
Copy data from system memory specified by Buffer to the MMIO region specified
by starting address StartAddress by using 32-bit access. The total number
of byte to be copied is specified by Length. Buffer is returned.
If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
If Length is not aligned on a 32-bit boundary, then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
@param StartAddress The starting address for the MMIO region to be copied to.
@param Length The size, in bytes, of Buffer.
@param Buffer The pointer to a system memory buffer containing the data to write.
@return Buffer
**/
UINT32 *
)
{
while (Length != 0) {
StartAddress += sizeof (UINT32);
}
return ReturnBuffer;
}
/**
Copy data from system memory to the MMIO region by using 64-bit access.
Copy data from system memory specified by Buffer to the MMIO region specified
by starting address StartAddress by using 64-bit access. The total number
of byte to be copied is specified by Length. Buffer is returned.
If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
If Length is not aligned on a 64-bit boundary, then ASSERT().
If Buffer is not aligned on a 64-bit boundary, then ASSERT().
@param StartAddress The starting address for the MMIO region to be copied to.
@param Length The size, in bytes, of Buffer.
@param Buffer The pointer to a system memory buffer containing the data to write.
@return Buffer
**/
UINT64 *
)
{
while (Length != 0) {
StartAddress += sizeof (UINT64);
}
return ReturnBuffer;
}