]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg BaseMemoryLib: Add implementation of API IsZeroGuid()
authorHao Wu <hao.a.wu@intel.com>
Wed, 3 Aug 2016 07:29:50 +0000 (15:29 +0800)
committerHao Wu <hao.a.wu@intel.com>
Mon, 22 Aug 2016 10:54:29 +0000 (18:54 +0800)
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>
MdePkg/Include/Library/BaseMemoryLib.h
MdePkg/Library/BaseMemoryLib/MemLibGuid.c
MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c
MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c
MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c
MdePkg/Library/PeiMemoryLib/MemLibGuid.c
MdePkg/Library/UefiMemoryLib/MemLibGuid.c

index e3a46d0b495fbfdfde3377a01a910d1ffdda4fb8..ed7fa00d499b63c49a674344ff2fb005f68009c2 100644 (file)
@@ -5,7 +5,7 @@
   These functions should be used in place of coding your own loops to do equivalent common functions. \r
   This allows optimized library implementations to help increase performance. \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 are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -443,4 +443,24 @@ ScanGuid (
   IN CONST GUID  *Guid\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
 #endif\r
index dc16bd5cddee8415080d9749f1232ec7e212d664..b2590f83caef276c220b5c92e2728179f39c6e05 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
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
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
index 6f6edd0d8ff2738a5b728202ca0493106a9c1ff9..cbb385fddfba8b4b7de2df526202264e8ce101f1 100644 (file)
@@ -12,7 +12,7 @@
     PeiMemoryLib\r
     UefiMemoryLib\r
 \r
-  Copyright (c) 2006 - 2009, 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
index 6f6edd0d8ff2738a5b728202ca0493106a9c1ff9..cbb385fddfba8b4b7de2df526202264e8ce101f1 100644 (file)
@@ -12,7 +12,7 @@
     PeiMemoryLib\r
     UefiMemoryLib\r
 \r
-  Copyright (c) 2006 - 2009, 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
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
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
index 6f6edd0d8ff2738a5b728202ca0493106a9c1ff9..cbb385fddfba8b4b7de2df526202264e8ce101f1 100644 (file)
@@ -12,7 +12,7 @@
     PeiMemoryLib\r
     UefiMemoryLib\r
 \r
-  Copyright (c) 2006 - 2009, 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