Functions | |
UINT8 EFIAPI | CalculateSum8 (IN CONST UINT8 *Buffer, IN UINTN Length) |
UINT8 EFIAPI | CalculateCheckSum8 (IN CONST UINT8 *Buffer, IN UINTN Length) |
UINT16 EFIAPI | CalculateSum16 (IN CONST UINT16 *Buffer, IN UINTN Length) |
UINT16 EFIAPI | CalculateCheckSum16 (IN CONST UINT16 *Buffer, IN UINTN Length) |
UINT32 EFIAPI | CalculateSum32 (IN CONST UINT32 *Buffer, IN UINTN Length) |
UINT32 EFIAPI | CalculateCheckSum32 (IN CONST UINT32 *Buffer, IN UINTN Length) |
UINT64 EFIAPI | CalculateSum64 (IN CONST UINT64 *Buffer, IN UINTN Length) |
UINT64 EFIAPI | CalculateCheckSum64 (IN CONST UINT64 *Buffer, IN UINTN Length) |
Copyright (c) 2007 - 2010, 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.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Returns the two's complement checksum of all elements in a buffer of 16-bit values.
This function first calculates the sum of the 16-bit values in the buffer specified by Buffer and Length. The carry bits in the result of addition are dropped. Then, the two's complement of the sum is returned. If Length is 0, then 0 is returned.
If Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 16-bit boundary, then ASSERT(). If Length is not aligned on a 16-bit boundary, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
Buffer | The pointer to the buffer to carry out the checksum operation. | |
Length | The size, in bytes, of Buffer. |
References CalculateSum16().
Returns the two's complement checksum of all elements in a buffer of 32-bit values.
This function first calculates the sum of the 32-bit values in the buffer specified by Buffer and Length. The carry bits in the result of addition are dropped. Then, the two's complement of the sum is returned. If Length is 0, then 0 is returned.
If Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 32-bit boundary, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
Buffer | The pointer to the buffer to carry out the checksum operation. | |
Length | The size, in bytes, of Buffer. |
References CalculateSum32().
Returns the two's complement checksum of all elements in a buffer of 64-bit values.
This function first calculates the sum of the 64-bit values in the buffer specified by Buffer and Length. The carry bits in the result of addition are dropped. Then, the two's complement of the sum is returned. If Length is 0, then 0 is returned.
If Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). If Length is not aligned on a 64-bit boundary, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
Buffer | The pointer to the buffer to carry out the checksum operation. | |
Length | The size, in bytes, of Buffer. |
References CalculateSum64().
Returns the two's complement checksum of all elements in a buffer of 8-bit values.
This function first calculates the sum of the 8-bit values in the buffer specified by Buffer and Length. The carry bits in the result of addition are dropped. Then, the two's complement of the sum is returned. If Length is 0, then 0 is returned.
If Buffer is NULL, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
Buffer | The pointer to the buffer to carry out the checksum operation. | |
Length | The size, in bytes, of Buffer. |
References CalculateSum8().
Returns the sum of all elements in a buffer of 16-bit values. During calculation, the carry bits are dropped.
This function calculates the sum of the 16-bit values in the buffer specified by Buffer and Length. The carry bits in result of addition are dropped. The 16-bit result is returned. If Length is 0, then 0 is returned.
If Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 16-bit boundary, then ASSERT(). If Length is not aligned on a 16-bit boundary, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
Buffer | The pointer to the buffer to carry out the sum operation. | |
Length | The size, in bytes, of Buffer. |
References ASSERT, MAX_ADDRESS, and NULL.
Referenced by CalculateCheckSum16().
Returns the sum of all elements in a buffer of 32-bit values. During calculation, the carry bits are dropped.
This function calculates the sum of the 32-bit values in the buffer specified by Buffer and Length. The carry bits in result of addition are dropped. The 32-bit result is returned. If Length is 0, then 0 is returned.
If Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 32-bit boundary, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
Buffer | The pointer to the buffer to carry out the sum operation. | |
Length | The size, in bytes, of Buffer. |
References ASSERT, MAX_ADDRESS, and NULL.
Referenced by CalculateCheckSum32().
Returns the sum of all elements in a buffer of 64-bit values. During calculation, the carry bits are dropped.
This function calculates the sum of the 64-bit values in the buffer specified by Buffer and Length. The carry bits in result of addition are dropped. The 64-bit result is returned. If Length is 0, then 0 is returned.
If Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). If Length is not aligned on a 64-bit boundary, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
Buffer | The pointer to the buffer to carry out the sum operation. | |
Length | The size, in bytes, of Buffer. |
References ASSERT, MAX_ADDRESS, and NULL.
Referenced by CalculateCheckSum64().
Returns the sum of all elements in a buffer in unit of UINT8. During calculation, the carry bits are dropped.
This function calculates the sum of all elements in a buffer in unit of UINT8. The carry bits in result of addition are dropped. The result is returned as UINT8. If Length is Zero, then Zero is returned.
If Buffer is NULL, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
Buffer | The pointer to the buffer to carry out the sum operation. | |
Length | The size, in bytes, of Buffer. |
References ASSERT, MAX_ADDRESS, and NULL.
Referenced by CalculateCheckSum8().