]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/Pei/Include/peihoblib.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Pei / Include / peihoblib.h
1 /*++
2
3 Copyright (c) 2004 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 PeiHobLib.h
15
16 Abstract:
17
18
19 --*/
20
21 #ifndef _EFI_PEI_HOB_LIB_H_
22 #define _EFI_PEI_HOB_LIB_H_
23
24 #include "PeiApi.h" // EFI_PEI_SERVICES definition
25 #define EFI_STACK_SIZE 0x20000
26 #define EFI_BSP_STORE_SIZE 0x4000
27
28 EFI_STATUS
29 BuildHobHandoffInfoTable (
30 IN VOID *HobStart,
31 IN UINT16 Version,
32 IN EFI_BOOT_MODE BootMode,
33 IN EFI_PHYSICAL_ADDRESS EfiMemoryTop,
34 IN EFI_PHYSICAL_ADDRESS EfiMemoryBottom,
35 IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop,
36 IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom
37 )
38 /*++
39
40 Routine Description:
41
42 Builds a HandoffInformationTable Information Table HOB
43
44 Arguments:
45
46 HobStart - Start pointer of hob list
47 Version - The version number pertaining to the PHIT HOB definition.
48 BootMode - The system boot mode as determined during the HOB producer phase.
49 EfiMemoryTop - The highest address location of memory that is allocated for use by the HOB
50 producer phase.
51 EfiMemoryBottom - The lowest address location of memory that is allocated for use by the HOB
52 producer phase.
53 EfiFreeMemoryTop - The highest address location of free memory that is currently available for use
54 by the HOB producer phase.
55 EfiFreeMemoryBottom - The lowest address location of free memory that is available for
56 use by the HOB producer phase.
57
58 Returns:
59
60 EFI_SUCCESS
61
62 --*/
63 ;
64
65 EFI_STATUS
66 BuildHobModule (
67 IN VOID *HobStart,
68 IN EFI_GUID *ModuleName,
69 IN EFI_PHYSICAL_ADDRESS Module,
70 IN UINT64 ModuleLength,
71 IN EFI_PHYSICAL_ADDRESS EntryPoint
72 )
73 /*++
74
75 Routine Description:
76
77 Builds a HOB for a loaded PE32 module
78
79 Arguments:
80
81 HobStart - Start pointer of hob list
82
83 ModuleName - The GUID File Name of the HON from the Firmware Volume
84
85 Module - The 64 bit physical address of the module
86
87 ModuleLength - The length of the module in bytes
88
89 EntryPoint - The 64 bit physical address of the entry point to the module
90
91 Returns:
92
93 EFI_SUCCESS
94 EFI_NOT_AVAILABLE_YET
95
96 --*/
97 ;
98
99 EFI_STATUS
100 BuildHobResourceDescriptor (
101 IN VOID *HobStart,
102 IN EFI_RESOURCE_TYPE ResourceType,
103 IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
104 IN EFI_PHYSICAL_ADDRESS PhysicalStart,
105 IN UINT64 NumberOfBytes
106 )
107 /*++
108
109 Routine Description:
110
111 Builds a HOB that describes a chunck of system memory
112
113 Arguments:
114
115 HobStart - Start pointer of hob list
116
117 ResourceType - The type of memory described by this HOB
118
119 ResourceAttribute - The memory attributes of the memory described by this HOB
120
121 PhysicalStart - The 64 bit physical address of memory described by this HOB
122
123 NumberOfBytes - The length of the memoty described by this HOB in bytes
124
125 Returns:
126
127 EFI_SUCCESS
128 EFI_NOT_AVAILABLE_YET
129
130 --*/
131 ;
132
133 EFI_STATUS
134 BuildHobGuidType (
135 IN VOID *HobStart,
136 IN EFI_GUID *Guid,
137 IN VOID *Buffer,
138 IN UINTN BufferSize
139 )
140 /*++
141
142 Routine Description:
143
144 Builds a custom HOB that is tagged with a GUID for identification
145
146 Arguments:
147
148 HobStart - Start pointer of hob list
149
150 Guid - The GUID of the custome HOB type
151
152 Buffer - A pointer to the data for the custom HOB type
153
154 BufferSize - The size in byte of BufferSize
155
156 Returns:
157
158 EFI_SUCCESS
159 EFI_NOT_AVAILABLE_YET
160
161 --*/
162 ;
163
164 EFI_STATUS
165 BuildHobFvDescriptor (
166 IN VOID *HobStart,
167 IN EFI_PHYSICAL_ADDRESS BaseAddress,
168 IN UINT64 Length
169 )
170 /*++
171
172 Routine Description:
173
174 Builds a Firmware Volume HOB
175
176 Arguments:
177
178 HobStart - Start pointer of hob list
179
180 BaseAddress - The base address of the Firmware Volume
181
182 Length - The size of the Firmware Volume in bytes
183
184 Returns:
185
186 EFI_SUCCESS
187 EFI_NOT_AVAILABLE_YET
188
189 --*/
190 ;
191
192 EFI_STATUS
193 BuildHobCpu (
194 IN VOID *HobStart,
195 IN UINT8 SizeOfMemorySpace,
196 IN UINT8 SizeOfIoSpace
197 )
198 /*++
199
200 Routine Description:
201
202 Builds a HOB for the CPU
203
204 Arguments:
205
206 HobStart - Start pointer of hob list
207
208 SizeOfMemorySpace - Identifies the maximum
209 physical memory addressibility of the processor.
210
211 SizeOfIoSpace - Identifies the maximum physical I/O addressibility
212 of the processor.
213
214 Returns:
215
216 EFI_SUCCESS
217 EFI_NOT_AVAILABLE_YET
218
219 --*/
220 ;
221
222 EFI_STATUS
223 BuildHobStack (
224 IN VOID *HobStart,
225 IN EFI_PHYSICAL_ADDRESS BaseAddress,
226 IN UINT64 Length
227 )
228 /*++
229
230 Routine Description:
231
232 Builds a HOB for the Stack
233
234 Arguments:
235
236 HobStart - Start pointer of hob list
237
238 BaseAddress - The 64 bit physical address of the Stack
239
240 Length - The length of the stack in bytes
241
242 Returns:
243
244 EFI_SUCCESS
245 EFI_NOT_AVAILABLE_YET
246
247 --*/
248 ;
249
250 EFI_STATUS
251 BuildHobBspStore (
252 IN VOID *HobStart,
253 IN EFI_PHYSICAL_ADDRESS BaseAddress,
254 IN UINT64 Length,
255 IN EFI_MEMORY_TYPE MemoryType
256 )
257 /*++
258
259 Routine Description:
260
261 Builds a HOB for the bsp store
262
263 Arguments:
264
265 HobStart - Start pointer of hob list
266
267 BaseAddress - The 64 bit physical address of bsp store
268
269 Length - The length of the bsp store in bytes
270
271 MemoryType - Memory type of the bsp store
272
273 Returns:
274
275 EFI_SUCCESS
276 EFI_NOT_AVAILABLE_YET
277
278 --*/
279 ;
280
281 EFI_STATUS
282 BuildMemoryAllocationHob (
283 IN VOID *HobStart,
284 IN EFI_PHYSICAL_ADDRESS BaseAddress,
285 IN UINT64 Length,
286 IN EFI_GUID *Name,
287 IN EFI_MEMORY_TYPE MemoryType
288 )
289 /*++
290
291 Routine Description:
292
293 Builds a HOB for memory allocation
294
295 Arguments:
296
297 HobStart - Start pointer of hob list
298
299 BaseAddress - The base address of memory allocated by this HOB.
300
301 Length - The length in bytes of memory allocated by this HOB.
302
303 Name - A GUID that defines the memory allocation region¡¯s type and purpose,
304 as well as other fields within the memory allocation HOB.
305
306 MemoryType - Defines the type of memory allocated by this HOB.
307
308 Returns:
309
310 EFI_SUCCESS
311 EFI_NOT_AVAILABLE_YET
312
313 --*/
314 ;
315
316 EFI_STATUS
317 GetFirstGuidHob (
318 IN VOID **HobStart,
319 IN EFI_GUID *Guid,
320 OUT VOID **Buffer,
321 OUT UINTN *BufferSize OPTIONAL
322 )
323 /*++
324
325 Routine Description:
326
327 This function searches the first instance of a HOB among the whole HOB list.
328
329 Arguments:
330
331 HobStart - A pointer to the start pointer of hob list.
332
333 Guid - A pointer to the GUID to match with in the HOB list.
334
335 Buffer - A pointer to the pointer to the data for the custom HOB type.
336
337 BufferSize - A Pointer to the size in byte of BufferSize.
338
339 Returns:
340 EFI_SUCCESS
341 The first instance of the matched GUID HOB among the whole HOB list
342
343 --*/
344 ;
345 #endif