From patchwork Wed Aug 31 09:07:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 75051 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp224841qga; Wed, 31 Aug 2016 02:07:48 -0700 (PDT) X-Received: by 10.98.70.8 with SMTP id t8mr15008674pfa.36.1472634468395; Wed, 31 Aug 2016 02:07:48 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id bm4si4454050pac.211.2016.08.31.02.07.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Aug 2016 02:07:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id F41081A1E44; Wed, 31 Aug 2016 02:07:47 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 797921A1E01 for ; Wed, 31 Aug 2016 02:07:46 -0700 (PDT) Received: by mail-wm0-x232.google.com with SMTP id w2so21516645wmd.0 for ; Wed, 31 Aug 2016 02:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GoKFeDNl9tyCXhu+Ca/2DB5uWl+ROU27C7AiUGJJixI=; b=Y10mAS69y/u/cVptGhCOFPTC3I1BQApXx4UyM18bKC9Fdl2LmnO4eTX3RWeYd2nFkd X2mvVGoBNVMDpRobi4SPHDq84BAxOKN4/kjP/Xp3XPmv6sEdMenejNKqVT6uw/bgD6OR 2bMVtfgoo7KMYater4zG9Uoc1EYt2yFyOjYCY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GoKFeDNl9tyCXhu+Ca/2DB5uWl+ROU27C7AiUGJJixI=; b=Nn93eRQCBgDoaPA8wPhS9AUqNVYK1WMsfzVPEyQR1bBSE18wC5NoLYskQKQCLkEi7a DPebxEZYFIUZgFu9xQ9gGRXLf1TYw9vACtr1yU3W6M4mKxV2BACVb1OsfLvnCud+cURr TgDRGfsg9xQoX2QkdonL904ClJ5iIUye+69dQ4p/SAeeJHdZz3InC4rBu/oDiQkneIGb DoGvtuS2LrHKdsU8BPy/LKIOZc+DJ4bURFhMzhOPxPaWl1D8sdGiSJOZc/YzoKTRtjum t2ZzZNcKuJWPzb8fOllv0mBNLRGmi0xQhQwswDHYy8l0AtzTIOzn6qpVR+MFkeXQZix1 ogmQ== X-Gm-Message-State: AE9vXwO19fa8ldI3FYbrU0IdM7JTnnlwGghTs/NXzTrUvLxUEIfTl55WijEd4zjHszebh9yp X-Received: by 10.194.120.164 with SMTP id ld4mr8094237wjb.81.1472634464879; Wed, 31 Aug 2016 02:07:44 -0700 (PDT) Received: from localhost.localdomain ([160.169.158.74]) by smtp.gmail.com with ESMTPSA id uo4sm43462468wjc.36.2016.08.31.02.07.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Aug 2016 02:07:44 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Date: Wed, 31 Aug 2016 10:07:32 +0100 Message-Id: <1472634453-27246-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472634453-27246-1-git-send-email-ard.biesheuvel@linaro.org> References: <1472634453-27246-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 2/3] ArmPkg/BaseMemoryLibStm: implement new IsZeroGuid() API function 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: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 --- ArmPkg/Library/BaseMemoryLibStm/MemLibGuid.c | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPkg/Library/BaseMemoryLibStm/MemLibGuid.c b/ArmPkg/Library/BaseMemoryLibStm/MemLibGuid.c index 2b4ed5775581..36d42d71d79a 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); +}