From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2BD061A1E56 for ; Thu, 1 Sep 2016 05:19:22 -0700 (PDT) Received: from dctxvm241.in.rdlabs.hpecorp.net (dctxvm241.in.rdlabs.hpecorp.net [15.146.152.172]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id F03BB4A; Thu, 1 Sep 2016 12:19:18 +0000 (UTC) From: Vikas C Sajjan To: edk2-devel@lists.01.org, lersek@redhat.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org Date: Thu, 1 Sep 2016 17:41:03 +0530 Message-Id: <1472731863-21633-1-git-send-email-vikas.cha.sajjan@hpe.com> X-Mailer: git-send-email 1.9.1 Subject: [PATCH] ArmPkg: Add IsZeroGuid() API support for ArmPkg X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 12:19:22 -0000 The commit "965268e SecurityPkg: Use IsZeroGuid API for zero GUID checking" breaks the ArmPkg build as below. edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c:184: undefined reference to `IsZeroGuid' edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c:5692: undefined reference to `IsZeroGuid' edk2/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c:2832: undefined reference to `IsZeroGuid' edk2/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:361: undefined reference to `IsZeroGuid' edk2/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:376: undefined reference to `IsZeroGuid' Since it introduced the use of IsZeroGuid() instead CompareGuid(). And the IsZeroGuid() support was missing in ArmPkg. Contributed-under: TianoCore Contribution Agreement 1.0 Reported-by: Mohan Parthasarathy Signed-off-by: Vikas C Sajjan --- ArmPkg/Library/BaseMemoryLibStm/MemLibGuid.c | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/ArmPkg/Library/BaseMemoryLibStm/MemLibGuid.c b/ArmPkg/Library/BaseMemoryLibStm/MemLibGuid.c index 2b4ed57..36d42d7 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); +} -- 1.9.1