summaryrefslogtreecommitdiff
path: root/MdePkg/Library/PeiMemoryLib
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/PeiMemoryLib')
-rw-r--r--MdePkg/Library/PeiMemoryLib/MemLib.c2
-rw-r--r--MdePkg/Library/PeiMemoryLib/MemLibGuid.c17
2 files changed, 13 insertions, 6 deletions
diff --git a/MdePkg/Library/PeiMemoryLib/MemLib.c b/MdePkg/Library/PeiMemoryLib/MemLib.c
index 3a27ab2e83..6f81e21c24 100644
--- a/MdePkg/Library/PeiMemoryLib/MemLib.c
+++ b/MdePkg/Library/PeiMemoryLib/MemLib.c
@@ -14,6 +14,8 @@
**/
+#include "MemLibInternals.h"
+
VOID *
EFIAPI
InternalMemCopyMem (
diff --git a/MdePkg/Library/PeiMemoryLib/MemLibGuid.c b/MdePkg/Library/PeiMemoryLib/MemLibGuid.c
index 6f50340bd7..36da5b7424 100644
--- a/MdePkg/Library/PeiMemoryLib/MemLibGuid.c
+++ b/MdePkg/Library/PeiMemoryLib/MemLibGuid.c
@@ -77,12 +77,17 @@ CompareGuid (
IN CONST GUID *Guid2
)
{
- return (BOOLEAN)(
- ReadUnaligned64 ((CONST UINT64*)Guid1)
- == ReadUnaligned64 ((CONST UINT64*)Guid2) &&
- ReadUnaligned64 ((CONST UINT64*)Guid1 + 1)
- == ReadUnaligned64 ((CONST UINT64*)Guid2 + 1)
- );
+ UINT64 LowPartOfGuid1;
+ UINT64 LowPartOfGuid2;
+ UINT64 HighPartOfGuid1;
+ UINT64 HighPartOfGuid2;
+
+ LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
+ LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
+ HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
+ HighPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2 + 1);
+
+ return (BOOLEAN) (LowPartOfGuid1 == LowPartOfGuid2 && HighPartOfGuid1 == HighPartOfGuid2);
}
/**