]>
Commit | Line | Data |
---|---|---|
c311f86b | 1 | /** @file\r |
00edb218 | 2 | HOB related definitions in PI.\r |
959ccb23 | 3 | \r |
7b1bf9f6 | 4 | Copyright (c) 2006 - 2008, Intel Corporation \r |
00edb218 A |
5 | All rights reserved. This program and the accompanying materials \r |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
959ccb23 | 9 | \r |
00edb218 A |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
959ccb23 | 12 | \r |
00edb218 | 13 | @par Revision Reference:\r |
0047820e | 14 | PI Version 1.0\r |
959ccb23 | 15 | \r |
16 | **/\r | |
17 | \r | |
18 | #ifndef __PI_HOB_H__\r | |
19 | #define __PI_HOB_H__\r | |
20 | \r | |
0b3cac32 | 21 | #include <ProcessorBind.h>\r |
22 | #include <Pi/PiBootMode.h>\r | |
23 | #include <Uefi/UefiBaseType.h>\r | |
24 | #include <Uefi/UefiMultiPhase.h>\r | |
25 | \r | |
959ccb23 | 26 | //\r |
27 | // HobType of EFI_HOB_GENERIC_HEADER.\r | |
28 | // \r | |
00edb218 A |
29 | #define EFI_HOB_TYPE_HANDOFF 0x0001\r |
30 | #define EFI_HOB_TYPE_MEMORY_ALLOCATION 0x0002\r | |
31 | #define EFI_HOB_TYPE_RESOURCE_DESCRIPTOR 0x0003\r | |
32 | #define EFI_HOB_TYPE_GUID_EXTENSION 0x0004\r | |
33 | #define EFI_HOB_TYPE_FV 0x0005\r | |
34 | #define EFI_HOB_TYPE_CPU 0x0006\r | |
35 | #define EFI_HOB_TYPE_MEMORY_POOL 0x0007\r | |
36 | #define EFI_HOB_TYPE_FV2 0x0009\r | |
37 | #define EFI_HOB_TYPE_LOAD_PEIM 0x000A\r | |
38 | #define EFI_HOB_TYPE_UNUSED 0xFFFE\r | |
39 | #define EFI_HOB_TYPE_END_OF_HOB_LIST 0xFFFF\r | |
959ccb23 | 40 | \r |
dc53faa3 | 41 | ///\r |
42 | /// Describes the format and size of the data inside the HOB. \r | |
43 | /// All HOBs must contain this generic HOB header.\r | |
44 | /// \r | |
00edb218 A |
45 | typedef struct {\r |
46 | UINT16 HobType;\r | |
47 | UINT16 HobLength;\r | |
48 | UINT32 Reserved;\r | |
959ccb23 | 49 | } EFI_HOB_GENERIC_HEADER;\r |
50 | \r | |
51 | \r | |
dc53faa3 | 52 | ///\r |
53 | /// Value of version ofinEFI_HOB_HANDOFF_INFO_TABLE.\r | |
54 | /// \r | |
959ccb23 | 55 | #define EFI_HOB_HANDOFF_TABLE_VERSION 0x0009\r |
dc53faa3 | 56 | \r |
57 | ///\r | |
58 | /// Contains general state information used by the HOB producer phase. \r | |
59 | /// This HOB must be the first one in the HOB list.\r | |
60 | /// \r | |
00edb218 A |
61 | typedef struct {\r |
62 | EFI_HOB_GENERIC_HEADER Header;\r | |
63 | UINT32 Version;\r | |
64 | EFI_BOOT_MODE BootMode;\r | |
65 | EFI_PHYSICAL_ADDRESS EfiMemoryTop;\r | |
66 | EFI_PHYSICAL_ADDRESS EfiMemoryBottom;\r | |
67 | EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop;\r | |
68 | EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom;\r | |
69 | EFI_PHYSICAL_ADDRESS EfiEndOfHobList;\r | |
959ccb23 | 70 | } EFI_HOB_HANDOFF_INFO_TABLE;\r |
71 | \r | |
7b1bf9f6 | 72 | /// \r |
dc53faa3 | 73 | /// EFI_HOB_MEMORY_ALLOCATION_HEADER describes the\r |
74 | /// various attributes of the logical memory allocation. The type field will be used for\r | |
75 | /// subsequent inclusion in the UEFI memory map.\r | |
7b1bf9f6 | 76 | /// \r |
00edb218 | 77 | typedef struct {\r |
dc53faa3 | 78 | ///\r |
242942b2 | 79 | /// A GUID that defines the memory allocation region's type and purpose, as well as\r |
dc53faa3 | 80 | /// other fields within the memory allocation HOB. This GUID is used to define the\r |
81 | /// additional data within the HOB that may be present for the memory allocation HOB.\r | |
82 | /// Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0\r | |
83 | /// specification. \r | |
84 | /// \r | |
00edb218 | 85 | EFI_GUID Name;\r |
dc53faa3 | 86 | \r |
e31c47b9 | 87 | ///\r |
dc53faa3 | 88 | /// The base address of memory allocated by this HOB. Type\r |
89 | /// EFI_PHYSICAL_ADDRESS is defined in AllocatePages() in the UEFI 2.0\r | |
90 | /// specification.\r | |
e31c47b9 | 91 | ///\r |
00edb218 | 92 | EFI_PHYSICAL_ADDRESS MemoryBaseAddress;\r |
dc53faa3 | 93 | \r |
7b1bf9f6 | 94 | /// \r |
dc53faa3 | 95 | /// The length in bytes of memory allocated by this HOB.\r |
7b1bf9f6 | 96 | /// \r |
00edb218 | 97 | UINT64 MemoryLength;\r |
dc53faa3 | 98 | \r |
99 | ///\r | |
100 | /// Defines the type of memory allocated by this HOB. The memory type definition\r | |
101 | /// follows the EFI_MEMORY_TYPE definition. Type EFI_MEMORY_TYPE is defined\r | |
102 | /// in AllocatePages() in the UEFI 2.0 specification.\r | |
103 | /// \r | |
00edb218 A |
104 | EFI_MEMORY_TYPE MemoryType;\r |
105 | \r | |
dc53faa3 | 106 | ///\r |
107 | /// Padding for Itanium processor family\r | |
108 | ///\r | |
00edb218 | 109 | UINT8 Reserved[4];\r |
959ccb23 | 110 | } EFI_HOB_MEMORY_ALLOCATION_HEADER;\r |
111 | \r | |
dc53faa3 | 112 | ///\r |
113 | /// Describes all memory ranges used during the HOB producer \r | |
114 | /// phase that exist outside the HOB list. This HOB type \r | |
115 | /// describes how memory is used, \r | |
116 | /// not the physical attributes of memory.\r | |
117 | /// \r | |
00edb218 A |
118 | typedef struct {\r |
119 | EFI_HOB_GENERIC_HEADER Header;\r | |
120 | EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor;\r | |
121 | //\r | |
ac644614 | 122 | // Additional data pertaining to the "Name" Guid memory\r |
00edb218 A |
123 | // may go here.\r |
124 | //\r | |
959ccb23 | 125 | } EFI_HOB_MEMORY_ALLOCATION;\r |
126 | \r | |
127 | \r | |
dc53faa3 | 128 | ///\r |
129 | /// Describes the memory stack that is produced by the HOB producer \r | |
130 | /// phase and upon which all postmemory-installed executable\r | |
131 | /// content in the HOB producer phase is executing.\r | |
132 | /// \r | |
00edb218 A |
133 | typedef struct {\r |
134 | EFI_HOB_GENERIC_HEADER Header;\r | |
135 | EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor;\r | |
959ccb23 | 136 | } EFI_HOB_MEMORY_ALLOCATION_STACK;\r |
137 | \r | |
dc53faa3 | 138 | ///\r |
139 | /// Defines the location of the boot-strap \r | |
140 | /// processor (BSP) BSPStore ("Backing Store Pointer Store").\r | |
141 | /// This HOB is valid for the Itanium processor family only \r | |
142 | /// register overflow store.\r | |
143 | /// \r | |
00edb218 A |
144 | typedef struct {\r |
145 | EFI_HOB_GENERIC_HEADER Header;\r | |
146 | EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor;\r | |
959ccb23 | 147 | } EFI_HOB_MEMORY_ALLOCATION_BSP_STORE;\r |
148 | \r | |
dc53faa3 | 149 | ///\r |
150 | /// Defines the location and entry point of the HOB consumer phase.\r | |
151 | ///\r | |
959ccb23 | 152 | typedef struct {\r |
00edb218 A |
153 | EFI_HOB_GENERIC_HEADER Header;\r |
154 | EFI_HOB_MEMORY_ALLOCATION_HEADER MemoryAllocationHeader;\r | |
7b1bf9f6 | 155 | EFI_GUID ModuleName;\r |
156 | EFI_PHYSICAL_ADDRESS EntryPoint;\r | |
959ccb23 | 157 | } EFI_HOB_MEMORY_ALLOCATION_MODULE;\r |
158 | \r | |
dc53faa3 | 159 | ///\r |
e31c47b9 | 160 | /// Resource type \r |
dc53faa3 | 161 | /// \r |
959ccb23 | 162 | typedef UINT32 EFI_RESOURCE_TYPE;\r |
163 | \r | |
164 | //\r | |
165 | // Value of ResourceType in EFI_HOB_RESOURCE_DESCRIPTOR.\r | |
166 | // \r | |
00edb218 A |
167 | #define EFI_RESOURCE_SYSTEM_MEMORY 0x00000000\r |
168 | #define EFI_RESOURCE_MEMORY_MAPPED_IO 0x00000001\r | |
169 | #define EFI_RESOURCE_IO 0x00000002\r | |
170 | #define EFI_RESOURCE_FIRMWARE_DEVICE 0x00000003\r | |
171 | #define EFI_RESOURCE_MEMORY_MAPPED_IO_PORT 0x00000004\r | |
172 | #define EFI_RESOURCE_MEMORY_RESERVED 0x00000005\r | |
173 | #define EFI_RESOURCE_IO_RESERVED 0x00000006\r | |
174 | #define EFI_RESOURCE_MAX_MEMORY_TYPE 0x00000007\r | |
959ccb23 | 175 | \r |
dc53faa3 | 176 | ///\r |
177 | /// type of recount attribute type\r | |
178 | /// \r | |
959ccb23 | 179 | typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE;\r |
180 | \r | |
181 | //\r | |
182 | // These types can be ORed together as needed.\r | |
183 | //\r | |
184 | // The first three enumerations describe settings\r | |
185 | //\r | |
00edb218 A |
186 | #define EFI_RESOURCE_ATTRIBUTE_PRESENT 0x00000001\r |
187 | #define EFI_RESOURCE_ATTRIBUTE_INITIALIZED 0x00000002\r | |
188 | #define EFI_RESOURCE_ATTRIBUTE_TESTED 0x00000004\r | |
959ccb23 | 189 | //\r |
190 | // The rest of the settings describe capabilities\r | |
191 | //\r | |
7b1bf9f6 | 192 | #define EFI_RESOURCE_ATTRIBUTE_SINGLE_BIT_ECC 0x00000008\r |
193 | #define EFI_RESOURCE_ATTRIBUTE_MULTIPLE_BIT_ECC 0x00000010\r | |
194 | #define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_1 0x00000020\r | |
195 | #define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_2 0x00000040\r | |
196 | #define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED 0x00000080\r | |
197 | #define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED 0x00000100\r | |
198 | #define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED 0x00000200\r | |
199 | #define EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE 0x00000400\r | |
200 | #define EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE 0x00000800\r | |
00edb218 | 201 | #define EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE 0x00001000\r |
7b1bf9f6 | 202 | #define EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE 0x00002000\r |
203 | #define EFI_RESOURCE_ATTRIBUTE_16_BIT_IO 0x00004000\r | |
204 | #define EFI_RESOURCE_ATTRIBUTE_32_BIT_IO 0x00008000\r | |
205 | #define EFI_RESOURCE_ATTRIBUTE_64_BIT_IO 0x00010000\r | |
206 | #define EFI_RESOURCE_ATTRIBUTE_UNCACHED_EXPORTED 0x00020000\r | |
959ccb23 | 207 | \r |
dc53faa3 | 208 | ///\r |
209 | /// Describes the resource properties of all fixed, \r | |
210 | /// nonrelocatable resource ranges found on the processor\r | |
211 | /// host bus during the HOB producer phase.\r | |
212 | /// \r | |
00edb218 A |
213 | typedef struct {\r |
214 | EFI_HOB_GENERIC_HEADER Header;\r | |
215 | EFI_GUID Owner;\r | |
216 | EFI_RESOURCE_TYPE ResourceType;\r | |
217 | EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute;\r | |
218 | EFI_PHYSICAL_ADDRESS PhysicalStart;\r | |
219 | UINT64 ResourceLength;\r | |
959ccb23 | 220 | } EFI_HOB_RESOURCE_DESCRIPTOR;\r |
221 | \r | |
dc53faa3 | 222 | ///\r |
223 | /// Allows writers of executable content in the HOB producer phase to \r | |
224 | /// maintain and manage HOBs with specific GUID.\r | |
225 | /// \r | |
00edb218 A |
226 | typedef struct {\r |
227 | EFI_HOB_GENERIC_HEADER Header;\r | |
228 | EFI_GUID Name;\r | |
959ccb23 | 229 | \r |
dc53faa3 | 230 | ///\r |
231 | /// Guid specific data goes here\r | |
232 | ///\r | |
959ccb23 | 233 | } EFI_HOB_GUID_TYPE;\r |
234 | \r | |
dc53faa3 | 235 | ///\r |
236 | /// Details the location of firmware volumes that contain firmware files.\r | |
237 | /// \r | |
959ccb23 | 238 | typedef struct {\r |
00edb218 | 239 | EFI_HOB_GENERIC_HEADER Header;\r |
7b1bf9f6 | 240 | EFI_PHYSICAL_ADDRESS BaseAddress;\r |
241 | UINT64 Length;\r | |
959ccb23 | 242 | } EFI_HOB_FIRMWARE_VOLUME;\r |
243 | \r | |
dc53faa3 | 244 | ///\r |
245 | /// Details the location of a firmware volume which was extracted \r | |
246 | /// from a file within another firmware volume.\r | |
247 | /// \r | |
959ccb23 | 248 | typedef struct {\r |
00edb218 A |
249 | EFI_HOB_GENERIC_HEADER Header;\r |
250 | EFI_PHYSICAL_ADDRESS BaseAddress;\r | |
251 | UINT64 Length;\r | |
252 | EFI_GUID FvName;\r | |
253 | EFI_GUID FileName;\r | |
959ccb23 | 254 | } EFI_HOB_FIRMWARE_VOLUME2;\r |
255 | \r | |
256 | \r | |
dc53faa3 | 257 | ///\r |
258 | /// Describes processor information, such as address space and I/O space capabilities.\r | |
259 | ///\r | |
00edb218 A |
260 | typedef struct {\r |
261 | EFI_HOB_GENERIC_HEADER Header;\r | |
262 | UINT8 SizeOfMemorySpace;\r | |
263 | UINT8 SizeOfIoSpace;\r | |
264 | UINT8 Reserved[6];\r | |
959ccb23 | 265 | } EFI_HOB_CPU;\r |
266 | \r | |
267 | \r | |
dc53faa3 | 268 | ///\r |
269 | /// Describes pool memory allocations.\r | |
270 | /// \r | |
00edb218 A |
271 | typedef struct {\r |
272 | EFI_HOB_GENERIC_HEADER Header;\r | |
959ccb23 | 273 | } EFI_HOB_MEMORY_POOL;\r |
274 | \r | |
dc53faa3 | 275 | ///\r |
276 | /// Union of all the possible HOB Types\r | |
277 | ///\r | |
959ccb23 | 278 | typedef union {\r |
00edb218 A |
279 | EFI_HOB_GENERIC_HEADER *Header;\r |
280 | EFI_HOB_HANDOFF_INFO_TABLE *HandoffInformationTable;\r | |
281 | EFI_HOB_MEMORY_ALLOCATION *MemoryAllocation;\r | |
282 | EFI_HOB_MEMORY_ALLOCATION_BSP_STORE *MemoryAllocationBspStore;\r | |
283 | EFI_HOB_MEMORY_ALLOCATION_STACK *MemoryAllocationStack;\r | |
284 | EFI_HOB_MEMORY_ALLOCATION_MODULE *MemoryAllocationModule;\r | |
285 | EFI_HOB_RESOURCE_DESCRIPTOR *ResourceDescriptor;\r | |
286 | EFI_HOB_GUID_TYPE *Guid;\r | |
287 | EFI_HOB_FIRMWARE_VOLUME *FirmwareVolume;\r | |
07ad9b81 | 288 | EFI_HOB_FIRMWARE_VOLUME2 *FirmwareVolume2;\r |
00edb218 A |
289 | EFI_HOB_CPU *Cpu;\r |
290 | EFI_HOB_MEMORY_POOL *Pool;\r | |
291 | UINT8 *Raw;\r | |
959ccb23 | 292 | } EFI_PEI_HOB_POINTERS;\r |
293 | \r | |
294 | \r | |
295 | #endif \r |