]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Pi/PiHob.h
Add missing definition of "EFI_PEI_DESCRIPTOR" in PI spec.
[mirror_edk2.git] / MdePkg / Include / Pi / PiHob.h
... / ...
CommitLineData
1/** @file\r
2 HOB related definitions in PI.\r
3\r
4 Copyright (c) 2006 - 2009, Intel Corporation \r
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
9\r
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
12\r
13 @par Revision Reference:\r
14 PI Version 1.0\r
15\r
16**/\r
17\r
18#ifndef __PI_HOB_H__\r
19#define __PI_HOB_H__\r
20\r
21//\r
22// HobType of EFI_HOB_GENERIC_HEADER.\r
23// \r
24#define EFI_HOB_TYPE_HANDOFF 0x0001\r
25#define EFI_HOB_TYPE_MEMORY_ALLOCATION 0x0002\r
26#define EFI_HOB_TYPE_RESOURCE_DESCRIPTOR 0x0003\r
27#define EFI_HOB_TYPE_GUID_EXTENSION 0x0004\r
28#define EFI_HOB_TYPE_FV 0x0005\r
29#define EFI_HOB_TYPE_CPU 0x0006\r
30#define EFI_HOB_TYPE_MEMORY_POOL 0x0007\r
31#define EFI_HOB_TYPE_FV2 0x0009\r
32#define EFI_HOB_TYPE_LOAD_PEIM 0x000A\r
33#define EFI_HOB_TYPE_UEFI_CAPSULE 0x000B\r
34#define EFI_HOB_TYPE_UNUSED 0xFFFE\r
35#define EFI_HOB_TYPE_END_OF_HOB_LIST 0xFFFF\r
36\r
37///\r
38/// Describes the format and size of the data inside the HOB. \r
39/// All HOBs must contain this generic HOB header.\r
40/// \r
41typedef struct {\r
42 ///\r
43 /// Identifies the HOB data structure type.\r
44 ///\r
45 UINT16 HobType;\r
46 ///\r
47 /// The length in bytes of the HOB.\r
48 ///\r
49 UINT16 HobLength;\r
50 ///\r
51 /// This field must always be set to zero.\r
52 ///\r
53 UINT32 Reserved;\r
54} EFI_HOB_GENERIC_HEADER;\r
55\r
56\r
57///\r
58/// Value of version ofinEFI_HOB_HANDOFF_INFO_TABLE.\r
59/// \r
60#define EFI_HOB_HANDOFF_TABLE_VERSION 0x0009\r
61\r
62///\r
63/// Contains general state information used by the HOB producer phase. \r
64/// This HOB must be the first one in the HOB list.\r
65/// \r
66typedef struct {\r
67 ///\r
68 /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_HANDOFF.\r
69 ///\r
70 EFI_HOB_GENERIC_HEADER Header;\r
71 ///\r
72 /// The version number pertaining to the PHIT HOB definition.\r
73 /// This value is 4 bytes in length to provide an 8-byte aligned entry \r
74 /// when it is combined with the 4-byte BootMode.\r
75 ///\r
76 UINT32 Version;\r
77 ///\r
78 /// The system boot mode as determined during the HOB producer phase.\r
79 ///\r
80 EFI_BOOT_MODE BootMode;\r
81 ///\r
82 /// The highest address location of memory that is allocated for use by the HOB producer\r
83 /// phase. This address must be 4-KB aligned to meet page restrictions of UEFI.\r
84 ///\r
85 EFI_PHYSICAL_ADDRESS EfiMemoryTop;\r
86 ///\r
87 /// The lowest address location of memory that is allocated for use by the HOB producer phase.\r
88 ///\r
89 EFI_PHYSICAL_ADDRESS EfiMemoryBottom;\r
90 ///\r
91 /// The highest address location of free memory that is currently available \r
92 /// for use by the HOB producer phase.\r
93 ///\r
94 EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop;\r
95 ///\r
96 /// The lowest address location of free memory that is available for use by the HOB producer phase.\r
97 ///\r
98 EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom;\r
99 ///\r
100 /// The end of the HOB list.\r
101 ///\r
102 EFI_PHYSICAL_ADDRESS EfiEndOfHobList;\r
103} EFI_HOB_HANDOFF_INFO_TABLE;\r
104\r
105/// \r
106/// EFI_HOB_MEMORY_ALLOCATION_HEADER describes the\r
107/// various attributes of the logical memory allocation. The type field will be used for\r
108/// subsequent inclusion in the UEFI memory map.\r
109/// \r
110typedef struct {\r
111 ///\r
112 /// A GUID that defines the memory allocation region's type and purpose, as well as\r
113 /// other fields within the memory allocation HOB. This GUID is used to define the\r
114 /// additional data within the HOB that may be present for the memory allocation HOB.\r
115 /// Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0\r
116 /// specification. \r
117 /// \r
118 EFI_GUID Name;\r
119\r
120 ///\r
121 /// The base address of memory allocated by this HOB. Type\r
122 /// EFI_PHYSICAL_ADDRESS is defined in AllocatePages() in the UEFI 2.0\r
123 /// specification.\r
124 ///\r
125 EFI_PHYSICAL_ADDRESS MemoryBaseAddress;\r
126\r
127 /// \r
128 /// The length in bytes of memory allocated by this HOB.\r
129 /// \r
130 UINT64 MemoryLength;\r
131\r
132 ///\r
133 /// Defines the type of memory allocated by this HOB. The memory type definition\r
134 /// follows the EFI_MEMORY_TYPE definition. Type EFI_MEMORY_TYPE is defined\r
135 /// in AllocatePages() in the UEFI 2.0 specification.\r
136 /// \r
137 EFI_MEMORY_TYPE MemoryType;\r
138\r
139 ///\r
140 /// Padding for Itanium processor family\r
141 ///\r
142 UINT8 Reserved[4];\r
143} EFI_HOB_MEMORY_ALLOCATION_HEADER;\r
144\r
145///\r
146/// Describes all memory ranges used during the HOB producer \r
147/// phase that exist outside the HOB list. This HOB type \r
148/// describes how memory is used, not the physical attributes of memory.\r
149///\r
150typedef struct {\r
151 ///\r
152 /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION.\r
153 ///\r
154 EFI_HOB_GENERIC_HEADER Header;\r
155 ///\r
156 /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the\r
157 /// various attributes of the logical memory allocation.\r
158 ///\r
159 EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor;\r
160 //\r
161 // Additional data pertaining to the "Name" Guid memory\r
162 // may go here.\r
163 //\r
164} EFI_HOB_MEMORY_ALLOCATION;\r
165\r
166\r
167///\r
168/// Describes the memory stack that is produced by the HOB producer \r
169/// phase and upon which all postmemory-installed executable\r
170/// content in the HOB producer phase is executing.\r
171/// \r
172typedef struct {\r
173 ///\r
174 /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION.\r
175 ///\r
176 EFI_HOB_GENERIC_HEADER Header;\r
177 ///\r
178 /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the\r
179 /// various attributes of the logical memory allocation.\r
180 ///\r
181 EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor;\r
182} EFI_HOB_MEMORY_ALLOCATION_STACK;\r
183\r
184///\r
185/// Defines the location of the boot-strap \r
186/// processor (BSP) BSPStore ("Backing Store Pointer Store").\r
187/// This HOB is valid for the Itanium processor family only \r
188/// register overflow store.\r
189/// \r
190typedef struct {\r
191 ///\r
192 /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION.\r
193 ///\r
194 EFI_HOB_GENERIC_HEADER Header;\r
195 ///\r
196 /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the\r
197 /// various attributes of the logical memory allocation.\r
198 ///\r
199 EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor;\r
200} EFI_HOB_MEMORY_ALLOCATION_BSP_STORE;\r
201\r
202///\r
203/// Defines the location and entry point of the HOB consumer phase.\r
204///\r
205typedef struct {\r
206 ///\r
207 /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION.\r
208 ///\r
209 EFI_HOB_GENERIC_HEADER Header;\r
210 ///\r
211 /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the\r
212 /// various attributes of the logical memory allocation.\r
213 ///\r
214 EFI_HOB_MEMORY_ALLOCATION_HEADER MemoryAllocationHeader;\r
215 ///\r
216 /// The GUID specifying the values of the firmware file system name \r
217 /// that contains the HOB consumer phase component.\r
218 ///\r
219 EFI_GUID ModuleName;\r
220 ///\r
221 /// The address of the memory-mapped firmware volume \r
222 /// that contains the HOB consumer phase firmware file.\r
223 ///\r
224 EFI_PHYSICAL_ADDRESS EntryPoint;\r
225} EFI_HOB_MEMORY_ALLOCATION_MODULE;\r
226\r
227///\r
228/// Resource type \r
229/// \r
230typedef UINT32 EFI_RESOURCE_TYPE;\r
231\r
232//\r
233// Value of ResourceType in EFI_HOB_RESOURCE_DESCRIPTOR.\r
234// \r
235#define EFI_RESOURCE_SYSTEM_MEMORY 0x00000000\r
236#define EFI_RESOURCE_MEMORY_MAPPED_IO 0x00000001\r
237#define EFI_RESOURCE_IO 0x00000002\r
238#define EFI_RESOURCE_FIRMWARE_DEVICE 0x00000003\r
239#define EFI_RESOURCE_MEMORY_MAPPED_IO_PORT 0x00000004\r
240#define EFI_RESOURCE_MEMORY_RESERVED 0x00000005\r
241#define EFI_RESOURCE_IO_RESERVED 0x00000006\r
242#define EFI_RESOURCE_MAX_MEMORY_TYPE 0x00000007\r
243\r
244///\r
245/// type of recount attribute type\r
246/// \r
247typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE;\r
248\r
249//\r
250// These types can be ORed together as needed.\r
251//\r
252// The first three enumerations describe settings\r
253//\r
254#define EFI_RESOURCE_ATTRIBUTE_PRESENT 0x00000001\r
255#define EFI_RESOURCE_ATTRIBUTE_INITIALIZED 0x00000002\r
256#define EFI_RESOURCE_ATTRIBUTE_TESTED 0x00000004\r
257//\r
258// The rest of the settings describe capabilities\r
259//\r
260#define EFI_RESOURCE_ATTRIBUTE_SINGLE_BIT_ECC 0x00000008\r
261#define EFI_RESOURCE_ATTRIBUTE_MULTIPLE_BIT_ECC 0x00000010\r
262#define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_1 0x00000020\r
263#define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_2 0x00000040\r
264#define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED 0x00000080\r
265#define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED 0x00000100\r
266#define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED 0x00000200\r
267#define EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE 0x00000400\r
268#define EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE 0x00000800\r
269#define EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE 0x00001000\r
270#define EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE 0x00002000\r
271#define EFI_RESOURCE_ATTRIBUTE_16_BIT_IO 0x00004000\r
272#define EFI_RESOURCE_ATTRIBUTE_32_BIT_IO 0x00008000\r
273#define EFI_RESOURCE_ATTRIBUTE_64_BIT_IO 0x00010000\r
274#define EFI_RESOURCE_ATTRIBUTE_UNCACHED_EXPORTED 0x00020000\r
275\r
276///\r
277/// Describes the resource properties of all fixed, \r
278/// nonrelocatable resource ranges found on the processor\r
279/// host bus during the HOB producer phase.\r
280/// \r
281typedef struct {\r
282 ///\r
283 /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_RESOURCE_DESCRIPTOR.\r
284 ///\r
285 EFI_HOB_GENERIC_HEADER Header;\r
286 ///\r
287 /// A GUID representing the owner of the resource. This GUID is used by HOB\r
288 /// consumer phase components to correlate device ownership of a resource.\r
289 ///\r
290 EFI_GUID Owner;\r
291 ///\r
292 /// Resource type enumeration as defined by EFI_RESOURCE_TYPE.\r
293 ///\r
294 EFI_RESOURCE_TYPE ResourceType;\r
295 ///\r
296 /// Resource attributes as defined by EFI_RESOURCE_ATTRIBUTE_TYPE.\r
297 ///\r
298 EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute;\r
299 ///\r
300 /// Physical start address of the resource region. \r
301 ///\r
302 EFI_PHYSICAL_ADDRESS PhysicalStart;\r
303 ///\r
304 /// Number of bytes of the resource region.\r
305 ///\r
306 UINT64 ResourceLength;\r
307} EFI_HOB_RESOURCE_DESCRIPTOR;\r
308\r
309///\r
310/// Allows writers of executable content in the HOB producer phase to \r
311/// maintain and manage HOBs with specific GUID.\r
312/// \r
313typedef struct {\r
314 ///\r
315 /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_GUID_EXTENSION.\r
316 ///\r
317 EFI_HOB_GENERIC_HEADER Header;\r
318 ///\r
319 /// A GUID that defines the contents of this HOB.\r
320 ///\r
321 EFI_GUID Name;\r
322 //\r
323 // Guid specific data goes here\r
324 //\r
325} EFI_HOB_GUID_TYPE;\r
326\r
327///\r
328/// Details the location of firmware volumes that contain firmware files.\r
329/// \r
330typedef struct {\r
331 ///\r
332 /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_FV.\r
333 ///\r
334 EFI_HOB_GENERIC_HEADER Header;\r
335 ///\r
336 /// The physical memory-mapped base address of the firmware volume.\r
337 ///\r
338 EFI_PHYSICAL_ADDRESS BaseAddress;\r
339 ///\r
340 /// The length in bytes of the firmware volume.\r
341 ///\r
342 UINT64 Length;\r
343} EFI_HOB_FIRMWARE_VOLUME;\r
344\r
345///\r
346/// Details the location of a firmware volume which was extracted \r
347/// from a file within another firmware volume.\r
348/// \r
349typedef struct {\r
350 ///\r
351 /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_FV2.\r
352 ///\r
353 EFI_HOB_GENERIC_HEADER Header;\r
354 ///\r
355 /// The physical memory-mapped base address of the firmware volume.\r
356 ///\r
357 EFI_PHYSICAL_ADDRESS BaseAddress;\r
358 ///\r
359 /// The length in bytes of the firmware volume.\r
360 ///\r
361 UINT64 Length;\r
362 ///\r
363 /// The name of the firmware volume.\r
364 ///\r
365 EFI_GUID FvName;\r
366 ///\r
367 /// The name of the firmware file which contained this firmware volume.\r
368 ///\r
369 EFI_GUID FileName;\r
370} EFI_HOB_FIRMWARE_VOLUME2;\r
371\r
372\r
373///\r
374/// Describes processor information, such as address space and I/O space capabilities.\r
375///\r
376typedef struct {\r
377 ///\r
378 /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_CPU.\r
379 ///\r
380 EFI_HOB_GENERIC_HEADER Header;\r
381 ///\r
382 /// Identifies the maximum physical memory addressability of the processor.\r
383 ///\r
384 UINT8 SizeOfMemorySpace;\r
385 ///\r
386 /// Identifies the maximum physical I/O addressability of the processor.\r
387 ///\r
388 UINT8 SizeOfIoSpace;\r
389 ///\r
390 /// This field will always be set to zero.\r
391 ///\r
392 UINT8 Reserved[6];\r
393} EFI_HOB_CPU;\r
394\r
395\r
396///\r
397/// Describes pool memory allocations.\r
398/// \r
399typedef struct {\r
400 ///\r
401 /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_POOL.\r
402 ///\r
403 EFI_HOB_GENERIC_HEADER Header;\r
404} EFI_HOB_MEMORY_POOL;\r
405\r
406///\r
407/// Each UEFI capsule HOB details the location of a UEFI capsule. It includes a base address and length\r
408/// which is based upon memory blocks with a EFI_CAPSULE_HEADER and the associated\r
409/// CapsuleImageSize-based payloads. These HOB's shall be created by the PEI PI firmware\r
410/// sometime after the UEFI UpdateCapsule service invocation with the\r
411/// CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE flag set in the EFI_CAPSULE_HEADER.\r
412///\r
413typedef struct {\r
414 ///\r
415 /// The HOB generic header where Header.HobType = EFI_HOB_TYPE_UEFI_CAPSULE.\r
416 ///\r
417 EFI_HOB_GENERIC_HEADER Header;\r
418 \r
419 ///\r
420 /// The physical memory-mapped base address of an UEFI capsule. This value is set to\r
421 /// point to the base of the contiguous memory of the UEFI capsule.\r
422 /// The length of the contiguous memory in bytes\r
423 ///\r
424 EFI_PHYSICAL_ADDRESS BaseAddress;\r
425 UINT64 Length;\r
426} EFI_HOB_UEFI_CAPSULE;\r
427\r
428///\r
429/// Union of all the possible HOB Types\r
430///\r
431typedef union {\r
432 EFI_HOB_GENERIC_HEADER *Header;\r
433 EFI_HOB_HANDOFF_INFO_TABLE *HandoffInformationTable;\r
434 EFI_HOB_MEMORY_ALLOCATION *MemoryAllocation;\r
435 EFI_HOB_MEMORY_ALLOCATION_BSP_STORE *MemoryAllocationBspStore;\r
436 EFI_HOB_MEMORY_ALLOCATION_STACK *MemoryAllocationStack;\r
437 EFI_HOB_MEMORY_ALLOCATION_MODULE *MemoryAllocationModule;\r
438 EFI_HOB_RESOURCE_DESCRIPTOR *ResourceDescriptor;\r
439 EFI_HOB_GUID_TYPE *Guid;\r
440 EFI_HOB_FIRMWARE_VOLUME *FirmwareVolume;\r
441 EFI_HOB_FIRMWARE_VOLUME2 *FirmwareVolume2;\r
442 EFI_HOB_CPU *Cpu;\r
443 EFI_HOB_MEMORY_POOL *Pool;\r
444 EFI_HOB_UEFI_CAPSULE *Capsule;\r
445 UINT8 *Raw;\r
446} EFI_PEI_HOB_POINTERS;\r
447\r
448\r
449#endif \r