From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Cc: Ard Biesheuvel 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: [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: , X-List-Received-Date: Wed, 31 Aug 2016 09:07:46 -0000 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(+) 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); +} -- 2.7.4