summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLibMmx
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibMmx')
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c2
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c2
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c15
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h2
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c11
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c11
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c11
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c2
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c2
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c2
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c2
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c4
-rw-r--r--MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c2
13 files changed, 31 insertions, 37 deletions
diff --git a/MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c b/MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c
index e3b0fe3fd6..4c0d3eaadb 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c b/MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c
index 1fd00acabd..9e620e2200 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
index 351e370c2c..8932af7083 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
+++ b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
@@ -95,7 +95,8 @@ CompareGuid (
GUID in the target buffer is returned. If no match is found, 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 Buffer is not aligned on a 32-bit boundary, then ASSERT().
+ If Length is not aligned on a 128-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@@ -115,16 +116,12 @@ ScanGuid (
{
CONST GUID *GuidPtr;
- ASSERT (Buffer != NULL);
- //
- // Make sure Buffer is aligned on a 64-bit boundary.
- //
- ASSERT (((UINTN) Buffer & 7) == 0);
-
+ ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
+ ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);
GuidPtr = (GUID*)Buffer;
- Buffer = GuidPtr + Length / sizeof (*GuidPtr);
+ Buffer = GuidPtr + Length / sizeof (*GuidPtr);
while (GuidPtr < (CONST GUID*)Buffer) {
if (CompareGuid (GuidPtr, Guid)) {
return (VOID*)GuidPtr;
diff --git a/MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h b/MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h
index ca7311a407..8646b24e79 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h
+++ b/MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c
index 9ffc2cf159..29170594d3 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.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 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().
@param Buffer Pointer to the target buffer to scan.
@@ -52,16 +53,14 @@ ScanMem16 (
IN UINT16 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*)InternalMemScanMem16 (Buffer, Stride, Value);
+ return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
}
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);
}
diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c
index 589d45c1a1..7bfc7d721e 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibMmx/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);
}
diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c
index 4dc8bac073..0f7289d3df 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c
index 41467a9cb0..889339c953 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c
index 425840682d..15f8205ebc 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c
index 4a1eda80e8..981a7d4731 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c
index 3965be759a..c73168841b 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
@@ -32,7 +32,7 @@
If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
@param Buffer Memory to set.
- @param Length Number of bytes to set
+ @param Length Number of bytes to set.
@param Value Value of the set operation.
@return Buffer.
diff --git a/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c
index 56dbe5d8be..08247681c5 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/