]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLibMmioBuffer.c
IntelFrameworkPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFrameworkPkg / Library / DxeIoLibCpuIo / IoLibMmioBuffer.c
index d3f745c6a1e57df5cab6d40d805a8fe53f4d9c66..a42a1d058888d8c4c8316af01b779808a13a4503 100644 (file)
@@ -1,17 +1,14 @@
 /** @file\r
   I/O Library MMIO Buffer Functions.\r
 \r
-  Copyright (c) 2007, Intel Corporation<BR>\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) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\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
+  Module Name:  IoLibMmioBuffer.c\r
 \r
 **/\r
 \r
+\r
 #include "DxeCpuIoLibInternal.h"\r
 \r
 /**\r
@@ -47,7 +44,7 @@ MmioReadBuffer8 (
 \r
   ReturnBuffer = Buffer;\r
 \r
-  while (Length--) {\r
+  while (Length-- > 0) {\r
     *(Buffer++) = MmioRead8 (StartAddress++);\r
   }\r
 \r
@@ -67,6 +64,7 @@ MmioReadBuffer8 (
   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 from.\r
@@ -96,7 +94,7 @@ MmioReadBuffer16 (
 \r
   ReturnBuffer = Buffer;\r
 \r
-  while (Length) {\r
+  while (Length > 0) {\r
     *(Buffer++) = MmioRead16 (StartAddress);\r
     StartAddress += sizeof (UINT16);\r
     Length -= sizeof (UINT16);\r
@@ -147,7 +145,7 @@ MmioReadBuffer32 (
 \r
   ReturnBuffer = Buffer;\r
 \r
-  while (Length) {\r
+  while (Length > 0) {\r
     *(Buffer++) = MmioRead32 (StartAddress);\r
     StartAddress += sizeof (UINT32);\r
     Length -= sizeof (UINT32);\r
@@ -169,6 +167,7 @@ MmioReadBuffer32 (
   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 from.\r
@@ -198,7 +197,7 @@ MmioReadBuffer64 (
 \r
   ReturnBuffer = Buffer;\r
 \r
-  while (Length) {\r
+  while (Length > 0) {\r
     *(Buffer++) = MmioRead64 (StartAddress);\r
     StartAddress += sizeof (UINT64);\r
     Length -= sizeof (UINT64);\r
@@ -223,7 +222,7 @@ MmioReadBuffer64 (
   @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 Buffer\r
 \r
 **/\r
 UINT8 *\r
@@ -241,7 +240,7 @@ MmioWriteBuffer8 (
 \r
   ReturnBuffer = (UINT8 *) Buffer;\r
 \r
-  while (Length--) {\r
+  while (Length-- > 0) {\r
      MmioWrite8 (StartAddress++, *(Buffer++));\r
   }\r
 \r
@@ -254,7 +253,7 @@ MmioWriteBuffer8 (
 \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
+  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
@@ -269,7 +268,7 @@ MmioWriteBuffer8 (
   @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 Buffer\r
 \r
 **/\r
 UINT16 *\r
@@ -292,7 +291,7 @@ MmioWriteBuffer16 (
 \r
   ReturnBuffer = (UINT16 *) Buffer;\r
 \r
-  while (Length) {\r
+  while (Length > 0) {\r
     MmioWrite16 (StartAddress, *(Buffer++));\r
 \r
     StartAddress += sizeof (UINT16);\r
@@ -308,7 +307,7 @@ MmioWriteBuffer16 (
 \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
+  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
@@ -323,7 +322,7 @@ MmioWriteBuffer16 (
   @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 Buffer\r
 \r
 **/\r
 UINT32 *\r
@@ -346,7 +345,7 @@ MmioWriteBuffer32 (
 \r
   ReturnBuffer = (UINT32 *) Buffer;\r
 \r
-  while (Length) {\r
+  while (Length > 0) {\r
     MmioWrite32 (StartAddress, *(Buffer++));\r
 \r
     StartAddress += sizeof (UINT32);\r
@@ -361,7 +360,7 @@ MmioWriteBuffer32 (
 \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
+  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
@@ -376,7 +375,7 @@ MmioWriteBuffer32 (
   @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 Buffer\r
 \r
 **/\r
 UINT64 *\r
@@ -399,7 +398,7 @@ MmioWriteBuffer64 (
 \r
   ReturnBuffer = (UINT64 *) Buffer;\r
 \r
-  while (Length) {\r
+  while (Length > 0) {\r
     MmioWrite64 (StartAddress, *(Buffer++));\r
 \r
     StartAddress += sizeof (UINT64);\r