]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c
DebugLib:
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibRepStr / MemLibGuid.c
index 351e370c2cc8d63e028ad4a9fcffe7373bff7b76..8932af7083ebfbf5b36d45b53b9be140a48c9333 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -95,7 +95,8 @@ CompareGuid (
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 128-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
@@ -115,16 +116,12 @@ ScanGuid (
 {\r
   CONST GUID                        *GuidPtr;\r
 \r
 {\r
   CONST GUID                        *GuidPtr;\r
 \r
-  ASSERT (Buffer != NULL);\r
-  //\r
-  // Make sure Buffer is aligned on a 64-bit boundary.\r
-  //\r
-  ASSERT (((UINTN) Buffer & 7) == 0);\r
-\r
+  ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);\r
   ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
   ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
+  ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);\r
 \r
   GuidPtr = (GUID*)Buffer;\r
 \r
   GuidPtr = (GUID*)Buffer;\r
-  Buffer = GuidPtr + Length / sizeof (*GuidPtr);\r
+  Buffer  = GuidPtr + Length / sizeof (*GuidPtr);\r
   while (GuidPtr < (CONST GUID*)Buffer) {\r
     if (CompareGuid (GuidPtr, Guid)) {\r
       return (VOID*)GuidPtr;\r
   while (GuidPtr < (CONST GUID*)Buffer) {\r
     if (CompareGuid (GuidPtr, Guid)) {\r
       return (VOID*)GuidPtr;\r