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