2 Implementation for PEI Services Library.
4 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #include <Ppi/FirmwareVolumeInfo.h>
13 #include <Ppi/FirmwareVolumeInfo2.h>
14 #include <Guid/FirmwareFileSystem2.h>
16 #include <Library/PeiServicesLib.h>
17 #include <Library/PeiServicesTablePointerLib.h>
18 #include <Library/DebugLib.h>
19 #include <Library/MemoryAllocationLib.h>
20 #include <Library/BaseMemoryLib.h>
23 This service enables a given PEIM to register an interface into the PEI Foundation.
25 @param PpiList A pointer to the list of interfaces that the caller shall install.
27 @retval EFI_SUCCESS The interface was successfully installed.
28 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
29 @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
30 EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
31 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
36 PeiServicesInstallPpi (
37 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
40 CONST EFI_PEI_SERVICES
**PeiServices
;
42 PeiServices
= GetPeiServicesTablePointer ();
43 return (*PeiServices
)->InstallPpi (PeiServices
, PpiList
);
47 This service enables PEIMs to replace an entry in the PPI database with an alternate entry.
49 @param OldPpi The pointer to the old PEI PPI Descriptors.
50 @param NewPpi The pointer to the new PEI PPI Descriptors.
52 @retval EFI_SUCCESS The interface was successfully installed.
53 @retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
54 @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
55 EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
56 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
57 @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been
63 PeiServicesReInstallPpi (
64 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
65 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
68 CONST EFI_PEI_SERVICES
**PeiServices
;
70 PeiServices
= GetPeiServicesTablePointer ();
71 return (*PeiServices
)->ReInstallPpi (PeiServices
, OldPpi
, NewPpi
);
75 This service enables PEIMs to discover a given instance of an interface.
77 @param Guid A pointer to the GUID whose corresponding interface needs to be
79 @param Instance The N-th instance of the interface that is required.
80 @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
81 @param Ppi A pointer to the instance of the interface.
83 @retval EFI_SUCCESS The interface was successfully returned.
84 @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
89 PeiServicesLocatePpi (
90 IN CONST EFI_GUID
*Guid
,
92 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
, OPTIONAL
96 CONST EFI_PEI_SERVICES
**PeiServices
;
98 PeiServices
= GetPeiServicesTablePointer ();
99 return (*PeiServices
)->LocatePpi (PeiServices
, Guid
, Instance
, PpiDescriptor
, Ppi
);
103 This service enables PEIMs to register a given service to be invoked when another service is
104 installed or reinstalled.
106 @param NotifyList A pointer to the list of notification interfaces
107 that the caller shall install.
109 @retval EFI_SUCCESS The interface was successfully installed.
110 @retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
111 @retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do
112 not have the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES
113 bit set in the Flags field.
114 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
119 PeiServicesNotifyPpi (
120 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
123 CONST EFI_PEI_SERVICES
**PeiServices
;
125 PeiServices
= GetPeiServicesTablePointer ();
126 return (*PeiServices
)->NotifyPpi (PeiServices
, NotifyList
);
130 This service enables PEIMs to ascertain the present value of the boot mode.
132 @param BootMode A pointer to contain the value of the boot mode.
134 @retval EFI_SUCCESS The boot mode was returned successfully.
135 @retval EFI_INVALID_PARAMETER BootMode is NULL.
140 PeiServicesGetBootMode (
141 OUT EFI_BOOT_MODE
*BootMode
144 CONST EFI_PEI_SERVICES
**PeiServices
;
146 PeiServices
= GetPeiServicesTablePointer ();
147 return (*PeiServices
)->GetBootMode (PeiServices
, BootMode
);
151 This service enables PEIMs to update the boot mode variable.
153 @param BootMode The value of the boot mode to set.
155 @retval EFI_SUCCESS The value was successfully updated
160 PeiServicesSetBootMode (
161 IN EFI_BOOT_MODE BootMode
164 CONST EFI_PEI_SERVICES
**PeiServices
;
166 PeiServices
= GetPeiServicesTablePointer ();
167 return (*PeiServices
)->SetBootMode (PeiServices
, BootMode
);
171 This service enables a PEIM to ascertain the address of the list of HOBs in memory.
173 @param HobList A pointer to the list of HOBs that the PEI Foundation
176 @retval EFI_SUCCESS The list was successfully returned.
177 @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
182 PeiServicesGetHobList (
186 CONST EFI_PEI_SERVICES
**PeiServices
;
188 PeiServices
= GetPeiServicesTablePointer ();
189 return (*PeiServices
)->GetHobList (PeiServices
, HobList
);
193 This service enables PEIMs to create various types of HOBs.
195 @param Type The type of HOB to be installed.
196 @param Length The length of the HOB to be added.
197 @param Hob The address of a pointer that will contain the
200 @retval EFI_SUCCESS The HOB was successfully created.
201 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
206 PeiServicesCreateHob (
212 CONST EFI_PEI_SERVICES
**PeiServices
;
214 PeiServices
= GetPeiServicesTablePointer ();
215 return (*PeiServices
)->CreateHob (PeiServices
, Type
, Length
, Hob
);
219 This service enables PEIMs to discover additional firmware volumes.
221 @param Instance This instance of the firmware volume to find. The
222 value 0 is the Boot Firmware Volume (BFV).
223 @param VolumeHandle Handle of the firmware volume header of the volume
226 @retval EFI_SUCCESS The volume was found.
227 @retval EFI_NOT_FOUND The volume was not found.
228 @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
233 PeiServicesFfsFindNextVolume (
235 IN OUT EFI_PEI_FV_HANDLE
*VolumeHandle
238 CONST EFI_PEI_SERVICES
**PeiServices
;
240 PeiServices
= GetPeiServicesTablePointer ();
241 return (*PeiServices
)->FfsFindNextVolume (PeiServices
, Instance
, VolumeHandle
);
245 This service enables PEIMs to discover additional firmware files.
247 @param SearchType A filter to find files only of this type.
248 @param VolumeHandle The pointer to the firmware volume header of the
249 volume to search. This parameter must point to a
251 @param FileHandle Handle of the current file from which to begin searching.
253 @retval EFI_SUCCESS The file was found.
254 @retval EFI_NOT_FOUND The file was not found.
255 @retval EFI_NOT_FOUND The header checksum was not zero.
260 PeiServicesFfsFindNextFile (
261 IN EFI_FV_FILETYPE SearchType
,
262 IN EFI_PEI_FV_HANDLE VolumeHandle
,
263 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
266 CONST EFI_PEI_SERVICES
**PeiServices
;
268 PeiServices
= GetPeiServicesTablePointer ();
269 return (*PeiServices
)->FfsFindNextFile (PeiServices
, SearchType
, VolumeHandle
, FileHandle
);
273 This service enables PEIMs to discover sections of a given type within a valid FFS file.
275 @param SectionType The value of the section type to find.
276 @param FileHandle A pointer to the file header that contains the set
277 of sections to be searched.
278 @param SectionData A pointer to the discovered section, if successful.
280 @retval EFI_SUCCESS The section was found.
281 @retval EFI_NOT_FOUND The section was not found.
286 PeiServicesFfsFindSectionData (
287 IN EFI_SECTION_TYPE SectionType
,
288 IN EFI_PEI_FILE_HANDLE FileHandle
,
289 OUT VOID
**SectionData
292 CONST EFI_PEI_SERVICES
**PeiServices
;
294 PeiServices
= GetPeiServicesTablePointer ();
295 return (*PeiServices
)->FfsFindSectionData (PeiServices
, SectionType
, FileHandle
, SectionData
);
299 This service enables PEIMs to discover sections of a given instance and type within a valid FFS file.
301 @param SectionType The value of the section type to find.
302 @param SectionInstance Section instance to find.
303 @param FileHandle A pointer to the file header that contains the set
304 of sections to be searched.
305 @param SectionData A pointer to the discovered section, if successful.
306 @param AuthenticationStatus A pointer to the authentication status for this section.
308 @retval EFI_SUCCESS The section was found.
309 @retval EFI_NOT_FOUND The section was not found.
314 PeiServicesFfsFindSectionData3 (
315 IN EFI_SECTION_TYPE SectionType
,
316 IN UINTN SectionInstance
,
317 IN EFI_PEI_FILE_HANDLE FileHandle
,
318 OUT VOID
**SectionData
,
319 OUT UINT32
*AuthenticationStatus
322 CONST EFI_PEI_SERVICES
**PeiServices
;
324 PeiServices
= GetPeiServicesTablePointer ();
325 return (*PeiServices
)->FindSectionData3 (PeiServices
, SectionType
, SectionInstance
, FileHandle
, SectionData
, AuthenticationStatus
);
329 This service enables PEIMs to register the permanent memory configuration
330 that has been initialized with the PEI Foundation.
332 @param MemoryBegin The value of a region of installed memory.
333 @param MemoryLength The corresponding length of a region of installed memory.
335 @retval EFI_SUCCESS The region was successfully installed in a HOB.
336 @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
337 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
342 PeiServicesInstallPeiMemory (
343 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
344 IN UINT64 MemoryLength
347 CONST EFI_PEI_SERVICES
**PeiServices
;
349 PeiServices
= GetPeiServicesTablePointer ();
350 return (*PeiServices
)->InstallPeiMemory (PeiServices
, MemoryBegin
, MemoryLength
);
354 This service enables PEIMs to allocate memory.
356 @param MemoryType Type of memory to allocate.
357 @param Pages The number of pages to allocate.
358 @param Memory Pointer of memory allocated.
360 @retval EFI_SUCCESS The memory range was successfully allocated.
361 @retval EFI_INVALID_PARAMETER Type is not equal to EfiLoaderCode, EfiLoaderData, EfiRuntimeServicesCode,
362 EfiRuntimeServicesData, EfiBootServicesCode, EfiBootServicesData,
363 EfiACPIReclaimMemory, EfiReservedMemoryType, or EfiACPIMemoryNVS.
364 @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
369 PeiServicesAllocatePages (
370 IN EFI_MEMORY_TYPE MemoryType
,
372 OUT EFI_PHYSICAL_ADDRESS
*Memory
375 CONST EFI_PEI_SERVICES
**PeiServices
;
377 PeiServices
= GetPeiServicesTablePointer ();
378 return (*PeiServices
)->AllocatePages (PeiServices
, MemoryType
, Pages
, Memory
);
382 This service enables PEIMs to free memory.
384 @param Memory Memory to be freed.
385 @param Pages The number of pages to free.
387 @retval EFI_SUCCESS The requested pages were freed.
388 @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.
389 @retval EFI_NOT_FOUND The requested memory pages were not allocated with
395 PeiServicesFreePages (
396 IN EFI_PHYSICAL_ADDRESS Memory
,
400 CONST EFI_PEI_SERVICES
**PeiServices
;
402 PeiServices
= GetPeiServicesTablePointer ();
403 return (*PeiServices
)->FreePages (PeiServices
, Memory
, Pages
);
407 This service allocates memory from the Hand-Off Block (HOB) heap.
409 @param Size The number of bytes to allocate from the pool.
410 @param Buffer If the call succeeds, a pointer to a pointer to
411 the allocate buffer; otherwise, undefined.
413 @retval EFI_SUCCESS The allocation was successful
414 @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
419 PeiServicesAllocatePool (
424 CONST EFI_PEI_SERVICES
**PeiServices
;
426 PeiServices
= GetPeiServicesTablePointer ();
427 return (*PeiServices
)->AllocatePool (PeiServices
, Size
, Buffer
);
431 Resets the entire platform.
433 @retval EFI_SUCCESS The function completed successfully.
434 @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
439 PeiServicesResetSystem (
443 CONST EFI_PEI_SERVICES
**PeiServices
;
445 PeiServices
= GetPeiServicesTablePointer ();
446 return (*PeiServices
)->ResetSystem (PeiServices
);
450 This service is a wrapper for the PEI Service RegisterForShadow(), except the
451 pointer to the PEI Services Table has been removed. See the Platform
452 Initialization Pre-EFI Initialization Core Interface Specification for details.
454 @param FileHandle PEIM's file handle. Must be the currently
457 @retval EFI_SUCCESS The PEIM was successfully registered for
460 @retval EFI_ALREADY_STARTED The PEIM was previously
461 registered for shadowing.
463 @retval EFI_NOT_FOUND The FileHandle does not refer to a
468 PeiServicesRegisterForShadow (
469 IN EFI_PEI_FILE_HANDLE FileHandle
472 return (*GetPeiServicesTablePointer())->RegisterForShadow (FileHandle
);
476 This service is a wrapper for the PEI Service FfsGetFileInfo(), except the pointer to the PEI Services
477 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
478 Specification for details.
480 @param FileHandle The handle of the file.
482 @param FileInfo Upon exit, points to the file's
485 @retval EFI_SUCCESS File information returned.
487 @retval EFI_INVALID_PARAMETER If FileHandle does not
488 represent a valid file.
490 @retval EFI_INVALID_PARAMETER FileInfo is NULL.
495 PeiServicesFfsGetFileInfo (
496 IN CONST EFI_PEI_FILE_HANDLE FileHandle
,
497 OUT EFI_FV_FILE_INFO
*FileInfo
500 return (*GetPeiServicesTablePointer())->FfsGetFileInfo (FileHandle
, FileInfo
);
504 This service is a wrapper for the PEI Service FfsGetFileInfo2(), except the pointer to the PEI Services
505 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
506 Specification for details.
508 @param FileHandle The handle of the file.
509 @param FileInfo Upon exit, points to the file's
512 @retval EFI_SUCCESS File information returned.
513 @retval EFI_INVALID_PARAMETER If FileHandle does not
514 represent a valid file.
515 @retval EFI_INVALID_PARAMETER FileInfo is NULL.
520 PeiServicesFfsGetFileInfo2 (
521 IN CONST EFI_PEI_FILE_HANDLE FileHandle
,
522 OUT EFI_FV_FILE_INFO2
*FileInfo
525 return (*GetPeiServicesTablePointer())->FfsGetFileInfo2 (FileHandle
, FileInfo
);
529 This service is a wrapper for the PEI Service FfsFindByName(), except the pointer to the PEI Services
530 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
531 Specification for details.
533 @param FileName A pointer to the name of the file to
534 find within the firmware volume.
536 @param VolumeHandle The firmware volume to search FileHandle
537 Upon exit, points to the found file's
538 handle or NULL if it could not be found.
539 @param FileHandle The pointer to found file handle
541 @retval EFI_SUCCESS File was found.
543 @retval EFI_NOT_FOUND File was not found.
545 @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or
551 PeiServicesFfsFindFileByName (
552 IN CONST EFI_GUID
*FileName
,
553 IN CONST EFI_PEI_FV_HANDLE VolumeHandle
,
554 OUT EFI_PEI_FILE_HANDLE
*FileHandle
557 return (*GetPeiServicesTablePointer())->FfsFindFileByName (FileName
, VolumeHandle
, FileHandle
);
562 This service is a wrapper for the PEI Service FfsGetVolumeInfo(), except the pointer to the PEI Services
563 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
564 Specification for details.
566 @param VolumeHandle Handle of the volume.
568 @param VolumeInfo Upon exit, points to the volume's
571 @retval EFI_SUCCESS File information returned.
573 @retval EFI_INVALID_PARAMETER If FileHandle does not
574 represent a valid file.
576 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
581 PeiServicesFfsGetVolumeInfo (
582 IN EFI_PEI_FV_HANDLE VolumeHandle
,
583 OUT EFI_FV_INFO
*VolumeInfo
586 return (*GetPeiServicesTablePointer())->FfsGetVolumeInfo (VolumeHandle
, VolumeInfo
);
590 Install a EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI instance so the PEI Core will be notified about a new firmware volume.
592 This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI using
593 the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI instance.
594 If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI, then ASSERT().
595 If the EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI can not be installed, then ASSERT().
596 If NULL is specified for FvFormat, but FvInfo does not have the firmware file system 2 format, then ASSERT.
598 @param InstallFvInfoPpi Install FvInfo Ppi if it is TRUE. Otherwise, install FvInfo2 Ppi.
599 @param FvFormat Unique identifier of the format of the memory-mapped
600 firmware volume. This parameter is optional and
601 may be NULL. If NULL is specified, the
602 EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
603 @param FvInfo Points to a buffer which allows the
604 EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
605 The format of this buffer is specific to the FvFormat.
606 For memory-mapped firmware volumes, this typically
607 points to the first byte of the firmware volume.
608 @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
609 firmware volumes, this is typically the size of
611 @param ParentFvName If the new firmware volume originated from a file
612 in a different firmware volume, then this parameter
613 specifies the GUID name of the originating firmware
614 volume. Otherwise, this parameter must be NULL.
615 @param ParentFileName If the new firmware volume originated from a file
616 in a different firmware volume, then this parameter
617 specifies the GUID file name of the originating
618 firmware file. Otherwise, this parameter must be NULL.
619 @param AuthenticationStatus Authentication Status, it will be ignored if InstallFvInfoPpi is TRUE.
623 InternalPeiServicesInstallFvInfoPpi (
624 IN BOOLEAN InstallFvInfoPpi
,
625 IN CONST EFI_GUID
*FvFormat
, OPTIONAL
626 IN CONST VOID
*FvInfo
,
627 IN UINT32 FvInfoSize
,
628 IN CONST EFI_GUID
*ParentFvName
, OPTIONAL
629 IN CONST EFI_GUID
*ParentFileName
, OPTIONAL
630 IN UINT32 AuthenticationStatus
634 EFI_PEI_FIRMWARE_VOLUME_INFO_PPI
*FvInfoPpi
;
635 EFI_PEI_PPI_DESCRIPTOR
*FvInfoPpiDescriptor
;
636 EFI_GUID
*ParentFvNameValue
;
637 EFI_GUID
*ParentFileNameValue
;
640 ParentFvNameValue
= NULL
;
641 ParentFileNameValue
= NULL
;
642 if (InstallFvInfoPpi
) {
644 // To install FvInfo Ppi.
646 FvInfoPpi
= AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI
));
647 ASSERT (FvInfoPpi
!= NULL
);
648 PpiGuid
= &gEfiPeiFirmwareVolumeInfoPpiGuid
;
651 // To install FvInfo2 Ppi.
653 FvInfoPpi
= AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI
));
654 ASSERT (FvInfoPpi
!= NULL
);
655 ((EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI
*) FvInfoPpi
)->AuthenticationStatus
= AuthenticationStatus
;
656 PpiGuid
= &gEfiPeiFirmwareVolumeInfo2PpiGuid
;
659 if (FvFormat
!= NULL
) {
660 CopyGuid (&FvInfoPpi
->FvFormat
, FvFormat
);
662 CopyGuid (&FvInfoPpi
->FvFormat
, &gEfiFirmwareFileSystem2Guid
);
664 // Since the EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed if NULL is specified for FvFormat,
665 // check the FileSystemGuid pointed by FvInfo against EFI_FIRMWARE_FILE_SYSTEM2_GUID to make sure
666 // FvInfo has the firmware file system 2 format.
667 // If the ASSERT really appears, FvFormat needs to be specified correctly, for example,
668 // EFI_FIRMWARE_FILE_SYSTEM3_GUID can be used for firmware file system 3 format, or
669 // ((EFI_FIRMWARE_VOLUME_HEADER *) FvInfo)->FileSystemGuid can be just used for both
670 // firmware file system 2 and 3 format.
672 ASSERT (CompareGuid (&(((EFI_FIRMWARE_VOLUME_HEADER
*) FvInfo
)->FileSystemGuid
), &gEfiFirmwareFileSystem2Guid
));
674 FvInfoPpi
->FvInfo
= (VOID
*) FvInfo
;
675 FvInfoPpi
->FvInfoSize
= FvInfoSize
;
676 if (ParentFvName
!= NULL
) {
677 ParentFvNameValue
= AllocateCopyPool (sizeof (EFI_GUID
), ParentFvName
);
678 ASSERT (ParentFvNameValue
!= NULL
);
679 FvInfoPpi
->ParentFvName
= ParentFvNameValue
;
681 if (ParentFileName
!= NULL
) {
682 ParentFileNameValue
= AllocateCopyPool (sizeof (EFI_GUID
), ParentFileName
);
683 ASSERT (ParentFileNameValue
!= NULL
);
684 FvInfoPpi
->ParentFileName
= ParentFileNameValue
;
687 FvInfoPpiDescriptor
= AllocatePool (sizeof (EFI_PEI_PPI_DESCRIPTOR
));
688 ASSERT (FvInfoPpiDescriptor
!= NULL
);
690 FvInfoPpiDescriptor
->Guid
= PpiGuid
;
691 FvInfoPpiDescriptor
->Flags
= EFI_PEI_PPI_DESCRIPTOR_PPI
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
;
692 FvInfoPpiDescriptor
->Ppi
= (VOID
*) FvInfoPpi
;
693 Status
= PeiServicesInstallPpi (FvInfoPpiDescriptor
);
694 ASSERT_EFI_ERROR (Status
);
699 Install a EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance so the PEI Core will be notified about a new firmware volume.
701 This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO_PPI using
702 the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance.
703 If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO_PPI, then ASSERT().
704 If the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI can not be installed, then ASSERT().
705 If NULL is specified for FvFormat, but FvInfo does not have the firmware file system 2 format, then ASSERT.
707 @param FvFormat Unique identifier of the format of the memory-mapped
708 firmware volume. This parameter is optional and
709 may be NULL. If NULL is specified, the
710 EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
711 @param FvInfo Points to a buffer which allows the
712 EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
713 The format of this buffer is specific to the FvFormat.
714 For memory-mapped firmware volumes, this typically
715 points to the first byte of the firmware volume.
716 @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
717 firmware volumes, this is typically the size of
719 @param ParentFvName If the new firmware volume originated from a file
720 in a different firmware volume, then this parameter
721 specifies the GUID name of the originating firmware
722 volume. Otherwise, this parameter must be NULL.
723 @param ParentFileName If the new firmware volume originated from a file
724 in a different firmware volume, then this parameter
725 specifies the GUID file name of the originating
726 firmware file. Otherwise, this parameter must be NULL.
730 PeiServicesInstallFvInfoPpi (
731 IN CONST EFI_GUID
*FvFormat
, OPTIONAL
732 IN CONST VOID
*FvInfo
,
733 IN UINT32 FvInfoSize
,
734 IN CONST EFI_GUID
*ParentFvName
, OPTIONAL
735 IN CONST EFI_GUID
*ParentFileName OPTIONAL
738 InternalPeiServicesInstallFvInfoPpi (TRUE
, FvFormat
, FvInfo
, FvInfoSize
, ParentFvName
, ParentFileName
, 0);
742 Install a EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI instance so the PEI Core will be notified about a new firmware volume.
744 This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI using
745 the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI instance.
746 If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI, then ASSERT().
747 If the EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI can not be installed, then ASSERT().
748 If NULL is specified for FvFormat, but FvInfo does not have the firmware file system 2 format, then ASSERT.
750 @param FvFormat Unique identifier of the format of the memory-mapped
751 firmware volume. This parameter is optional and
752 may be NULL. If NULL is specified, the
753 EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
754 @param FvInfo Points to a buffer which allows the
755 EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
756 The format of this buffer is specific to the FvFormat.
757 For memory-mapped firmware volumes, this typically
758 points to the first byte of the firmware volume.
759 @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
760 firmware volumes, this is typically the size of
762 @param ParentFvName If the new firmware volume originated from a file
763 in a different firmware volume, then this parameter
764 specifies the GUID name of the originating firmware
765 volume. Otherwise, this parameter must be NULL.
766 @param ParentFileName If the new firmware volume originated from a file
767 in a different firmware volume, then this parameter
768 specifies the GUID file name of the originating
769 firmware file. Otherwise, this parameter must be NULL.
770 @param AuthenticationStatus Authentication Status
774 PeiServicesInstallFvInfo2Ppi (
775 IN CONST EFI_GUID
*FvFormat
, OPTIONAL
776 IN CONST VOID
*FvInfo
,
777 IN UINT32 FvInfoSize
,
778 IN CONST EFI_GUID
*ParentFvName
, OPTIONAL
779 IN CONST EFI_GUID
*ParentFileName
, OPTIONAL
780 IN UINT32 AuthenticationStatus
783 InternalPeiServicesInstallFvInfoPpi (FALSE
, FvFormat
, FvInfo
, FvInfoSize
, ParentFvName
, ParentFileName
, AuthenticationStatus
);
787 Resets the entire platform.
789 @param[in] ResetType The type of reset to perform.
790 @param[in] ResetStatus The status code for the reset.
791 @param[in] DataSize The size, in bytes, of ResetData.
792 @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown
793 the data buffer starts with a Null-terminated string, optionally
794 followed by additional binary data. The string is a description
795 that the caller may use to further indicate the reason for the
801 PeiServicesResetSystem2 (
802 IN EFI_RESET_TYPE ResetType
,
803 IN EFI_STATUS ResetStatus
,
805 IN VOID
*ResetData OPTIONAL
808 (*GetPeiServicesTablePointer())->ResetSystem2 (ResetType
, ResetStatus
, DataSize
, ResetData
);