3 Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 PEI Hand Off Block (HOB) definition.
20 The HOB is a memory data structure used to hand-off system information from
21 PEI to DXE (the next phase).
31 // Every Hob must start with this data structure.
37 } EFI_HOB_GENERIC_HEADER
;
40 // End of HOB List HOB
42 #define EFI_HOB_TYPE_END_OF_HOB_LIST 0xffff
45 // Handoff Information Table HOB
47 #define EFI_HOB_TYPE_HANDOFF 0x0001
49 #define EFI_HOB_HANDOFF_TABLE_VERSION 0x0009
51 typedef UINT32 EFI_BOOT_MODE
;
54 EFI_HOB_GENERIC_HEADER Header
;
56 EFI_BOOT_MODE BootMode
;
57 EFI_PHYSICAL_ADDRESS EfiMemoryTop
;
58 EFI_PHYSICAL_ADDRESS EfiMemoryBottom
;
59 EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop
;
60 EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom
;
61 EFI_PHYSICAL_ADDRESS EfiEndOfHobList
;
62 } EFI_HOB_HANDOFF_INFO_TABLE
;
65 // Memory Descriptor HOB
67 #define EFI_HOB_TYPE_MEMORY_ALLOCATION 0x0002
71 EFI_PHYSICAL_ADDRESS MemoryBaseAddress
;
73 EFI_MEMORY_TYPE MemoryType
;
75 } EFI_HOB_MEMORY_ALLOCATION_HEADER
;
78 EFI_HOB_GENERIC_HEADER Header
;
79 EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor
;
81 // Additional data pertaining to the "Name" Guid memory
84 } EFI_HOB_MEMORY_ALLOCATION
;
87 EFI_HOB_GENERIC_HEADER Header
;
88 EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor
;
89 } EFI_HOB_MEMORY_ALLOCATION_BSP_STORE
;
92 EFI_HOB_GENERIC_HEADER Header
;
93 EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor
;
94 } EFI_HOB_MEMORY_ALLOCATION_STACK
;
97 EFI_HOB_GENERIC_HEADER Header
;
98 EFI_HOB_MEMORY_ALLOCATION_HEADER MemoryAllocationHeader
;
100 EFI_PHYSICAL_ADDRESS EntryPoint
;
101 } EFI_HOB_MEMORY_ALLOCATION_MODULE
;
103 #define EFI_HOB_TYPE_RESOURCE_DESCRIPTOR 0x0003
105 typedef UINT32 EFI_RESOURCE_TYPE
;
107 #define EFI_RESOURCE_SYSTEM_MEMORY 0
108 #define EFI_RESOURCE_MEMORY_MAPPED_IO 1
109 #define EFI_RESOURCE_IO 2
110 #define EFI_RESOURCE_FIRMWARE_DEVICE 3
111 #define EFI_RESOURCE_MEMORY_MAPPED_IO_PORT 4
112 #define EFI_RESOURCE_MEMORY_RESERVED 5
113 #define EFI_RESOURCE_IO_RESERVED 6
114 #define EFI_RESOURCE_MAX_MEMORY_TYPE 7
116 typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE
;
118 #define EFI_RESOURCE_ATTRIBUTE_PRESENT 0x00000001
119 #define EFI_RESOURCE_ATTRIBUTE_INITIALIZED 0x00000002
120 #define EFI_RESOURCE_ATTRIBUTE_TESTED 0x00000004
121 #define EFI_RESOURCE_ATTRIBUTE_SINGLE_BIT_ECC 0x00000008
122 #define EFI_RESOURCE_ATTRIBUTE_MULTIPLE_BIT_ECC 0x00000010
123 #define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_1 0x00000020
124 #define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_2 0x00000040
125 #define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED 0x00000080
126 #define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED 0x00000100
127 #define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED 0x00000200
128 #define EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE 0x00000400
129 #define EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE 0x00000800
130 #define EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE 0x00001000
131 #define EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE 0x00002000
132 #define EFI_RESOURCE_ATTRIBUTE_16_BIT_IO 0x00004000
133 #define EFI_RESOURCE_ATTRIBUTE_32_BIT_IO 0x00008000
134 #define EFI_RESOURCE_ATTRIBUTE_64_BIT_IO 0x00010000
135 #define EFI_RESOURCE_ATTRIBUTE_UNCACHED_EXPORTED 0x00020000
137 // The following values are defined in PI 1.2 errata B.
139 #define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTABLE 0x00100000
140 #define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTABLE 0x00200000
141 #define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTABLE 0x00400000
144 EFI_HOB_GENERIC_HEADER Header
;
146 EFI_RESOURCE_TYPE ResourceType
;
147 EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute
;
148 EFI_PHYSICAL_ADDRESS PhysicalStart
;
149 UINT64 ResourceLength
;
150 } EFI_HOB_RESOURCE_DESCRIPTOR
;
153 // GUID Extension HOB
154 // The HobLength is variable as it includes the GUID specific data.
156 #define EFI_HOB_TYPE_GUID_EXTENSION 0x0004
159 EFI_HOB_GENERIC_HEADER Header
;
163 // Guid specific data goes here
168 // Firmware Volume HOB
170 #define EFI_HOB_TYPE_FV 0x0005
173 EFI_HOB_GENERIC_HEADER Header
;
174 EFI_PHYSICAL_ADDRESS BaseAddress
;
176 } EFI_HOB_FIRMWARE_VOLUME
;
181 #define EFI_HOB_TYPE_CPU 0x0006
184 EFI_HOB_GENERIC_HEADER Header
;
185 UINT8 SizeOfMemorySpace
;
191 // PEI Core Memory Pool HOB
192 // The HobLength is variable as the HOB contains pool allocations by
193 // the PeiServices AllocatePool function
195 #define EFI_HOB_TYPE_PEI_MEMORY_POOL 0x0007
198 EFI_HOB_GENERIC_HEADER Header
;
199 } EFI_HOB_MEMORY_POOL
;
202 // Capsule volume HOB -- identical to a firmware volume
204 #define EFI_HOB_TYPE_CV 0x0008
207 EFI_HOB_GENERIC_HEADER Header
;
208 EFI_PHYSICAL_ADDRESS BaseAddress
;
210 } EFI_HOB_CAPSULE_VOLUME
;
212 #if (PI_SPECIFICATION_VERSION >= 0x00010000)
214 #define EFI_HOB_TYPE_FV2 0x0009
217 EFI_HOB_GENERIC_HEADER Header
;
218 EFI_PHYSICAL_ADDRESS BaseAddress
;
222 } EFI_HOB_FIRMWARE_VOLUME2
;
224 #define EFI_HOB_TYPE_LOAD_PEIM_UNUSED 0x000A
228 #define EFI_HOB_TYPE_UNUSED 0xFFFE
231 // Union of all the possible HOB Types
234 EFI_HOB_GENERIC_HEADER
*Header
;
235 EFI_HOB_HANDOFF_INFO_TABLE
*HandoffInformationTable
;
236 EFI_HOB_MEMORY_ALLOCATION
*MemoryAllocation
;
237 EFI_HOB_MEMORY_ALLOCATION_BSP_STORE
*MemoryAllocationBspStore
;
238 EFI_HOB_MEMORY_ALLOCATION_STACK
*MemoryAllocationStack
;
239 EFI_HOB_MEMORY_ALLOCATION_MODULE
*MemoryAllocationModule
;
240 EFI_HOB_RESOURCE_DESCRIPTOR
*ResourceDescriptor
;
241 EFI_HOB_GUID_TYPE
*Guid
;
242 EFI_HOB_FIRMWARE_VOLUME
*FirmwareVolume
;
243 #if (PI_SPECIFICATION_VERSION >= 0x00010000)
244 EFI_HOB_FIRMWARE_VOLUME2
*FirmwareVolume2
;
247 EFI_HOB_MEMORY_POOL
*Pool
;
248 EFI_HOB_CAPSULE_VOLUME
*CapsuleVolume
;
250 } EFI_PEI_HOB_POINTERS
;
252 #define GET_HOB_TYPE(Hob) ((Hob).Header->HobType)
253 #define GET_HOB_LENGTH(Hob) ((Hob).Header->HobLength)
254 #define GET_NEXT_HOB(Hob) ((Hob).Raw + GET_HOB_LENGTH (Hob))
255 #define END_OF_HOB_LIST(Hob) (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_END_OF_HOB_LIST)