summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLibSse2
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-05 04:17:04 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-05 04:17:04 +0000
commitadd13dc21720eff1a37fdea34c0fef190e2ad37d (patch)
tree0d58a4edded2175903f98276e3fe67f802ab44ce /MdePkg/Library/BaseMemoryLibSse2
parentc16ade35ca4b293255fea78aaf33783501f90f9f (diff)
downloadedk2-platforms-add13dc21720eff1a37fdea34c0fef190e2ad37d.tar.xz
DebugLib:
Fix a bug in PeiDxeDebugLibReportStatusCode: it should use gReportStatusCodeDebugType so that report status code infrastructure can correctly extract debug info. Fix functional and coding style issues in the three instances in EdkModulePkg, namely: EdkDxeDebugLibReportStatusCode, EdkUefiDebugLibStderr, EdkUefiDebugLibConout. DevicePathLib: Sync with MWG 0.57 and add new interface of CreateDevicePathNode(). All the function headers have been updated. PeiServicesLib: Adjust coding style and fix a minor comment error. PciLib: Adjust assert() condition to sync with MWG 0.57 BaseMemoryLib: Adjust assert() for ScanMemXX (), ScanGuid() Rename UefiMemoryLib to DxeMemoryLib PrintLib: Change the return value of all print services to exclude the NULL-terminator. Misc: Slightly adjust the coding style in hob.c in PeiCore module. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@757 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibSse2')
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c2
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c2
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c15
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/MemLibInternals.h2
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c11
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c11
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c11
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c2
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c2
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c2
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c2
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c4
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c2
13 files changed, 31 insertions, 37 deletions
diff --git a/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c
index e3b0fe3fd6..4c0d3eaadb 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c
index 1fd00acabd..9e620e2200 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c
index 351e370c2c..8932af7083 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/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/BaseMemoryLibSse2/MemLibInternals.h b/MdePkg/Library/BaseMemoryLibSse2/MemLibInternals.h
index ca7311a407..8646b24e79 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/MemLibInternals.h
+++ b/MdePkg/Library/BaseMemoryLibSse2/MemLibInternals.h
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c
index 9ffc2cf159..29170594d3 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/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/BaseMemoryLibSse2/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c
index 6b0beee632..b54d5da07c 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/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/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);
}
diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c
index 4dc8bac073..0f7289d3df 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c
index 41467a9cb0..889339c953 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c
index 425840682d..15f8205ebc 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c
index 4a1eda80e8..981a7d4731 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/
diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c
index 3965be759a..c73168841b 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/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/BaseMemoryLibSse2/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c
index 56dbe5d8be..08247681c5 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c
@@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
- UefiMemoryLib
+ DxeMemoryLib
**/