Fills a target buffer with a byte value, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with Value, and returns Buffer.\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Memory to set.\r
@param Length Number of bytes to set.\r
\r
This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to fill with zeros.\r
@param Length Number of bytes in Buffer to fill with zeros.\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 128-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there\r
is not enough memory remaining to satisfy the request, then NULL is returned.\r
If Buffer is NULL, then ASSERT().\r
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param AllocationSize The number of bytes to allocate and zero.\r
@param Buffer The buffer to copy to the allocated buffer.\r
allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there\r
is not enough memory remaining to satisfy the request, then NULL is returned.\r
If Buffer is NULL, then ASSERT().\r
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param AllocationSize The number of bytes to allocate and zero.\r
@param Buffer The buffer to copy to the allocated buffer.\r
allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there\r
is not enough memory remaining to satisfy the request, then NULL is returned.\r
If Buffer is NULL, then ASSERT().\r
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param AllocationSize The number of bytes to allocate and zero.\r
@param Buffer The buffer to copy to the allocated buffer.\r
\r
If Buffer is NULL, then ASSERT().\r
\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.\r
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
\r
If Buffer is NULL, then ASSERT().\r
\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to be filled with PcdDebugClearMemoryValue.\r
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
IN UINTN Length\r
)\r
{\r
- if (0 == Length) {\r
+ if (Length == 0 || DestinationBuffer == SourceBuffer) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 128-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
Fills a target buffer with a byte value, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with Value, and returns Buffer.\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Memory to set.\r
@param Length Number of bytes to set.\r
\r
This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to fill with zeros.\r
@param Length Number of bytes in Buffer to fill with zeros.\r
IN UINTN Length\r
)\r
{\r
- if (0 == Length) {\r
+ if (Length == 0 || DestinationBuffer == SourceBuffer) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 128-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
Fills a target buffer with a byte value, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with Value, and returns Buffer.\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Memory to set.\r
@param Length Number of bytes to set.\r
\r
This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to fill with zeros.\r
@param Length Number of bytes in Buffer to fill with zeros.\r
IN UINTN Length\r
)\r
{\r
- if (0 == Length) {\r
+ if (Length == 0 || DestinationBuffer == SourceBuffer) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 128-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
Fills a target buffer with a byte value, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with Value, and returns Buffer.\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Memory to set.\r
@param Length Number of bytes to set.\r
\r
This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to fill with zeros.\r
@param Length Number of bytes in Buffer to fill with zeros.\r
IN UINTN Length\r
)\r
{\r
- if (0 == Length) {\r
+ if (Length == 0 || DestinationBuffer == SourceBuffer) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 128-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
Fills a target buffer with a byte value, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with Value, and returns Buffer.\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Memory to set.\r
@param Length Number of bytes to set.\r
\r
This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to fill with zeros.\r
@param Length Number of bytes in Buffer to fill with zeros.\r
IN UINTN Length\r
)\r
{\r
- if (0 == Length) {\r
+ if (Length == 0 || DestinationBuffer == SourceBuffer) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 128-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
Fills a target buffer with a byte value, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with Value, and returns Buffer.\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Memory to set.\r
@param Length Number of bytes to set.\r
\r
This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to fill with zeros.\r
@param Length Number of bytes in Buffer to fill with zeros.\r
IN UINTN Length\r
)\r
{\r
- if (0 == Length) {\r
+ if (Length == 0 || DestinationBuffer == SourceBuffer) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 128-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
Fills a target buffer with a byte value, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with Value, and returns Buffer.\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Memory to set.\r
@param Length Number of bytes to set.\r
\r
This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to fill with zeros.\r
@param Length Number of bytes in Buffer to fill with zeros.\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (Length == 0 || DestinationBuffer == SourceBuffer) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
/** @file\r
- Base Memory Library.\r
+ Base Memory Library functions implementation bases on Uefi Boot Service.\r
\r
- Copyright (c) 2006, Intel Corporation<BR>\r
+ Copyright (c) 2006 - 2008, 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
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 128-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
Fills a target buffer with a byte value, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with Value, and returns Buffer.\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Memory to set.\r
@param Length Number of bytes to set.\r
\r
This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to fill with zeros.\r
@param Length Number of bytes in Buffer to fill with zeros.\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (Length == 0 || DestinationBuffer == SourceBuffer) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
/** @file\r
- Base Memory Library.\r
+ Base Memory Library functions implementation bases on PeiServcie.\r
\r
- Copyright (c) 2006, Intel Corporation<BR>\r
+ Copyright (c) 2006 - 2008, 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
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 128-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
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
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
Fills a target buffer with a byte value, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with Value, and returns Buffer.\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Memory to set.\r
@param Length Number of bytes to set.\r
\r
This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to fill with zeros.\r
@param Length Number of bytes in Buffer to fill with zeros.\r
\r
If Buffer is NULL, then ASSERT().\r
\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to be filled with PcdDebugClearMemoryValue.\r
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
\r
If Buffer is NULL, then ASSERT().\r
\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
\r
@param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.\r
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r