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