X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseMemoryLibSse2%2FScanMem64Wrapper.c;h=dd1a82fef28a7ea2a45d0524ba19861731c6b76c;hb=43fcd99927a25327414ee0dfa7db73ae53df1a88;hp=228c864b04e69f8f9299868c2cb695f5c4dc9319;hpb=4ba61e5e2a1b3cec7faaad36c252738f6f57f8a6;p=mirror_edk2.git diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c index 228c864b04..dd1a82fef2 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c @@ -19,10 +19,15 @@ BaseMemoryLibSse2 BaseMemoryLibRepStr PeiMemoryLib - UefiMemoryLib + DxeMemoryLib **/ +// +// Include common header file for this module. +// +#include "CommonHeader.h" + #include "MemLibInternals.h" /** @@ -35,7 +40,8 @@ then NULL is returned. If Length is 0, then NULL is returned. If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), 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(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. @@ -47,9 +53,9 @@ VOID * EFIAPI ScanMem64 ( - IN CONST VOID *Buffer, - IN UINTN Length, - IN UINT64 Value + IN CONST VOID *Buffer, + IN UINTN Length, + IN UINT64 Value ) { if (Length == 0) { @@ -59,6 +65,7 @@ ScanMem64 ( ASSERT (Buffer != NULL); ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); + ASSERT ((Length & (sizeof (Value) - 1)) == 0); return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value); }