summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/PeiMemoryLib
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-08 01:24:16 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-08 01:24:16 +0000
commitcc4e0485045285042ad088736ef278459b139d54 (patch)
tree245ab29fda9f1d7349fc5a09b4929ec1a8a57c6b /MdePkg/Library/PeiMemoryLib
parent0002305b5ffa712e924fbe6db24872fd2623dc3e (diff)
downloadedk2-cc4e0485045285042ad088736ef278459b139d54.tar.gz
edk2-cc4e0485045285042ad088736ef278459b139d54.tar.bz2
edk2-cc4e0485045285042ad088736ef278459b139d54.zip
Correct the wrong '?' character to '-', and add check DestinationBuffer == SourceBuffer for CompareMem functions in all BaseMemory library instances.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5831 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/PeiMemoryLib')
-rw-r--r--MdePkg/Library/PeiMemoryLib/CompareMemWrapper.c2
-rw-r--r--MdePkg/Library/PeiMemoryLib/MemLib.c4
-rw-r--r--MdePkg/Library/PeiMemoryLib/MemLibGuid.c2
-rw-r--r--MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c2
-rw-r--r--MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c2
-rw-r--r--MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c2
-rw-r--r--MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c2
-rw-r--r--MdePkg/Library/PeiMemoryLib/SetMemWrapper.c2
-rw-r--r--MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c2
9 files changed, 10 insertions, 10 deletions
diff --git a/MdePkg/Library/PeiMemoryLib/CompareMemWrapper.c b/MdePkg/Library/PeiMemoryLib/CompareMemWrapper.c
index 48948617d1..9d85c57fa3 100644
--- a/MdePkg/Library/PeiMemoryLib/CompareMemWrapper.c
+++ b/MdePkg/Library/PeiMemoryLib/CompareMemWrapper.c
@@ -53,7 +53,7 @@ CompareMem (
IN UINTN Length
)
{
- if (Length == 0) {
+ if (Length == 0 || DestinationBuffer == SourceBuffer) {
return 0;
}
ASSERT (DestinationBuffer != NULL);
diff --git a/MdePkg/Library/PeiMemoryLib/MemLib.c b/MdePkg/Library/PeiMemoryLib/MemLib.c
index 82e50825c0..cbd88c1c6d 100644
--- a/MdePkg/Library/PeiMemoryLib/MemLib.c
+++ b/MdePkg/Library/PeiMemoryLib/MemLib.c
@@ -1,7 +1,7 @@
/** @file
- Base Memory Library.
+ Base Memory Library functions implementation bases on PeiServcie.
- Copyright (c) 2006, Intel Corporation<BR>
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
diff --git a/MdePkg/Library/PeiMemoryLib/MemLibGuid.c b/MdePkg/Library/PeiMemoryLib/MemLibGuid.c
index f7f1b16beb..db7f3588fc 100644
--- a/MdePkg/Library/PeiMemoryLib/MemLibGuid.c
+++ b/MdePkg/Library/PeiMemoryLib/MemLibGuid.c
@@ -102,7 +102,7 @@ CompareGuid (
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 128-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), 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.
diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c
index 66a2cd40d9..94541f4f50 100644
--- a/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c
+++ b/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c
@@ -34,7 +34,7 @@
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().
+ 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.
diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c
index f3518b7d87..e80d730548 100644
--- a/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c
+++ b/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c
@@ -34,7 +34,7 @@
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().
+ 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.
diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c
index 1bd7fe3fe5..36adb50052 100644
--- a/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c
+++ b/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c
@@ -34,7 +34,7 @@
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().
+ 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.
diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c
index d12af184f7..b30cd320f2 100644
--- a/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c
+++ b/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c
@@ -32,7 +32,7 @@
then a pointer to the matching byte 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 Length is greater than (MAX_ADDRESS ? Buffer + 1), 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.
diff --git a/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c b/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c
index ea0a3e0106..f8c611285f 100644
--- a/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c
+++ b/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c
@@ -27,7 +27,7 @@
Fills a target buffer with a byte value, and returns the target buffer.
This function fills Length bytes of Buffer with Value, and returns Buffer.
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Memory to set.
@param Length Number of bytes to set.
diff --git a/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c b/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c
index 33b9d07ecf..337b45346e 100644
--- a/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c
+++ b/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c
@@ -28,7 +28,7 @@
This function fills Length bytes of Buffer with zeros, and returns Buffer.
If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to fill with zeros.
@param Length Number of bytes in Buffer to fill with zeros.