summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
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/BaseMemoryLib/MemLibGuid.c
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/BaseMemoryLib/MemLibGuid.c')
-rw-r--r--MdePkg/Library/BaseMemoryLib/MemLibGuid.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
index 351e370c2c..8932af7083 100644
--- a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
+++ b/MdePkg/Library/BaseMemoryLib/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;