3 Copyright (c) 2004 - 2007, 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
138 EFI_HOB_GENERIC_HEADER Header
;
140 EFI_RESOURCE_TYPE ResourceType
;
141 EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute
;
142 EFI_PHYSICAL_ADDRESS PhysicalStart
;
143 UINT64 ResourceLength
;
144 } EFI_HOB_RESOURCE_DESCRIPTOR
;
147 // GUID Extension HOB
148 // The HobLength is variable as it includes the GUID specific data.
150 #define EFI_HOB_TYPE_GUID_EXTENSION 0x0004
153 EFI_HOB_GENERIC_HEADER Header
;
157 // Guid specific data goes here
162 // Firmware Volume HOB
164 #define EFI_HOB_TYPE_FV 0x0005
167 EFI_HOB_GENERIC_HEADER Header
;
168 EFI_PHYSICAL_ADDRESS BaseAddress
;
170 } EFI_HOB_FIRMWARE_VOLUME
;
175 #define EFI_HOB_TYPE_CPU 0x0006
178 EFI_HOB_GENERIC_HEADER Header
;
179 UINT8 SizeOfMemorySpace
;
185 // PEI Core Memory Pool HOB
186 // The HobLength is variable as the HOB contains pool allocations by
187 // the PeiServices AllocatePool function
189 #define EFI_HOB_TYPE_PEI_MEMORY_POOL 0x0007
192 EFI_HOB_GENERIC_HEADER Header
;
193 } EFI_HOB_MEMORY_POOL
;
196 // Capsule volume HOB -- identical to a firmware volume
198 #define EFI_HOB_TYPE_CV 0x0008
201 EFI_HOB_GENERIC_HEADER Header
;
202 EFI_PHYSICAL_ADDRESS BaseAddress
;
204 } EFI_HOB_CAPSULE_VOLUME
;
206 #if (PI_SPECIFICATION_VERSION >= 0x00010000)
208 #define EFI_HOB_TYPE_FV2 0x0009
211 EFI_HOB_GENERIC_HEADER Header
;
212 EFI_PHYSICAL_ADDRESS BaseAddress
;
216 } EFI_HOB_FIRMWARE_VOLUME2
;
218 #define EFI_HOB_TYPE_LOAD_PEIM_UNUSED 0x000A
222 #define EFI_HOB_TYPE_UNUSED 0xFFFE
225 // Union of all the possible HOB Types
228 EFI_HOB_GENERIC_HEADER
*Header
;
229 EFI_HOB_HANDOFF_INFO_TABLE
*HandoffInformationTable
;
230 EFI_HOB_MEMORY_ALLOCATION
*MemoryAllocation
;
231 EFI_HOB_MEMORY_ALLOCATION_BSP_STORE
*MemoryAllocationBspStore
;
232 EFI_HOB_MEMORY_ALLOCATION_STACK
*MemoryAllocationStack
;
233 EFI_HOB_MEMORY_ALLOCATION_MODULE
*MemoryAllocationModule
;
234 EFI_HOB_RESOURCE_DESCRIPTOR
*ResourceDescriptor
;
235 EFI_HOB_GUID_TYPE
*Guid
;
236 EFI_HOB_FIRMWARE_VOLUME
*FirmwareVolume
;
237 #if (PI_SPECIFICATION_VERSION >= 0x00010000)
238 EFI_HOB_FIRMWARE_VOLUME2
*FirmwareVolume2
;
241 EFI_HOB_MEMORY_POOL
*Pool
;
242 EFI_HOB_CAPSULE_VOLUME
*CapsuleVolume
;
244 } EFI_PEI_HOB_POINTERS
;
246 #define GET_HOB_TYPE(Hob) ((Hob).Header->HobType)
247 #define GET_HOB_LENGTH(Hob) ((Hob).Header->HobLength)
248 #define GET_NEXT_HOB(Hob) ((Hob).Raw + GET_HOB_LENGTH (Hob))
249 #define END_OF_HOB_LIST(Hob) (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_END_OF_HOB_LIST)