]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/CheckSum.c
MdePkg BaseLib: Convert Ia32/ReadLdtr.asm to NASM
[mirror_edk2.git] / MdePkg / Library / BaseLib / CheckSum.c
index 7fad548aa98a2895065ef6cfd46728437bbb20d3..29688291bb2bac16aefff9b3112bc06048f9fe9a 100644 (file)
@@ -2,11 +2,11 @@
   Utility functions to generate checksum based on 2's complement\r
   algorithm.\r
 \r
-  Copyright (c) 2007 - 2008, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
+  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  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
+  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
@@ -27,7 +27,7 @@
   If Buffer is NULL, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
-  @param  Buffer      Pointer to the buffer to carry out the sum operation.\r
+  @param  Buffer      The pointer to the buffer to carry out the sum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
   @return Sum         The sum of Buffer with carry bits dropped during additions.\r
@@ -36,8 +36,8 @@
 UINT8\r
 EFIAPI\r
 CalculateSum8 (\r
-  IN      CONST UINT8        *Buffer,\r
-  IN      UINTN              Length\r
+  IN      CONST UINT8              *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT8     Sum;\r
@@ -66,7 +66,7 @@ CalculateSum8 (
   If Buffer is NULL, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
-  @param  Buffer      Pointer to the buffer to carry out the checksum operation.\r
+  @param  Buffer      The pointer to the buffer to carry out the checksum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
   @return Checksum    The 2's complement checksum of Buffer.\r
@@ -75,8 +75,8 @@ CalculateSum8 (
 UINT8\r
 EFIAPI\r
 CalculateCheckSum8 (\r
-  IN      CONST UINT8        *Buffer,\r
-  IN      UINTN              Length\r
+  IN      CONST UINT8              *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT8     CheckSum;\r
@@ -102,7 +102,7 @@ CalculateCheckSum8 (
   If Length is not aligned on a 16-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
-  @param  Buffer      Pointer to the buffer to carry out the sum operation.\r
+  @param  Buffer      The pointer to the buffer to carry out the sum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
   @return Sum         The sum of Buffer with carry bits dropped during additions.\r
@@ -111,8 +111,8 @@ CalculateCheckSum8 (
 UINT16\r
 EFIAPI\r
 CalculateSum16 (\r
-  IN      CONST UINT16       *Buffer,\r
-  IN      UINTN              Length\r
+  IN      CONST UINT16             *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT16    Sum;\r
@@ -147,7 +147,7 @@ CalculateSum16 (
   If Length is not aligned on a 16-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
-  @param  Buffer      Pointer to the buffer to carry out the checksum operation.\r
+  @param  Buffer      The pointer to the buffer to carry out the checksum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
   @return Checksum    The 2's complement checksum of Buffer.\r
@@ -156,8 +156,8 @@ CalculateSum16 (
 UINT16\r
 EFIAPI\r
 CalculateCheckSum16 (\r
-  IN      CONST UINT16         *Buffer,\r
-  IN      UINTN                Length\r
+  IN      CONST UINT16             *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT16     CheckSum;\r
@@ -184,7 +184,7 @@ CalculateCheckSum16 (
   If Length is not aligned on a 32-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
-  @param  Buffer      Pointer to the buffer to carry out the sum operation.\r
+  @param  Buffer      The pointer to the buffer to carry out the sum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
   @return Sum         The sum of Buffer with carry bits dropped during additions.\r
@@ -193,8 +193,8 @@ CalculateCheckSum16 (
 UINT32\r
 EFIAPI\r
 CalculateSum32 (\r
-  IN      CONST UINT32         *Buffer,\r
-  IN      UINTN                Length\r
+  IN      CONST UINT32             *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT32    Sum;\r
@@ -229,7 +229,7 @@ CalculateSum32 (
   If Length is not aligned on a 32-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
-  @param  Buffer      Pointer to the buffer to carry out the checksum operation.\r
+  @param  Buffer      The pointer to the buffer to carry out the checksum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
   @return Checksum    The 2's complement checksum of Buffer.\r
@@ -238,8 +238,8 @@ CalculateSum32 (
 UINT32\r
 EFIAPI\r
 CalculateCheckSum32 (\r
-  IN      CONST UINT32         *Buffer,\r
-  IN      UINTN                Length\r
+  IN      CONST UINT32             *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT32     CheckSum;\r
@@ -266,7 +266,7 @@ CalculateCheckSum32 (
   If Length is not aligned on a 64-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
-  @param  Buffer      Pointer to the buffer to carry out the sum operation.\r
+  @param  Buffer      The pointer to the buffer to carry out the sum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
   @return Sum         The sum of Buffer with carry bits dropped during additions.\r
@@ -275,8 +275,8 @@ CalculateCheckSum32 (
 UINT64\r
 EFIAPI\r
 CalculateSum64 (\r
-  IN      CONST UINT64         *Buffer,\r
-  IN      UINTN                Length\r
+  IN      CONST UINT64             *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT64    Sum;\r
@@ -311,7 +311,7 @@ CalculateSum64 (
   If Length is not aligned on a 64-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
-  @param  Buffer      Pointer to the buffer to carry out the checksum operation.\r
+  @param  Buffer      The pointer to the buffer to carry out the checksum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
   @return Checksum    The 2's complement checksum of Buffer.\r
@@ -320,8 +320,8 @@ CalculateSum64 (
 UINT64\r
 EFIAPI\r
 CalculateCheckSum64 (\r
-  IN      CONST UINT64         *Buffer,\r
-  IN      UINTN                Length\r
+  IN      CONST UINT64             *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT64     CheckSum;\r