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