]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/HobLib.h
Synchronized Macro definition of GET_GUID_HOB_DATA_SIZE, GET_GUID_HOB_DATA, END_OF_H...
[mirror_edk2.git] / MdePkg / Include / Library / HobLib.h
index 2e81704421812d8942e81871703e6d946eabbac8..278133d9910c055fe55ad546f5fea1a815a4ed5a 100644 (file)
@@ -8,7 +8,7 @@
   allows the PEI phase to pass information to the DXE phase. HOBs are position \r
   independent and can be relocated easily to different memory memory locations.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -425,7 +425,8 @@ BuildMemoryAllocationHob (
   @return HobType\r
   \r
 **/\r
-#define GET_HOB_TYPE(Hob)     ((Hob).Header->HobType)\r
+#define GET_HOB_TYPE(HobStart) \\r
+  ((*(EFI_HOB_GENERIC_HEADER **)&(HobStart))->HobType)\r
 \r
 /**\r
   Returns the length, in bytes, of a HOB.\r
@@ -438,7 +439,8 @@ BuildMemoryAllocationHob (
   @return HobLength\r
 \r
 **/\r
-#define GET_HOB_LENGTH(Hob)   ((Hob).Header->HobLength)\r
+#define GET_HOB_LENGTH(HobStart) \\r
+  ((*(EFI_HOB_GENERIC_HEADER **)&(HobStart))->HobLength)\r
 \r
 /**\r
   Returns a pointer to the next HOB in the HOB list.\r
@@ -451,7 +453,8 @@ BuildMemoryAllocationHob (
   @return A pointer to the next HOB in the HOB list.\r
 \r
 **/\r
-#define GET_NEXT_HOB(Hob)     ((Hob).Raw + GET_HOB_LENGTH (Hob))\r
+#define GET_NEXT_HOB(HobStart) \\r
+  (VOID *)(*(UINT8 **)&(HobStart) + GET_HOB_LENGTH (HobStart))\r
 \r
 /**\r
   Determines if a HOB is the last HOB in the HOB list.\r
@@ -474,12 +477,13 @@ BuildMemoryAllocationHob (
   This macro returns a pointer to the data buffer in a HOB specified by Hob.\r
   Hob is assumed to be a HOB of type EFI_HOB_TYPE_GUID_EXTENSION.   \r
 \r
-  @param   Hob   A pointer to a HOB.\r
+  @param   GuidHob   A pointer to a HOB.\r
 \r
   @return  A pointer to the data buffer in a HOB\r
   \r
 **/\r
-#define GET_GUID_HOB_DATA(GuidHob)      ((VOID *) (((UINT8 *) &((GuidHob)->Name)) + sizeof (EFI_GUID)))\r
+#define GET_GUID_HOB_DATA(HobStart) \\r
+  (VOID *)(*(UINT8 **)&(HobStart) + sizeof (EFI_HOB_GUID_TYPE))\r
 \r
 /**\r
   Returns the size of the data buffer from a HOB of type EFI_HOB_TYPE_GUID_EXTENSION.\r
@@ -487,10 +491,11 @@ BuildMemoryAllocationHob (
   This macro returns the size, in bytes, of the data buffer in a HOB specified by Hob.\r
   Hob is assumed to be a HOB of type EFI_HOB_TYPE_GUID_EXTENSION.\r
 \r
-  @param   Hob   A pointer to a HOB.\r
+  @param   GuidHob   A pointer to a HOB.\r
 \r
   @return  The size of the data buffer\r
 **/\r
-#define GET_GUID_HOB_DATA_SIZE(GuidHob) (((GuidHob)->Header).HobLength - sizeof (EFI_HOB_GUID_TYPE))\r
+#define GET_GUID_HOB_DATA_SIZE(HobStart) \\r
+  (UINT16)(GET_HOB_LENGTH (HobStart) - sizeof (EFI_HOB_GUID_TYPE))\r
 \r
 #endif\r