2 Hand Off Block (HOB) definition.
4 The HOB is a memory data structure used to hand-off system information from
5 PEI to DXE (the next phase).
7 Copyright (c) 2006, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 @par Revision Reference:
19 These definitions are from Hand Off Block (HOB) Spec Version 0.9.
28 // Every Hob must start with this data structure.
34 } EFI_HOB_GENERIC_HEADER
;
37 // End of HOB List HOB
39 #define EFI_HOB_TYPE_END_OF_HOB_LIST 0xffff
42 // Handoff Information Table HOB
44 #define EFI_HOB_TYPE_HANDOFF 0x0001
46 #define EFI_HOB_HANDOFF_TABLE_VERSION 0x0009
48 typedef UINT32 EFI_BOOT_MODE
;
51 EFI_HOB_GENERIC_HEADER Header
;
53 EFI_BOOT_MODE BootMode
;
54 EFI_PHYSICAL_ADDRESS EfiMemoryTop
;
55 EFI_PHYSICAL_ADDRESS EfiMemoryBottom
;
56 EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop
;
57 EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom
;
58 EFI_PHYSICAL_ADDRESS EfiEndOfHobList
;
59 } EFI_HOB_HANDOFF_INFO_TABLE
;
62 // Memory Descriptor HOB
64 #define EFI_HOB_TYPE_MEMORY_ALLOCATION 0x0002
68 EFI_PHYSICAL_ADDRESS MemoryBaseAddress
;
70 EFI_MEMORY_TYPE MemoryType
;
72 } EFI_HOB_MEMORY_ALLOCATION_HEADER
;
75 EFI_HOB_GENERIC_HEADER Header
;
76 EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor
;
78 // Additional data pertaining to the "Name" Guid memory
81 } EFI_HOB_MEMORY_ALLOCATION
;
84 EFI_HOB_GENERIC_HEADER Header
;
85 EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor
;
86 } EFI_HOB_MEMORY_ALLOCATION_BSP_STORE
;
89 EFI_HOB_GENERIC_HEADER Header
;
90 EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor
;
91 } EFI_HOB_MEMORY_ALLOCATION_STACK
;
94 EFI_HOB_GENERIC_HEADER Header
;
95 EFI_HOB_MEMORY_ALLOCATION_HEADER MemoryAllocationHeader
;
97 EFI_PHYSICAL_ADDRESS EntryPoint
;
98 } EFI_HOB_MEMORY_ALLOCATION_MODULE
;
100 #define EFI_HOB_TYPE_RESOURCE_DESCRIPTOR 0x0003
102 typedef UINT32 EFI_RESOURCE_TYPE
;
104 #define EFI_RESOURCE_SYSTEM_MEMORY 0
105 #define EFI_RESOURCE_MEMORY_MAPPED_IO 1
106 #define EFI_RESOURCE_IO 2
107 #define EFI_RESOURCE_FIRMWARE_DEVICE 3
108 #define EFI_RESOURCE_MEMORY_MAPPED_IO_PORT 4
109 #define EFI_RESOURCE_MEMORY_RESERVED 5
110 #define EFI_RESOURCE_IO_RESERVED 6
111 #define EFI_RESOURCE_MAX_MEMORY_TYPE 7
113 typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE
;
115 #define EFI_RESOURCE_ATTRIBUTE_PRESENT 0x00000001
116 #define EFI_RESOURCE_ATTRIBUTE_INITIALIZED 0x00000002
117 #define EFI_RESOURCE_ATTRIBUTE_TESTED 0x00000004
118 #define EFI_RESOURCE_ATTRIBUTE_SINGLE_BIT_ECC 0x00000008
119 #define EFI_RESOURCE_ATTRIBUTE_MULTIPLE_BIT_ECC 0x00000010
120 #define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_1 0x00000020
121 #define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_2 0x00000040
122 #define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED 0x00000080
123 #define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED 0x00000100
124 #define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED 0x00000200
125 #define EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE 0x00000400
126 #define EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE 0x00000800
127 #define EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE 0x00001000
128 #define EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE 0x00002000
129 #define EFI_RESOURCE_ATTRIBUTE_16_BIT_IO 0x00004000
130 #define EFI_RESOURCE_ATTRIBUTE_32_BIT_IO 0x00008000
131 #define EFI_RESOURCE_ATTRIBUTE_64_BIT_IO 0x00010000
132 #define EFI_RESOURCE_ATTRIBUTE_UNCACHED_EXPORTED 0x00020000
135 EFI_HOB_GENERIC_HEADER Header
;
137 EFI_RESOURCE_TYPE ResourceType
;
138 EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute
;
139 EFI_PHYSICAL_ADDRESS PhysicalStart
;
140 UINT64 ResourceLength
;
141 } EFI_HOB_RESOURCE_DESCRIPTOR
;
144 // GUID Extension HOB
145 // The HobLength is variable as it includes the GUID specific data.
147 #define EFI_HOB_TYPE_GUID_EXTENSION 0x0004
150 EFI_HOB_GENERIC_HEADER Header
;
154 // Guid specific data goes here
159 // Firmware Volume HOB
161 #define EFI_HOB_TYPE_FV 0x0005
164 EFI_HOB_GENERIC_HEADER Header
;
165 EFI_PHYSICAL_ADDRESS BaseAddress
;
167 } EFI_HOB_FIRMWARE_VOLUME
;
172 #define EFI_HOB_TYPE_CPU 0x0006
175 EFI_HOB_GENERIC_HEADER Header
;
176 UINT8 SizeOfMemorySpace
;
182 // PEI Core Memory Pool HOB
183 // The HobLength is variable as the HOB contains pool allocations by
184 // the PeiServices AllocatePool function
186 #define EFI_HOB_TYPE_PEI_MEMORY_POOL 0x0007
189 EFI_HOB_GENERIC_HEADER Header
;
190 } EFI_HOB_MEMORY_POOL
;
193 // Capsule volume HOB -- identical to a firmware volume
195 #define EFI_HOB_TYPE_CV 0x0008
198 EFI_HOB_GENERIC_HEADER Header
;
199 EFI_PHYSICAL_ADDRESS BaseAddress
;
201 } EFI_HOB_CAPSULE_VOLUME
;
203 #define EFI_HOB_TYPE_UNUSED 0xFFFE
206 // Union of all the possible HOB Types
209 EFI_HOB_GENERIC_HEADER
*Header
;
210 EFI_HOB_HANDOFF_INFO_TABLE
*HandoffInformationTable
;
211 EFI_HOB_MEMORY_ALLOCATION
*MemoryAllocation
;
212 EFI_HOB_MEMORY_ALLOCATION_BSP_STORE
*MemoryAllocationBspStore
;
213 EFI_HOB_MEMORY_ALLOCATION_STACK
*MemoryAllocationStack
;
214 EFI_HOB_MEMORY_ALLOCATION_MODULE
*MemoryAllocationModule
;
215 EFI_HOB_RESOURCE_DESCRIPTOR
*ResourceDescriptor
;
216 EFI_HOB_GUID_TYPE
*Guid
;
217 EFI_HOB_FIRMWARE_VOLUME
*FirmwareVolume
;
219 EFI_HOB_MEMORY_POOL
*Pool
;
220 EFI_HOB_CAPSULE_VOLUME
*CapsuleVolume
;
222 } EFI_PEI_HOB_POINTERS
;
224 #define GET_HOB_TYPE(Hob) ((Hob).Header->HobType)
225 #define GET_HOB_LENGTH(Hob) ((Hob).Header->HobLength)
226 #define GET_NEXT_HOB(Hob) ((Hob).Raw + GET_HOB_LENGTH (Hob))
227 #define END_OF_HOB_LIST(Hob) (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_END_OF_HOB_LIST)
230 // Get the data and data size field of GUID
232 #define GET_GUID_HOB_DATA(GuidHob) ((VOID *) (((UINT8 *) &((GuidHob)->Name)) + sizeof (EFI_GUID)))
233 #define GET_GUID_HOB_DATA_SIZE(GuidHob) (((GuidHob)->Header).HobLength - sizeof (EFI_HOB_GUID_TYPE))