diff options
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c')
-rw-r--r-- | MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c index 6b0beee632..b54d5da07c 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.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 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().
@param Buffer Pointer to the target buffer to scan.
@@ -52,16 +53,14 @@ ScanMem32 ( IN UINT32 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*)InternalMemScanMem32 (Buffer, Stride, Value);
+ return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
}
|