summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BaseMemoryLibOptDxe
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2016-08-03 15:29:50 +0800
committerHao Wu <hao.a.wu@intel.com>2016-08-22 18:54:29 +0800
commit313831d9333d66f311b18c671ae5ae0e755435f1 (patch)
tree0710929614d43c94101d3b3c1d0121719e2abacc /MdePkg/Library/BaseMemoryLibOptDxe
parent669a7562cb3488f36550dc43b8db8d312da1f281 (diff)
downloadedk2-313831d9333d66f311b18c671ae5ae0e755435f1.tar.gz
edk2-313831d9333d66f311b18c671ae5ae0e755435f1.tar.bz2
edk2-313831d9333d66f311b18c671ae5ae0e755435f1.zip
MdePkg BaseMemoryLib: Add implementation of API IsZeroGuid()
Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibOptDxe')
-rw-r--r--MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
index c04af6e112..cbb385fddf 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
@@ -12,7 +12,7 @@
PeiMemoryLib
UefiMemoryLib
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
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
@@ -140,3 +140,32 @@ ScanGuid (
}
return NULL;
}
+
+/**
+ Checks if the given GUID is a zero GUID.
+
+ This function checks whether the given GUID is a zero GUID. If the GUID is
+ identical to a zero GUID then TRUE is returned. Otherwise, FALSE is returned.
+
+ If Guid is NULL, then ASSERT().
+
+ @param Guid The pointer to a 128 bit GUID.
+
+ @retval TRUE Guid is a zero GUID.
+ @retval FALSE Guid is not a zero GUID.
+
+**/
+BOOLEAN
+EFIAPI
+IsZeroGuid (
+ IN CONST GUID *Guid
+ )
+{
+ UINT64 LowPartOfGuid;
+ UINT64 HighPartOfGuid;
+
+ LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
+ HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
+
+ return (BOOLEAN) (LowPartOfGuid == 0 && HighPartOfGuid == 0);
+}