mirror of https://github.com/acidanthera/audk.git
MdePkg BaseMemoryLib: Add implementation of API IsZeroGuid()
Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
669a7562cb
commit
313831d933
|
@ -5,7 +5,7 @@
|
|||
These functions should be used in place of coding your own loops to do equivalent common functions.
|
||||
This allows optimized library implementations to help increase performance.
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials are licensed and made available under
|
||||
the terms and conditions of the BSD License that accompanies this distribution.
|
||||
The full text of the license may be found at
|
||||
|
@ -443,4 +443,24 @@ ScanGuid (
|
|||
IN CONST GUID *Guid
|
||||
);
|
||||
|
||||
/**
|
||||
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
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -140,3 +140,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);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -140,3 +140,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);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -140,3 +140,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);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -140,3 +140,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);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -140,3 +140,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);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -140,3 +140,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);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -140,3 +140,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);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
PeiMemoryLib
|
||||
UefiMemoryLib
|
||||
|
||||
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -140,3 +140,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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue