HobLib: Don't break GCC strict aliasing
Change-Id: I1bd33e423b0fcb69597e001b61c6ea916f5fe44a Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: https://review.coreboot.org/14622 Tested-by: build bot (Jenkins) Reviewed-by: Leroy P Leahy <leroy.p.leahy@intel.com>
This commit is contained in:
parent
a53977e232
commit
1eaf58be2c
|
@ -431,7 +431,7 @@ BuildMemoryAllocationHob (
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#define GET_HOB_TYPE(HobStart) \
|
#define GET_HOB_TYPE(HobStart) \
|
||||||
((*(EFI_HOB_GENERIC_HEADER **)&(HobStart))->HobType)
|
(((EFI_HOB_GENERIC_HEADER *)HobStart)->HobType)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the length, in bytes, of a HOB.
|
Returns the length, in bytes, of a HOB.
|
||||||
|
@ -445,7 +445,7 @@ BuildMemoryAllocationHob (
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#define GET_HOB_LENGTH(HobStart) \
|
#define GET_HOB_LENGTH(HobStart) \
|
||||||
((*(EFI_HOB_GENERIC_HEADER **)&(HobStart))->HobLength)
|
(((EFI_HOB_GENERIC_HEADER *)HobStart)->HobLength)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns a pointer to the next HOB in the HOB list.
|
Returns a pointer to the next HOB in the HOB list.
|
||||||
|
@ -459,7 +459,7 @@ BuildMemoryAllocationHob (
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#define GET_NEXT_HOB(HobStart) \
|
#define GET_NEXT_HOB(HobStart) \
|
||||||
(VOID *)(*(UINT8 **)&(HobStart) + GET_HOB_LENGTH (HobStart))
|
(VOID *)((UINT8 *)(HobStart) + GET_HOB_LENGTH(HobStart))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Determines if a HOB is the last HOB in the HOB list.
|
Determines if a HOB is the last HOB in the HOB list.
|
||||||
|
@ -488,7 +488,7 @@ BuildMemoryAllocationHob (
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#define GET_GUID_HOB_DATA(HobStart) \
|
#define GET_GUID_HOB_DATA(HobStart) \
|
||||||
(VOID *)(*(UINT8 **)&(HobStart) + sizeof (EFI_HOB_GUID_TYPE))
|
(VOID *)((UINT8 *)(HobStart) + sizeof(EFI_HOB_GUID_TYPE))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the size of the data buffer from a HOB of type EFI_HOB_TYPE_GUID_EXTENSION.
|
Returns the size of the data buffer from a HOB of type EFI_HOB_TYPE_GUID_EXTENSION.
|
||||||
|
|
Loading…
Reference in New Issue