* [PATCH] ArmPkg: Add IsZeroGuid() API support for ArmPkg
@ 2016-09-01 12:11 Vikas C Sajjan
2016-09-01 12:26 ` Ard Biesheuvel
0 siblings, 1 reply; 2+ messages in thread
From: Vikas C Sajjan @ 2016-09-01 12:11 UTC (permalink / raw)
To: edk2-devel, lersek, ard.biesheuvel, leif.lindholm
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 <mohan_parthasarathy@hpe.com>
Signed-off-by: Vikas C Sajjan <vikas.cha.sajjan@hpe.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ArmPkg: Add IsZeroGuid() API support for ArmPkg
2016-09-01 12:11 [PATCH] ArmPkg: Add IsZeroGuid() API support for ArmPkg Vikas C Sajjan
@ 2016-09-01 12:26 ` Ard Biesheuvel
0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2016-09-01 12:26 UTC (permalink / raw)
To: Vikas C Sajjan; +Cc: edk2-devel-01, Laszlo Ersek, Leif Lindholm
On 1 September 2016 at 13:11, Vikas C Sajjan <vikas.cha.sajjan@hpe.com> wrote:
> 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 <mohan_parthasarathy@hpe.com>
> Signed-off-by: Vikas C Sajjan <vikas.cha.sajjan@hpe.com>
Thanks, but I already sent a patch for this. However, it appears that
Leif prefers that the ARM version of BaseMemoryLib be moved into
MdePkg instead.
> ---
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-01 12:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-01 12:11 [PATCH] ArmPkg: Add IsZeroGuid() API support for ArmPkg Vikas C Sajjan
2016-09-01 12:26 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox