/** @file\r
I/O Library MMIO Buffer Functions.\r
+ The implementations are based on EFI_PEI_SERVICE->CpuIo interface.\r
\r
Copyright (c) 2007, Intel Corporation<BR>\r
All rights reserved. This program and the accompanying materials\r
\r
**/\r
\r
-//\r
-// The package level header files this module uses\r
-//\r
+\r
#include <PiPei.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
+\r
#include <Library/IoLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/BaseLib.h>\r
@param Length Size in bytes of the copy.\r
@param Buffer Pointer to a system memory buffer receiving the data read.\r
\r
- @return Buffer\r
+ @return Pointer to a system memory buffer receiving the data read.\r
\r
**/\r
UINT8 *\r
\r
ReturnBuffer = Buffer;\r
\r
- while (Length--) {\r
+ while (Length-- != 0) {\r
*(Buffer++) = MmioRead8 (StartAddress++);\r
}\r
\r
@param Length Size in bytes of the copy.\r
@param Buffer Pointer to a system memory buffer receiving the data read.\r
\r
- @return Buffer\r
+ @return Pointer to a system memory buffer receiving the data read.\r
\r
**/\r
UINT16 *\r
\r
ReturnBuffer = Buffer;\r
\r
- while (Length) {\r
+ while (Length != 0) {\r
*(Buffer++) = MmioRead16 (StartAddress);\r
StartAddress += sizeof (UINT16);\r
Length -= sizeof (UINT16);\r
@param Length Size in bytes of the copy.\r
@param Buffer Pointer to a system memory buffer receiving the data read.\r
\r
- @return Buffer\r
+ @return Pointer to a system memory buffer receiving the data read.\r
\r
**/\r
UINT32 *\r
\r
ReturnBuffer = Buffer;\r
\r
- while (Length) {\r
+ while (Length != 0) {\r
*(Buffer++) = MmioRead32 (StartAddress);\r
StartAddress += sizeof (UINT32);\r
Length -= sizeof (UINT32);\r
@param Length Size in bytes of the copy.\r
@param Buffer Pointer to a system memory buffer receiving the data read.\r
\r
- @return Buffer\r
+ @return Pointer to a system memory buffer receiving the data read.\r
\r
**/\r
UINT64 *\r
\r
ReturnBuffer = Buffer;\r
\r
- while (Length) {\r
+ while (Length != 0) {\r
*(Buffer++) = MmioRead64 (StartAddress);\r
StartAddress += sizeof (UINT64);\r
Length -= sizeof (UINT64);\r
\r
\r
@param StartAddress Starting address for the MMIO region to be copied to.\r
- @param Length Size in bytes of the copy.\r
+ @param Length Size in bytes of the copy.\r
@param Buffer Pointer to a system memory buffer containing the data to write.\r
\r
- @return Size in bytes of the copy.\r
+ @return Pointer to a system memory buffer containing the data to write.\r
\r
**/\r
UINT8 *\r
\r
ReturnBuffer = (UINT8 *) Buffer;\r
\r
- while (Length--) {\r
+ while (Length-- != 0) {\r
MmioWrite8 (StartAddress++, *(Buffer++));\r
}\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 Size in bytes of the copy.\r
+ @param Length Size in bytes of the copy.\r
@param Buffer Pointer to a system memory buffer containing the data to write.\r
\r
- @return Size in bytes of the copy.\r
+ @return Pointer to a system memory buffer containing the data to write.\r
\r
**/\r
UINT16 *\r
\r
ReturnBuffer = (UINT16 *) Buffer;\r
\r
- while (Length) {\r
+ while (Length != 0) {\r
MmioWrite16 (StartAddress, *(Buffer++));\r
\r
StartAddress += sizeof (UINT16);\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 Size in bytes of the copy.\r
+ @param Length Size in bytes of the copy.\r
@param Buffer Pointer to a system memory buffer containing the data to write.\r
\r
- @return Size in bytes of the copy.\r
+ @return Pointer to a system memory buffer containing the data to write.\r
\r
**/\r
UINT32 *\r
\r
ReturnBuffer = (UINT32 *) Buffer;\r
\r
- while (Length) {\r
+ while (Length != 0) {\r
MmioWrite32 (StartAddress, *(Buffer++));\r
\r
StartAddress += sizeof (UINT32);\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 Size in bytes of the copy.\r
+ @param Length Size in bytes of the copy.\r
@param Buffer Pointer to a system memory buffer containing the data to write.\r
\r
- @return Size in bytes of the copy.\r
+ @return Pointer to a system memory buffer containing the data to write.\r
\r
**/\r
UINT64 *\r
\r
ReturnBuffer = (UINT64 *) Buffer;\r
\r
- while (Length) {\r
+ while (Length != 0) {\r
MmioWrite64 (StartAddress, *(Buffer++));\r
\r
StartAddress += sizeof (UINT64);\r