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