From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Cc: Laszlo Ersek , Michael D Kinney , Liming Gao , Ard Biesheuvel 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: [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: , X-List-Received-Date: Fri, 02 Sep 2016 14:29:18 -0000 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(+) 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); +} -- 2.9.3