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