1 | /** @file
|
---|
2 | Library that helps implement monolithic PEI. (SEC goes to DXE)
|
---|
3 |
|
---|
4 | Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
---|
5 |
|
---|
6 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
7 |
|
---|
8 | **/
|
---|
9 |
|
---|
10 | #ifndef __PRE_PI_LIB_H__
|
---|
11 | #define __PRE_PI_LIB_H__
|
---|
12 |
|
---|
13 | #include <Guid/ExtractSection.h>
|
---|
14 |
|
---|
15 | /**
|
---|
16 | This service enables discovery of additional firmware volumes.
|
---|
17 |
|
---|
18 | @param Instance This instance of the firmware volume to find. The value 0 is the
|
---|
19 | Boot Firmware Volume (BFV).
|
---|
20 | @param FwVolHeader Pointer to the firmware volume header of the volume to return.
|
---|
21 |
|
---|
22 | @retval EFI_SUCCESS The volume was found.
|
---|
23 | @retval EFI_NOT_FOUND The volume was not found.
|
---|
24 | @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
|
---|
25 |
|
---|
26 | **/
|
---|
27 | EFI_STATUS
|
---|
28 | EFIAPI
|
---|
29 | FfsFindNextVolume (
|
---|
30 | IN UINTN Instance,
|
---|
31 | IN OUT EFI_PEI_FV_HANDLE *VolumeHandle
|
---|
32 | );
|
---|
33 |
|
---|
34 |
|
---|
35 | /**
|
---|
36 | This service enables discovery of additional firmware files.
|
---|
37 |
|
---|
38 | @param SearchType A filter to find files only of this type.
|
---|
39 | @param FwVolHeader Pointer to the firmware volume header of the volume to search.
|
---|
40 | This parameter must point to a valid FFS volume.
|
---|
41 | @param FileHeader Pointer to the current file from which to begin searching.
|
---|
42 |
|
---|
43 | @retval EFI_SUCCESS The file was found.
|
---|
44 | @retval EFI_NOT_FOUND The file was not found.
|
---|
45 | @retval EFI_NOT_FOUND The header checksum was not zero.
|
---|
46 |
|
---|
47 | **/
|
---|
48 | EFI_STATUS
|
---|
49 | EFIAPI
|
---|
50 | FfsFindNextFile (
|
---|
51 | IN EFI_FV_FILETYPE SearchType,
|
---|
52 | IN EFI_PEI_FV_HANDLE VolumeHandle,
|
---|
53 | IN OUT EFI_PEI_FILE_HANDLE *FileHandle
|
---|
54 | );
|
---|
55 |
|
---|
56 |
|
---|
57 | /**
|
---|
58 | This service enables discovery sections of a given type within a valid FFS file.
|
---|
59 |
|
---|
60 | @param SearchType The value of the section type to find.
|
---|
61 | @param FfsFileHeader A pointer to the file header that contains the set of sections to
|
---|
62 | be searched.
|
---|
63 | @param SectionData A pointer to the discovered section, if successful.
|
---|
64 |
|
---|
65 | @retval EFI_SUCCESS The section was found.
|
---|
66 | @retval EFI_NOT_FOUND The section was not found.
|
---|
67 |
|
---|
68 | **/
|
---|
69 | EFI_STATUS
|
---|
70 | EFIAPI
|
---|
71 | FfsFindSectionData (
|
---|
72 | IN EFI_SECTION_TYPE SectionType,
|
---|
73 | IN EFI_PEI_FILE_HANDLE FileHandle,
|
---|
74 | OUT VOID **SectionData
|
---|
75 | );
|
---|
76 |
|
---|
77 |
|
---|
78 | /**
|
---|
79 | Find a file in the volume by name
|
---|
80 |
|
---|
81 | @param FileName A pointer to the name of the file to
|
---|
82 | find within the firmware volume.
|
---|
83 |
|
---|
84 | @param VolumeHandle The firmware volume to search FileHandle
|
---|
85 | Upon exit, points to the found file's
|
---|
86 | handle or NULL if it could not be found.
|
---|
87 |
|
---|
88 | @retval EFI_SUCCESS File was found.
|
---|
89 |
|
---|
90 | @retval EFI_NOT_FOUND File was not found.
|
---|
91 |
|
---|
92 | @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or
|
---|
93 | FileName was NULL.
|
---|
94 |
|
---|
95 | **/
|
---|
96 | EFI_STATUS
|
---|
97 | EFIAPI
|
---|
98 | FfsFindFileByName (
|
---|
99 | IN CONST EFI_GUID *FileName,
|
---|
100 | IN CONST EFI_PEI_FV_HANDLE VolumeHandle,
|
---|
101 | OUT EFI_PEI_FILE_HANDLE *FileHandle
|
---|
102 | );
|
---|
103 |
|
---|
104 |
|
---|
105 | /**
|
---|
106 | Get information about the file by name.
|
---|
107 |
|
---|
108 | @param FileHandle Handle of the file.
|
---|
109 |
|
---|
110 | @param FileInfo Upon exit, points to the file's
|
---|
111 | information.
|
---|
112 |
|
---|
113 | @retval EFI_SUCCESS File information returned.
|
---|
114 |
|
---|
115 | @retval EFI_INVALID_PARAMETER If FileHandle does not
|
---|
116 | represent a valid file.
|
---|
117 |
|
---|
118 | @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
|
---|
119 |
|
---|
120 | **/
|
---|
121 | EFI_STATUS
|
---|
122 | EFIAPI
|
---|
123 | FfsGetFileInfo (
|
---|
124 | IN CONST EFI_PEI_FILE_HANDLE FileHandle,
|
---|
125 | OUT EFI_FV_FILE_INFO *FileInfo
|
---|
126 | );
|
---|
127 |
|
---|
128 |
|
---|
129 | /**
|
---|
130 | Get Information about the volume by name
|
---|
131 |
|
---|
132 | @param VolumeHandle Handle of the volume.
|
---|
133 |
|
---|
134 | @param VolumeInfo Upon exit, points to the volume's
|
---|
135 | information.
|
---|
136 |
|
---|
137 | @retval EFI_SUCCESS File information returned.
|
---|
138 |
|
---|
139 | @retval EFI_INVALID_PARAMETER If FileHandle does not
|
---|
140 | represent a valid file.
|
---|
141 |
|
---|
142 | @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
|
---|
143 |
|
---|
144 | **/
|
---|
145 | EFI_STATUS
|
---|
146 | EFIAPI
|
---|
147 | FfsGetVolumeInfo (
|
---|
148 | IN EFI_PEI_FV_HANDLE VolumeHandle,
|
---|
149 | OUT EFI_FV_INFO *VolumeInfo
|
---|
150 | );
|
---|
151 |
|
---|
152 |
|
---|
153 |
|
---|
154 | /**
|
---|
155 | Get Fv image from the FV type file, then add FV & FV2 Hob.
|
---|
156 |
|
---|
157 | @param FileHandle File handle of a Fv type file.
|
---|
158 |
|
---|
159 | @retval EFI_NOT_FOUND FV image can't be found.
|
---|
160 | @retval EFI_SUCCESS Successfully to process it.
|
---|
161 |
|
---|
162 | **/
|
---|
163 | EFI_STATUS
|
---|
164 | EFIAPI
|
---|
165 | FfsProcessFvFile (
|
---|
166 | IN EFI_PEI_FILE_HANDLE FvFileHandle
|
---|
167 | );
|
---|
168 |
|
---|
169 |
|
---|
170 | /**
|
---|
171 | Search through every FV until you find a file of type FileType
|
---|
172 |
|
---|
173 | @param FileType File handle of a Fv type file.
|
---|
174 | @param Volumehandle On success Volume Handle of the match
|
---|
175 | @param FileHandle On success File Handle of the match
|
---|
176 |
|
---|
177 | @retval EFI_NOT_FOUND FV image can't be found.
|
---|
178 | @retval EFI_SUCCESS Successfully found FileType
|
---|
179 |
|
---|
180 | **/
|
---|
181 | EFI_STATUS
|
---|
182 | EFIAPI
|
---|
183 | FfsAnyFvFindFirstFile (
|
---|
184 | IN EFI_FV_FILETYPE FileType,
|
---|
185 | OUT EFI_PEI_FV_HANDLE *VolumeHandle,
|
---|
186 | OUT EFI_PEI_FILE_HANDLE *FileHandle
|
---|
187 | );
|
---|
188 |
|
---|
189 |
|
---|
190 | /**
|
---|
191 | Get Fv image from the FV type file, then add FV & FV2 Hob.
|
---|
192 |
|
---|
193 | @param FileHandle File handle of a Fv type file.
|
---|
194 |
|
---|
195 |
|
---|
196 | @retval EFI_NOT_FOUND FV image can't be found.
|
---|
197 | @retval EFI_SUCCESS Successfully to process it.
|
---|
198 |
|
---|
199 | **/
|
---|
200 | EFI_STATUS
|
---|
201 | EFIAPI
|
---|
202 | FfsProcessFvFile (
|
---|
203 | IN EFI_PEI_FILE_HANDLE FvFileHandle
|
---|
204 | );
|
---|
205 |
|
---|
206 |
|
---|
207 | /**
|
---|
208 | This service enables PEIMs to ascertain the present value of the boot mode.
|
---|
209 |
|
---|
210 |
|
---|
211 | @retval BootMode
|
---|
212 |
|
---|
213 | **/
|
---|
214 | EFI_BOOT_MODE
|
---|
215 | EFIAPI
|
---|
216 | GetBootMode (
|
---|
217 | VOID
|
---|
218 | );
|
---|
219 |
|
---|
220 |
|
---|
221 | /**
|
---|
222 | This service enables PEIMs to update the boot mode variable.
|
---|
223 |
|
---|
224 | @param BootMode The value of the boot mode to set.
|
---|
225 |
|
---|
226 | @retval EFI_SUCCESS The value was successfully updated
|
---|
227 |
|
---|
228 | **/
|
---|
229 | EFI_STATUS
|
---|
230 | EFIAPI
|
---|
231 | SetBootMode (
|
---|
232 | IN EFI_BOOT_MODE BootMode
|
---|
233 | );
|
---|
234 |
|
---|
235 | /**
|
---|
236 | This service enables a PEIM to ascertain the address of the list of HOBs in memory.
|
---|
237 |
|
---|
238 | @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize.
|
---|
239 |
|
---|
240 | @retval EFI_SUCCESS The list was successfully returned.
|
---|
241 | @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
|
---|
242 |
|
---|
243 | **/
|
---|
244 | VOID *
|
---|
245 | EFIAPI
|
---|
246 | GetHobList (
|
---|
247 | VOID
|
---|
248 | );
|
---|
249 |
|
---|
250 |
|
---|
251 | /**
|
---|
252 | Updates the pointer to the HOB list.
|
---|
253 |
|
---|
254 | @param HobList Hob list pointer to store
|
---|
255 |
|
---|
256 | **/
|
---|
257 | EFI_STATUS
|
---|
258 | EFIAPI
|
---|
259 | SetHobList (
|
---|
260 | IN VOID *HobList
|
---|
261 | );
|
---|
262 |
|
---|
263 | EFI_HOB_HANDOFF_INFO_TABLE*
|
---|
264 | HobConstructor (
|
---|
265 | IN VOID *EfiMemoryBegin,
|
---|
266 | IN UINTN EfiMemoryLength,
|
---|
267 | IN VOID *EfiFreeMemoryBottom,
|
---|
268 | IN VOID *EfiFreeMemoryTop
|
---|
269 | );
|
---|
270 |
|
---|
271 | /**
|
---|
272 | This service enables PEIMs to create various types of HOBs.
|
---|
273 |
|
---|
274 | @param Type The type of HOB to be installed.
|
---|
275 | @param Length The length of the HOB to be added.
|
---|
276 |
|
---|
277 | @retval !NULL The HOB was successfully created.
|
---|
278 | @retval NULL There is no additional space for HOB creation.
|
---|
279 |
|
---|
280 | **/
|
---|
281 | VOID *
|
---|
282 | CreateHob (
|
---|
283 | IN UINT16 HobType,
|
---|
284 | IN UINT16 HobLenght
|
---|
285 | );
|
---|
286 |
|
---|
287 |
|
---|
288 | /**
|
---|
289 | Returns the next instance of a HOB type from the starting HOB.
|
---|
290 |
|
---|
291 | This function searches the first instance of a HOB type from the starting HOB pointer.
|
---|
292 | If there does not exist such HOB type from the starting HOB pointer, it will return NULL.
|
---|
293 | In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer
|
---|
294 | unconditionally: it returns HobStart back if HobStart itself meets the requirement;
|
---|
295 | caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.
|
---|
296 | If HobStart is NULL, then ASSERT().
|
---|
297 |
|
---|
298 | @param Type The HOB type to return.
|
---|
299 | @param HobStart The starting HOB pointer to search from.
|
---|
300 |
|
---|
301 | @return The next instance of a HOB type from the starting HOB.
|
---|
302 |
|
---|
303 | **/
|
---|
304 | VOID *
|
---|
305 | EFIAPI
|
---|
306 | GetNextHob (
|
---|
307 | IN UINT16 Type,
|
---|
308 | IN CONST VOID *HobStart
|
---|
309 | );
|
---|
310 |
|
---|
311 | /**
|
---|
312 | Returns the first instance of a HOB type among the whole HOB list.
|
---|
313 |
|
---|
314 | This function searches the first instance of a HOB type among the whole HOB list.
|
---|
315 | If there does not exist such HOB type in the HOB list, it will return NULL.
|
---|
316 |
|
---|
317 | @param Type The HOB type to return.
|
---|
318 |
|
---|
319 | @return The next instance of a HOB type from the starting HOB.
|
---|
320 |
|
---|
321 | **/
|
---|
322 | VOID *
|
---|
323 | EFIAPI
|
---|
324 | GetFirstHob (
|
---|
325 | IN UINT16 Type
|
---|
326 | );
|
---|
327 |
|
---|
328 | /**
|
---|
329 | This function searches the first instance of a HOB from the starting HOB pointer.
|
---|
330 | Such HOB should satisfy two conditions:
|
---|
331 | its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
|
---|
332 | If there does not exist such HOB from the starting HOB pointer, it will return NULL.
|
---|
333 | Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()
|
---|
334 | to extract the data section and its size info respectively.
|
---|
335 | In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer
|
---|
336 | unconditionally: it returns HobStart back if HobStart itself meets the requirement;
|
---|
337 | caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.
|
---|
338 | If Guid is NULL, then ASSERT().
|
---|
339 | If HobStart is NULL, then ASSERT().
|
---|
340 |
|
---|
341 | @param Guid The GUID to match with in the HOB list.
|
---|
342 | @param HobStart A pointer to a Guid.
|
---|
343 |
|
---|
344 | @return The next instance of the matched GUID HOB from the starting HOB.
|
---|
345 |
|
---|
346 | **/
|
---|
347 | VOID *
|
---|
348 | EFIAPI
|
---|
349 | GetNextGuidHob (
|
---|
350 | IN CONST EFI_GUID *Guid,
|
---|
351 | IN CONST VOID *HobStart
|
---|
352 | );
|
---|
353 |
|
---|
354 | /**
|
---|
355 | This function searches the first instance of a HOB among the whole HOB list.
|
---|
356 | Such HOB should satisfy two conditions:
|
---|
357 | its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
|
---|
358 | If there does not exist such HOB from the starting HOB pointer, it will return NULL.
|
---|
359 | Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()
|
---|
360 | to extract the data section and its size info respectively.
|
---|
361 | If Guid is NULL, then ASSERT().
|
---|
362 |
|
---|
363 | @param Guid The GUID to match with in the HOB list.
|
---|
364 |
|
---|
365 | @return The first instance of the matched GUID HOB among the whole HOB list.
|
---|
366 |
|
---|
367 | **/
|
---|
368 | VOID *
|
---|
369 | EFIAPI
|
---|
370 | GetFirstGuidHob (
|
---|
371 | IN CONST EFI_GUID *Guid
|
---|
372 | );
|
---|
373 |
|
---|
374 |
|
---|
375 | /**
|
---|
376 | Builds a HOB for a loaded PE32 module.
|
---|
377 |
|
---|
378 | This function builds a HOB for a loaded PE32 module.
|
---|
379 | It can only be invoked during PEI phase;
|
---|
380 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
|
---|
381 | If ModuleName is NULL, then ASSERT().
|
---|
382 | If there is no additional space for HOB creation, then ASSERT().
|
---|
383 |
|
---|
384 | @param ModuleName The GUID File Name of the module.
|
---|
385 | @param MemoryAllocationModule The 64 bit physical address of the module.
|
---|
386 | @param ModuleLength The length of the module in bytes.
|
---|
387 | @param EntryPoint The 64 bit physical address of the module entry point.
|
---|
388 |
|
---|
389 | **/
|
---|
390 | VOID
|
---|
391 | EFIAPI
|
---|
392 | BuildModuleHob (
|
---|
393 | IN CONST EFI_GUID *ModuleName,
|
---|
394 | IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,
|
---|
395 | IN UINT64 ModuleLength,
|
---|
396 | IN EFI_PHYSICAL_ADDRESS EntryPoint
|
---|
397 | );
|
---|
398 |
|
---|
399 | /**
|
---|
400 | Builds a HOB that describes a chunk of system memory.
|
---|
401 |
|
---|
402 | This function builds a HOB that describes a chunk of system memory.
|
---|
403 | It can only be invoked during PEI phase;
|
---|
404 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
|
---|
405 | If there is no additional space for HOB creation, then ASSERT().
|
---|
406 |
|
---|
407 | @param ResourceType The type of resource described by this HOB.
|
---|
408 | @param ResourceAttribute The resource attributes of the memory described by this HOB.
|
---|
409 | @param PhysicalStart The 64 bit physical address of memory described by this HOB.
|
---|
410 | @param NumberOfBytes The length of the memory described by this HOB in bytes.
|
---|
411 |
|
---|
412 | **/
|
---|
413 | VOID
|
---|
414 | EFIAPI
|
---|
415 | BuildResourceDescriptorHob (
|
---|
416 | IN EFI_RESOURCE_TYPE ResourceType,
|
---|
417 | IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
|
---|
418 | IN EFI_PHYSICAL_ADDRESS PhysicalStart,
|
---|
419 | IN UINT64 NumberOfBytes
|
---|
420 | );
|
---|
421 |
|
---|
422 | /**
|
---|
423 | Builds a GUID HOB with a certain data length.
|
---|
424 |
|
---|
425 | This function builds a customized HOB tagged with a GUID for identification
|
---|
426 | and returns the start address of GUID HOB data so that caller can fill the customized data.
|
---|
427 | The HOB Header and Name field is already stripped.
|
---|
428 | It can only be invoked during PEI phase;
|
---|
429 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
|
---|
430 | If Guid is NULL, then ASSERT().
|
---|
431 | If there is no additional space for HOB creation, then ASSERT().
|
---|
432 | If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
|
---|
433 |
|
---|
434 | @param Guid The GUID to tag the customized HOB.
|
---|
435 | @param DataLength The size of the data payload for the GUID HOB.
|
---|
436 |
|
---|
437 | @return The start address of GUID HOB data.
|
---|
438 |
|
---|
439 | **/
|
---|
440 | VOID *
|
---|
441 | EFIAPI
|
---|
442 | BuildGuidHob (
|
---|
443 | IN CONST EFI_GUID *Guid,
|
---|
444 | IN UINTN DataLength
|
---|
445 | );
|
---|
446 |
|
---|
447 | /**
|
---|
448 | Copies a data buffer to a newly-built HOB.
|
---|
449 |
|
---|
450 | This function builds a customized HOB tagged with a GUID for identification,
|
---|
451 | copies the input data to the HOB data field and returns the start address of the GUID HOB data.
|
---|
452 | The HOB Header and Name field is already stripped.
|
---|
453 | It can only be invoked during PEI phase;
|
---|
454 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
|
---|
455 | If Guid is NULL, then ASSERT().
|
---|
456 | If Data is NULL and DataLength > 0, then ASSERT().
|
---|
457 | If there is no additional space for HOB creation, then ASSERT().
|
---|
458 | If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
|
---|
459 |
|
---|
460 | @param Guid The GUID to tag the customized HOB.
|
---|
461 | @param Data The data to be copied into the data field of the GUID HOB.
|
---|
462 | @param DataLength The size of the data payload for the GUID HOB.
|
---|
463 |
|
---|
464 | @return The start address of GUID HOB data.
|
---|
465 |
|
---|
466 | **/
|
---|
467 | VOID *
|
---|
468 | EFIAPI
|
---|
469 | BuildGuidDataHob (
|
---|
470 | IN CONST EFI_GUID *Guid,
|
---|
471 | IN VOID *Data,
|
---|
472 | IN UINTN DataLength
|
---|
473 | );
|
---|
474 |
|
---|
475 | /**
|
---|
476 | Builds a Firmware Volume HOB.
|
---|
477 |
|
---|
478 | This function builds a Firmware Volume HOB.
|
---|
479 | It can only be invoked during PEI phase;
|
---|
480 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
|
---|
481 | If there is no additional space for HOB creation, then ASSERT().
|
---|
482 |
|
---|
483 | @param BaseAddress The base address of the Firmware Volume.
|
---|
484 | @param Length The size of the Firmware Volume in bytes.
|
---|
485 |
|
---|
486 | **/
|
---|
487 | VOID
|
---|
488 | EFIAPI
|
---|
489 | BuildFvHob (
|
---|
490 | IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
---|
491 | IN UINT64 Length
|
---|
492 | );
|
---|
493 |
|
---|
494 | /**
|
---|
495 | Builds a Firmware Volume HOB and a resource descriptor hob
|
---|
496 |
|
---|
497 | This function builds a Firmware Volume HOB.
|
---|
498 | It can only be invoked during PEI phase;
|
---|
499 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
|
---|
500 | If there is no additional space for HOB creation, then ASSERT().
|
---|
501 |
|
---|
502 | @param BaseAddress The base address of the Firmware Volume.
|
---|
503 | @param Length The size of the Firmware Volume in bytes.
|
---|
504 |
|
---|
505 | **/
|
---|
506 | VOID
|
---|
507 | EFIAPI
|
---|
508 | BuildFvHobs (
|
---|
509 | IN EFI_PHYSICAL_ADDRESS PhysicalStart,
|
---|
510 | IN UINT64 NumberOfBytes,
|
---|
511 | IN EFI_RESOURCE_ATTRIBUTE_TYPE *ResourceAttribute OPTIONAL
|
---|
512 | );
|
---|
513 |
|
---|
514 |
|
---|
515 | /**
|
---|
516 | Builds a EFI_HOB_TYPE_FV2 HOB.
|
---|
517 |
|
---|
518 | This function builds a EFI_HOB_TYPE_FV2 HOB.
|
---|
519 | It can only be invoked during PEI phase;
|
---|
520 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
|
---|
521 | If there is no additional space for HOB creation, then ASSERT().
|
---|
522 |
|
---|
523 | @param BaseAddress The base address of the Firmware Volume.
|
---|
524 | @param Length The size of the Firmware Volume in bytes.
|
---|
525 | @param FvName The name of the Firmware Volume.
|
---|
526 | @param FileName The name of the file.
|
---|
527 |
|
---|
528 | **/
|
---|
529 | VOID
|
---|
530 | EFIAPI
|
---|
531 | BuildFv2Hob (
|
---|
532 | IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
---|
533 | IN UINT64 Length,
|
---|
534 | IN CONST EFI_GUID *FvName,
|
---|
535 | IN CONST EFI_GUID *FileName
|
---|
536 | );
|
---|
537 |
|
---|
538 | /**
|
---|
539 | Builds a Capsule Volume HOB.
|
---|
540 |
|
---|
541 | This function builds a Capsule Volume HOB.
|
---|
542 | It can only be invoked during PEI phase;
|
---|
543 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
|
---|
544 | If there is no additional space for HOB creation, then ASSERT().
|
---|
545 |
|
---|
546 | @param BaseAddress The base address of the Capsule Volume.
|
---|
547 | @param Length The size of the Capsule Volume in bytes.
|
---|
548 |
|
---|
549 | **/
|
---|
550 | VOID
|
---|
551 | EFIAPI
|
---|
552 | BuildCvHob (
|
---|
553 | IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
---|
554 | IN UINT64 Length
|
---|
555 | );
|
---|
556 |
|
---|
557 | /**
|
---|
558 | Builds a HOB for the CPU.
|
---|
559 |
|
---|
560 | This function builds a HOB for the CPU.
|
---|
561 | It can only be invoked during PEI phase;
|
---|
562 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
|
---|
563 | If there is no additional space for HOB creation, then ASSERT().
|
---|
564 |
|
---|
565 | @param SizeOfMemorySpace The maximum physical memory addressability of the processor.
|
---|
566 | @param SizeOfIoSpace The maximum physical I/O addressability of the processor.
|
---|
567 |
|
---|
568 | **/
|
---|
569 | VOID
|
---|
570 | EFIAPI
|
---|
571 | BuildCpuHob (
|
---|
572 | IN UINT8 SizeOfMemorySpace,
|
---|
573 | IN UINT8 SizeOfIoSpace
|
---|
574 | );
|
---|
575 |
|
---|
576 | /**
|
---|
577 | Builds a HOB for the Stack.
|
---|
578 |
|
---|
579 | This function builds a HOB for the stack.
|
---|
580 | It can only be invoked during PEI phase;
|
---|
581 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
|
---|
582 | If there is no additional space for HOB creation, then ASSERT().
|
---|
583 |
|
---|
584 | @param BaseAddress The 64 bit physical address of the Stack.
|
---|
585 | @param Length The length of the stack in bytes.
|
---|
586 |
|
---|
587 | **/
|
---|
588 | VOID
|
---|
589 | EFIAPI
|
---|
590 | BuildStackHob (
|
---|
591 | IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
---|
592 | IN UINT64 Length
|
---|
593 | );
|
---|
594 |
|
---|
595 | /**
|
---|
596 | Update the Stack Hob if the stack has been moved
|
---|
597 |
|
---|
598 | @param BaseAddress The 64 bit physical address of the Stack.
|
---|
599 | @param Length The length of the stack in bytes.
|
---|
600 |
|
---|
601 | **/
|
---|
602 | VOID
|
---|
603 | UpdateStackHob (
|
---|
604 | IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
---|
605 | IN UINT64 Length
|
---|
606 | );
|
---|
607 |
|
---|
608 |
|
---|
609 | /**
|
---|
610 | Builds a HOB for the BSP store.
|
---|
611 |
|
---|
612 | This function builds a HOB for BSP store.
|
---|
613 | It can only be invoked during PEI phase;
|
---|
614 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
|
---|
615 | If there is no additional space for HOB creation, then ASSERT().
|
---|
616 |
|
---|
617 | @param BaseAddress The 64 bit physical address of the BSP.
|
---|
618 | @param Length The length of the BSP store in bytes.
|
---|
619 | @param MemoryType Type of memory allocated by this HOB.
|
---|
620 |
|
---|
621 | **/
|
---|
622 | VOID
|
---|
623 | EFIAPI
|
---|
624 | BuildBspStoreHob (
|
---|
625 | IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
---|
626 | IN UINT64 Length,
|
---|
627 | IN EFI_MEMORY_TYPE MemoryType
|
---|
628 | );
|
---|
629 |
|
---|
630 | /**
|
---|
631 | Builds a HOB for the memory allocation.
|
---|
632 |
|
---|
633 | This function builds a HOB for the memory allocation.
|
---|
634 | It can only be invoked during PEI phase;
|
---|
635 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
|
---|
636 | If there is no additional space for HOB creation, then ASSERT().
|
---|
637 |
|
---|
638 | @param BaseAddress The 64 bit physical address of the memory.
|
---|
639 | @param Length The length of the memory allocation in bytes.
|
---|
640 | @param MemoryType Type of memory allocated by this HOB.
|
---|
641 |
|
---|
642 | **/
|
---|
643 | VOID
|
---|
644 | EFIAPI
|
---|
645 | BuildMemoryAllocationHob (
|
---|
646 | IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
---|
647 | IN UINT64 Length,
|
---|
648 | IN EFI_MEMORY_TYPE MemoryType
|
---|
649 | );
|
---|
650 |
|
---|
651 |
|
---|
652 | VOID
|
---|
653 | EFIAPI
|
---|
654 | BuildExtractSectionHob (
|
---|
655 | IN EFI_GUID *Guid,
|
---|
656 | IN EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER SectionGetInfo,
|
---|
657 | IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER SectionExtraction
|
---|
658 | );
|
---|
659 |
|
---|
660 | VOID
|
---|
661 | EFIAPI
|
---|
662 | BuildPeCoffLoaderHob (
|
---|
663 | VOID
|
---|
664 | );
|
---|
665 |
|
---|
666 |
|
---|
667 | /**
|
---|
668 | Allocates one or more 4KB pages of type EfiBootServicesData.
|
---|
669 |
|
---|
670 | Allocates the number of 4KB pages of MemoryType and returns a pointer to the
|
---|
671 | allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
|
---|
672 | is returned. If there is not enough memory remaining to satisfy the request, then NULL is
|
---|
673 | returned.
|
---|
674 |
|
---|
675 | @param Pages The number of 4 KB pages to allocate.
|
---|
676 |
|
---|
677 | @return A pointer to the allocated buffer or NULL if allocation fails.
|
---|
678 |
|
---|
679 | **/
|
---|
680 | VOID *
|
---|
681 | EFIAPI
|
---|
682 | AllocatePages (
|
---|
683 | IN UINTN Pages
|
---|
684 | );
|
---|
685 |
|
---|
686 | /**
|
---|
687 | Allocates a buffer of type EfiBootServicesData.
|
---|
688 |
|
---|
689 | Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a
|
---|
690 | pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
|
---|
691 | returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
|
---|
692 |
|
---|
693 | @param AllocationSize The number of bytes to allocate.
|
---|
694 |
|
---|
695 | @return A pointer to the allocated buffer or NULL if allocation fails.
|
---|
696 |
|
---|
697 | **/
|
---|
698 | VOID *
|
---|
699 | EFIAPI
|
---|
700 | AllocatePool (
|
---|
701 | IN UINTN AllocationSize
|
---|
702 | );
|
---|
703 |
|
---|
704 |
|
---|
705 | /**
|
---|
706 | Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.
|
---|
707 |
|
---|
708 | Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an
|
---|
709 | alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is
|
---|
710 | returned. If there is not enough memory at the specified alignment remaining to satisfy the
|
---|
711 | request, then NULL is returned.
|
---|
712 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().
|
---|
713 |
|
---|
714 | @param Pages The number of 4 KB pages to allocate.
|
---|
715 | @param Alignment The requested alignment of the allocation. Must be a power of two.
|
---|
716 | If Alignment is zero, then byte alignment is used.
|
---|
717 |
|
---|
718 | @return A pointer to the allocated buffer or NULL if allocation fails.
|
---|
719 |
|
---|
720 | **/
|
---|
721 | VOID *
|
---|
722 | EFIAPI
|
---|
723 | AllocateAlignedPages (
|
---|
724 | IN UINTN Pages,
|
---|
725 | IN UINTN Alignment
|
---|
726 | );
|
---|
727 |
|
---|
728 |
|
---|
729 | EFI_STATUS
|
---|
730 | EFIAPI
|
---|
731 | LoadPeCoffImage (
|
---|
732 | IN VOID *PeCoffImage,
|
---|
733 | OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
|
---|
734 | OUT UINT64 *ImageSize,
|
---|
735 | OUT EFI_PHYSICAL_ADDRESS *EntryPoint
|
---|
736 | );
|
---|
737 |
|
---|
738 | EFI_STATUS
|
---|
739 | EFIAPI
|
---|
740 | LoadDxeCoreFromFfsFile (
|
---|
741 | IN EFI_PEI_FILE_HANDLE FileHandle,
|
---|
742 | IN UINTN StackSize
|
---|
743 | );
|
---|
744 |
|
---|
745 | EFI_STATUS
|
---|
746 | EFIAPI
|
---|
747 | LoadDxeCoreFromFv (
|
---|
748 | IN UINTN *FvInstance, OPTIONAL
|
---|
749 | IN UINTN StackSize
|
---|
750 | );
|
---|
751 |
|
---|
752 | EFI_STATUS
|
---|
753 | EFIAPI
|
---|
754 | DecompressFirstFv (
|
---|
755 | VOID
|
---|
756 | );
|
---|
757 |
|
---|
758 | #endif
|
---|