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