summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c')
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c
index 589d45c1a1..7bfc7d721e 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
@@ -35,6 +35,7 @@
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 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.
@@ -52,16 +53,14 @@ ScanMem64 (
IN UINT64 Value
)
{
- UINTN Stride;
-
- Stride = Length / sizeof (Value);
- if (Stride == 0) {
+ if (Length == 0) {
return NULL;
}
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, Stride, Value);
+ return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
}