X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFrameworkPkg%2FLibrary%2FDxeIoLibCpuIo%2FIoLibMmioBuffer.c;h=b4b9ad5d2f54739c3ead0b74c824598c14c102ca;hp=1a39f212884454ca4e3b7c081cf32081c5d81f80;hb=0677cc4925d580f7016ac092dc591be0ebe03495;hpb=694363f8f8a23920a0a21339ed2c59043b92de55 diff --git a/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLibMmioBuffer.c b/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLibMmioBuffer.c index 1a39f21288..b4b9ad5d2f 100644 --- a/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLibMmioBuffer.c +++ b/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLibMmioBuffer.c @@ -1,8 +1,8 @@ /** @file I/O Library MMIO Buffer Functions. - Copyright (c) 2007, Intel Corporation
- All rights reserved. This program and the accompanying materials + Copyright (c) 2007, Intel Corporation. All rights reserved.
+ 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 http://opensource.org/licenses/bsd-license.php @@ -10,6 +10,8 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Module Name: IoLibMmioBuffer.c + **/ @@ -48,7 +50,7 @@ MmioReadBuffer8 ( ReturnBuffer = Buffer; - while (Length--) { + while (Length-- > 0) { *(Buffer++) = MmioRead8 (StartAddress++); } @@ -68,6 +70,7 @@ MmioReadBuffer8 ( 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 Starting address for the MMIO region to be copied from. @@ -97,7 +100,7 @@ MmioReadBuffer16 ( ReturnBuffer = Buffer; - while (Length) { + while (Length > 0) { *(Buffer++) = MmioRead16 (StartAddress); StartAddress += sizeof (UINT16); Length -= sizeof (UINT16); @@ -148,7 +151,7 @@ MmioReadBuffer32 ( ReturnBuffer = Buffer; - while (Length) { + while (Length > 0) { *(Buffer++) = MmioRead32 (StartAddress); StartAddress += sizeof (UINT32); Length -= sizeof (UINT32); @@ -170,6 +173,7 @@ MmioReadBuffer32 ( 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 Starting address for the MMIO region to be copied from. @@ -199,7 +203,7 @@ MmioReadBuffer64 ( ReturnBuffer = Buffer; - while (Length) { + while (Length > 0) { *(Buffer++) = MmioRead64 (StartAddress); StartAddress += sizeof (UINT64); Length -= sizeof (UINT64); @@ -224,7 +228,7 @@ MmioReadBuffer64 ( @param Length Size in bytes of the copy. @param Buffer Pointer to a system memory buffer containing the data to write. - @return Size in bytes of the copy. + @return Buffer **/ UINT8 * @@ -242,7 +246,7 @@ MmioWriteBuffer8 ( ReturnBuffer = (UINT8 *) Buffer; - while (Length--) { + while (Length-- > 0) { MmioWrite8 (StartAddress++, *(Buffer++)); } @@ -255,7 +259,7 @@ MmioWriteBuffer8 ( Copy data from system memory specified by Buffer to MMIO region specified by starting address StartAddress by using 16-bit access. The total number - of byte to be copied is specified by Length. Length is returned. + of byte to be copied is specified by Length. Buffer is returned. If StartAddress is not aligned on a 16-bit boundary, then ASSERT(). @@ -270,7 +274,7 @@ MmioWriteBuffer8 ( @param Length Size in bytes of the copy. @param Buffer Pointer to a system memory buffer containing the data to write. - @return Size in bytes of the copy. + @return Buffer **/ UINT16 * @@ -293,7 +297,7 @@ MmioWriteBuffer16 ( ReturnBuffer = (UINT16 *) Buffer; - while (Length) { + while (Length > 0) { MmioWrite16 (StartAddress, *(Buffer++)); StartAddress += sizeof (UINT16); @@ -309,7 +313,7 @@ MmioWriteBuffer16 ( Copy data from system memory specified by Buffer to MMIO region specified by starting address StartAddress by using 32-bit access. The total number - of byte to be copied is specified by Length. Length is returned. + of byte to be copied is specified by Length. Buffer is returned. If StartAddress is not aligned on a 32-bit boundary, then ASSERT(). @@ -324,7 +328,7 @@ MmioWriteBuffer16 ( @param Length Size in bytes of the copy. @param Buffer Pointer to a system memory buffer containing the data to write. - @return Size in bytes of the copy. + @return Buffer **/ UINT32 * @@ -347,7 +351,7 @@ MmioWriteBuffer32 ( ReturnBuffer = (UINT32 *) Buffer; - while (Length) { + while (Length > 0) { MmioWrite32 (StartAddress, *(Buffer++)); StartAddress += sizeof (UINT32); @@ -362,7 +366,7 @@ MmioWriteBuffer32 ( Copy data from system memory specified by Buffer to MMIO region specified by starting address StartAddress by using 64-bit access. The total number - of byte to be copied is specified by Length. Length is returned. + of byte to be copied is specified by Length. Buffer is returned. If StartAddress is not aligned on a 64-bit boundary, then ASSERT(). @@ -377,7 +381,7 @@ MmioWriteBuffer32 ( @param Length Size in bytes of the copy. @param Buffer Pointer to a system memory buffer containing the data to write. - @return Size in bytes of the copy. + @return Buffer **/ UINT64 * @@ -400,7 +404,7 @@ MmioWriteBuffer64 ( ReturnBuffer = (UINT64 *) Buffer; - while (Length) { + while (Length > 0) { MmioWrite64 (StartAddress, *(Buffer++)); StartAddress += sizeof (UINT64);