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