From patchwork Fri Sep 2 14:29:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 75310 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp903234qga; Fri, 2 Sep 2016 07:29:22 -0700 (PDT) X-Received: by 10.98.105.135 with SMTP id e129mr36727430pfc.59.1472826562372; Fri, 02 Sep 2016 07:29:22 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id k70si11881736pfk.85.2016.09.02.07.29.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Sep 2016 07:29:22 -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 A53151A1E66; Fri, 2 Sep 2016 07:29:19 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (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 322FD1A1E0F for ; Fri, 2 Sep 2016 07:29:18 -0700 (PDT) Received: by mail-wm0-x22b.google.com with SMTP id w2so32616489wmd.0 for ; Fri, 02 Sep 2016 07:29:18 -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=SsstxuZ01cT4LG9eaTu9oacBQfYOyz6kmMvQuz/fKm0=; b=K55X8kHM/hqz23KebJP3qhz4/dG1uAX3EkTxz8p6OezRxnBp3vMblrs/mEmgqjv815 19yPOwW//bcQvt1z5zRjur5fY5gaYQ2rf9R0fdp7UrvkqpOWeLekN5j/zh6bkTml/W1j mxNTN6xkhOL72Dg0rxx8jc5tf2XMZD26Fsv6Q= 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=SsstxuZ01cT4LG9eaTu9oacBQfYOyz6kmMvQuz/fKm0=; b=VAVgTCnyd+3kSb3xbA+iu7W1PgFygENpLQAH1wIFDTGlN0+oByMkiOukX5wr7ghqBb joPNGSuBO7yeN751Jot/8q5mCbFwuKI9FSc5dGQjLxHhUteJXCE+DapJ2z3GRHBxXMmA A2UBfBGHp7te2zBravYrJOcAZBLoyWYL4QLe42RZCHYaf7hpK0yQJl6MkZh/+RqiWgb1 4KQyflTN36TcIlmRJv6EqvQKKz46t0Z4cwiKjJurgOSPo28mBR8oAFvKg8P+ank8/nnY ucwaXZTAvIAeWksONk2tM8Fweo0I9MsKcaSUC8iwBm0O3Frf2T5gW5sy2XM0p7aT52bo eVcw== X-Gm-Message-State: AE9vXwPF3+TdO9sRPyjkWlYVU2SRjODDrRxYDdAbgQESjjEK9oGoaXttrVlNjhmjQ9qi/FiW X-Received: by 10.194.242.67 with SMTP id wo3mr3821425wjc.65.1472826556768; Fri, 02 Sep 2016 07:29:16 -0700 (PDT) Received: from mohikan.mushroom.smurfnet.nu ([2a01:348:6:8735:e23f:49ff:fe6d:9d26]) by smtp.gmail.com with ESMTPSA id q65sm3841609wmd.24.2016.09.02.07.29.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Sep 2016 07:29:16 -0700 (PDT) From: Leif Lindholm To: edk2-devel@lists.01.org Date: Fri, 2 Sep 2016 15:29:11 +0100 Message-Id: <20160902142912.17297-3-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160902142912.17297-1-leif.lindholm@linaro.org> References: <20160902142912.17297-1-leif.lindholm@linaro.org> Subject: [edk2] [PATCH 2/3] MdePkg/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: Michael D Kinney , Laszlo Ersek , Liming Gao , Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: Ard Biesheuvel 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 Reviewed-by: Leif Lindholm --- MdePkg/Library/BaseMemoryLibStm/MemLibGuid.c | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) -- 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdePkg/Library/BaseMemoryLibStm/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibStm/MemLibGuid.c index 2b4ed57..36d42d7 100644 --- a/MdePkg/Library/BaseMemoryLibStm/MemLibGuid.c +++ b/MdePkg/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); +}