diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-08-31 10:07:32 +0100 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2016-09-02 20:10:38 +0100 |
commit | a548a5421f98f0890e3ab9703a5209d3ef8a9183 (patch) | |
tree | afc44ebc9c52b2d76ace7740159726321b3eb636 /ArmPkg/Library | |
parent | 8953d69a5ca7f18f80f46e67da95c2527ca6ee89 (diff) | |
download | edk2-a548a5421f98f0890e3ab9703a5209d3ef8a9183.tar.gz edk2-a548a5421f98f0890e3ab9703a5209d3ef8a9183.tar.bz2 edk2-a548a5421f98f0890e3ab9703a5209d3ef8a9183.zip |
ArmPkg/BaseMemoryLibStm: implement new IsZeroGuid() API function
BaseMemoryLib has recently been extended with an API function
IsZeroGuid(), so copy the default implementation into BaseMemoryLibStm
as well.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPkg/Library')
-rw-r--r-- | ArmPkg/Library/BaseMemoryLibStm/MemLibGuid.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ArmPkg/Library/BaseMemoryLibStm/MemLibGuid.c b/ArmPkg/Library/BaseMemoryLibStm/MemLibGuid.c index 2b4ed57755..36d42d71d7 100644 --- a/ArmPkg/Library/BaseMemoryLibStm/MemLibGuid.c +++ b/ArmPkg/Library/BaseMemoryLibStm/MemLibGuid.c @@ -130,3 +130,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);
+}
|