summaryrefslogtreecommitdiff
path: root/MdePkg/Include
diff options
context:
space:
mode:
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-05 06:33:55 +0000
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-05 06:33:55 +0000
commitcc4aa4644e0bc347d0deee88734cd6d8f00bea08 (patch)
tree3421aaa4a2100925f278adf4d15fa828eac6a45a /MdePkg/Include
parent6b005af9113fffc7e4c89123547a33662d091655 (diff)
downloadedk2-cc4aa4644e0bc347d0deee88734cd6d8f00bea08.zip
edk2-cc4aa4644e0bc347d0deee88734cd6d8f00bea08.tar.gz
edk2-cc4aa4644e0bc347d0deee88734cd6d8f00bea08.tar.bz2
Synchronized Macro definition of GET_GUID_HOB_DATA_SIZE, GET_GUID_HOB_DATA, END_OF_HOB_LIST, GET_NEXT_HOB, GET_HOB_LENGTH, GET_HOB_TYPE with Spec.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6860 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Include')
-rw-r--r--MdePkg/Include/Library/HobLib.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/MdePkg/Include/Library/HobLib.h b/MdePkg/Include/Library/HobLib.h
index 3746855..a92d37a 100644
--- a/MdePkg/Include/Library/HobLib.h
+++ b/MdePkg/Include/Library/HobLib.h
@@ -425,7 +425,9 @@ BuildMemoryAllocationHob (
@return HobType
**/
-#define GET_HOB_TYPE(Hob) ((Hob).Header->HobType)
+//#define GET_HOB_TYPE(Hob) ((Hob).Header->HobType)
+#define GET_HOB_TYPE(HobStart) \
+ ((*(EFI_HOB_GENERIC_HEADER **)&(HobStart))->HobType)
/**
Returns the length, in bytes, of a HOB.
@@ -438,7 +440,9 @@ BuildMemoryAllocationHob (
@return HobLength
**/
-#define GET_HOB_LENGTH(Hob) ((Hob).Header->HobLength)
+//#define GET_HOB_LENGTH(Hob) ((Hob).Header->HobLength)
+#define GET_HOB_LENGTH(HobStart) \
+ ((*(EFI_HOB_GENERIC_HEADER **)&(HobStart))->HobLength)
/**
Returns a pointer to the next HOB in the HOB list.
@@ -451,7 +455,9 @@ BuildMemoryAllocationHob (
@return A pointer to the next HOB in the HOB list.
**/
-#define GET_NEXT_HOB(Hob) ((Hob).Raw + GET_HOB_LENGTH (Hob))
+//#define GET_NEXT_HOB(Hob) ((Hob).Raw + GET_HOB_LENGTH (Hob))
+#define GET_NEXT_HOB(HobStart) \
+ (VOID *)(*(UINT8 **)&(HobStart) + GET_HOB_LENGTH (HobStart))
/**
Determines if a HOB is the last HOB in the HOB list.
@@ -479,7 +485,9 @@ BuildMemoryAllocationHob (
@return A pointer to the data buffer in a HOB
**/
-#define GET_GUID_HOB_DATA(GuidHob) ((VOID *) (((UINT8 *) &((GuidHob)->Name)) + sizeof (EFI_GUID)))
+//#define GET_GUID_HOB_DATA(GuidHob) ((VOID *) (((UINT8 *) &((GuidHob)->Name)) + sizeof (EFI_GUID)))
+#define GET_GUID_HOB_DATA(HobStart) \
+ (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.
@@ -491,6 +499,8 @@ BuildMemoryAllocationHob (
@return The size of the data buffer
**/
-#define GET_GUID_HOB_DATA_SIZE(GuidHob) (((GuidHob)->Header).HobLength - sizeof (EFI_HOB_GUID_TYPE))
+//#define GET_GUID_HOB_DATA_SIZE(GuidHob) (((GuidHob)->Header).HobLength - sizeof (EFI_HOB_GUID_TYPE))
+#define GET_GUID_HOB_DATA_SIZE(HobStart) \
+ (UINT16)(GET_HOB_LENGTH (HobStart) - sizeof (EFI_HOB_GUID_TYPE))
#endif