]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c
MdePkg BaseMemoryLib: Add implementation of API IsZeroGuid()
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / MemLibGuid.c
index c04af6e112dd6c82c535ae50e8a207b210059ee3..cbb385fddfba8b4b7de2df526202264e8ce101f1 100644 (file)
@@ -12,7 +12,7 @@
     PeiMemoryLib\r
     UefiMemoryLib\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -140,3 +140,32 @@ ScanGuid (
   }\r
   return NULL;\r
 }\r
+\r
+/**\r
+  Checks if the given GUID is a zero GUID.\r
+\r
+  This function checks whether the given GUID is a zero GUID. If the GUID is\r
+  identical to a zero GUID then TRUE is returned. Otherwise, FALSE is returned.\r
+\r
+  If Guid is NULL, then ASSERT().\r
+\r
+  @param  Guid        The pointer to a 128 bit GUID.\r
+\r
+  @retval TRUE        Guid is a zero GUID.\r
+  @retval FALSE       Guid is not a zero GUID.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+IsZeroGuid (\r
+  IN CONST GUID  *Guid\r
+  )\r
+{\r
+  UINT64  LowPartOfGuid;\r
+  UINT64  HighPartOfGuid;\r
+\r
+  LowPartOfGuid  = ReadUnaligned64 ((CONST UINT64*) Guid);\r
+  HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);\r
+\r
+  return (BOOLEAN) (LowPartOfGuid == 0 && HighPartOfGuid == 0);\r
+}\r