2 Implementation for PEI Services Library.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include <Ppi/FirmwareVolumeInfo.h>
19 #include <Ppi/FirmwareVolumeInfo2.h>
20 #include <Guid/FirmwareFileSystem2.h>
22 #include <Library/PeiServicesLib.h>
23 #include <Library/PeiServicesTablePointerLib.h>
24 #include <Library/DebugLib.h>
25 #include <Library/MemoryAllocationLib.h>
26 #include <Library/BaseMemoryLib.h>
29 This service enables a given PEIM to register an interface into the PEI Foundation.
31 @param PpiList A pointer to the list of interfaces that the caller shall install.
33 @retval EFI_SUCCESS The interface was successfully installed.
34 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
35 @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
36 EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
37 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
42 PeiServicesInstallPpi (
43 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
46 CONST EFI_PEI_SERVICES
**PeiServices
;
48 PeiServices
= GetPeiServicesTablePointer ();
49 return (*PeiServices
)->InstallPpi (PeiServices
, PpiList
);
53 This service enables PEIMs to replace an entry in the PPI database with an alternate entry.
55 @param OldPpi The pointer to the old PEI PPI Descriptors.
56 @param NewPpi The pointer to the new PEI PPI Descriptors.
58 @retval EFI_SUCCESS The interface was successfully installed.
59 @retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
60 @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
61 EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
62 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
63 @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been
69 PeiServicesReInstallPpi (
70 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
71 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
74 CONST EFI_PEI_SERVICES
**PeiServices
;
76 PeiServices
= GetPeiServicesTablePointer ();
77 return (*PeiServices
)->ReInstallPpi (PeiServices
, OldPpi
, NewPpi
);
81 This service enables PEIMs to discover a given instance of an interface.
83 @param Guid A pointer to the GUID whose corresponding interface needs to be
85 @param Instance The N-th instance of the interface that is required.
86 @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
87 @param Ppi A pointer to the instance of the interface.
89 @retval EFI_SUCCESS The interface was successfully returned.
90 @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
95 PeiServicesLocatePpi (
96 IN CONST EFI_GUID
*Guid
,
98 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
, OPTIONAL
102 CONST EFI_PEI_SERVICES
**PeiServices
;
104 PeiServices
= GetPeiServicesTablePointer ();
105 return (*PeiServices
)->LocatePpi (PeiServices
, Guid
, Instance
, PpiDescriptor
, Ppi
);
109 This service enables PEIMs to register a given service to be invoked when another service is
110 installed or reinstalled.
112 @param NotifyList A pointer to the list of notification interfaces
113 that the caller shall install.
115 @retval EFI_SUCCESS The interface was successfully installed.
116 @retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
117 @retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do
118 not have the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES
119 bit set in the Flags field.
120 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
125 PeiServicesNotifyPpi (
126 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
129 CONST EFI_PEI_SERVICES
**PeiServices
;
131 PeiServices
= GetPeiServicesTablePointer ();
132 return (*PeiServices
)->NotifyPpi (PeiServices
, NotifyList
);
136 This service enables PEIMs to ascertain the present value of the boot mode.
138 @param BootMode A pointer to contain the value of the boot mode.
140 @retval EFI_SUCCESS The boot mode was returned successfully.
141 @retval EFI_INVALID_PARAMETER BootMode is NULL.
146 PeiServicesGetBootMode (
147 OUT EFI_BOOT_MODE
*BootMode
150 CONST EFI_PEI_SERVICES
**PeiServices
;
152 PeiServices
= GetPeiServicesTablePointer ();
153 return (*PeiServices
)->GetBootMode (PeiServices
, BootMode
);
157 This service enables PEIMs to update the boot mode variable.
159 @param BootMode The value of the boot mode to set.
161 @retval EFI_SUCCESS The value was successfully updated
166 PeiServicesSetBootMode (
167 IN EFI_BOOT_MODE BootMode
170 CONST EFI_PEI_SERVICES
**PeiServices
;
172 PeiServices
= GetPeiServicesTablePointer ();
173 return (*PeiServices
)->SetBootMode (PeiServices
, BootMode
);
177 This service enables a PEIM to ascertain the address of the list of HOBs in memory.
179 @param HobList A pointer to the list of HOBs that the PEI Foundation
182 @retval EFI_SUCCESS The list was successfully returned.
183 @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
188 PeiServicesGetHobList (
192 CONST EFI_PEI_SERVICES
**PeiServices
;
194 PeiServices
= GetPeiServicesTablePointer ();
195 return (*PeiServices
)->GetHobList (PeiServices
, HobList
);
199 This service enables PEIMs to create various types of HOBs.
201 @param Type The type of HOB to be installed.
202 @param Length The length of the HOB to be added.
203 @param Hob The address of a pointer that will contain the
206 @retval EFI_SUCCESS The HOB was successfully created.
207 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
212 PeiServicesCreateHob (
218 CONST EFI_PEI_SERVICES
**PeiServices
;
220 PeiServices
= GetPeiServicesTablePointer ();
221 return (*PeiServices
)->CreateHob (PeiServices
, Type
, Length
, Hob
);
225 This service enables PEIMs to discover additional firmware volumes.
227 @param Instance This instance of the firmware volume to find. The
228 value 0 is the Boot Firmware Volume (BFV).
229 @param VolumeHandle Handle of the firmware volume header of the volume
232 @retval EFI_SUCCESS The volume was found.
233 @retval EFI_NOT_FOUND The volume was not found.
234 @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
239 PeiServicesFfsFindNextVolume (
241 IN OUT EFI_PEI_FV_HANDLE
*VolumeHandle
244 CONST EFI_PEI_SERVICES
**PeiServices
;
246 PeiServices
= GetPeiServicesTablePointer ();
247 return (*PeiServices
)->FfsFindNextVolume (PeiServices
, Instance
, VolumeHandle
);
251 This service enables PEIMs to discover additional firmware files.
253 @param SearchType A filter to find files only of this type.
254 @param VolumeHandle The pointer to the firmware volume header of the
255 volume to search. This parameter must point to a
257 @param FileHandle Handle of the current file from which to begin searching.
259 @retval EFI_SUCCESS The file was found.
260 @retval EFI_NOT_FOUND The file was not found.
261 @retval EFI_NOT_FOUND The header checksum was not zero.
266 PeiServicesFfsFindNextFile (
267 IN EFI_FV_FILETYPE SearchType
,
268 IN EFI_PEI_FV_HANDLE VolumeHandle
,
269 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
272 CONST EFI_PEI_SERVICES
**PeiServices
;
274 PeiServices
= GetPeiServicesTablePointer ();
275 return (*PeiServices
)->FfsFindNextFile (PeiServices
, SearchType
, VolumeHandle
, FileHandle
);
279 This service enables PEIMs to discover sections of a given type within a valid FFS file.
281 @param SectionType The value of the section type to find.
282 @param FileHandle A pointer to the file header that contains the set
283 of sections to be searched.
284 @param SectionData A pointer to the discovered section, if successful.
286 @retval EFI_SUCCESS The section was found.
287 @retval EFI_NOT_FOUND The section was not found.
292 PeiServicesFfsFindSectionData (
293 IN EFI_SECTION_TYPE SectionType
,
294 IN EFI_PEI_FILE_HANDLE FileHandle
,
295 OUT VOID
**SectionData
298 CONST EFI_PEI_SERVICES
**PeiServices
;
300 PeiServices
= GetPeiServicesTablePointer ();
301 return (*PeiServices
)->FfsFindSectionData (PeiServices
, SectionType
, FileHandle
, SectionData
);
305 This service enables PEIMs to discover sections of a given instance and type within a valid FFS file.
307 @param SectionType The value of the section type to find.
308 @param SectionInstance Section instance to find.
309 @param FileHandle A pointer to the file header that contains the set
310 of sections to be searched.
311 @param SectionData A pointer to the discovered section, if successful.
312 @param AuthenticationStatus A pointer to the authentication status for this section.
314 @retval EFI_SUCCESS The section was found.
315 @retval EFI_NOT_FOUND The section was not found.
320 PeiServicesFfsFindSectionData3 (
321 IN EFI_SECTION_TYPE SectionType
,
322 IN UINTN SectionInstance
,
323 IN EFI_PEI_FILE_HANDLE FileHandle
,
324 OUT VOID
**SectionData
,
325 OUT UINT32
*AuthenticationStatus
328 CONST EFI_PEI_SERVICES
**PeiServices
;
330 PeiServices
= GetPeiServicesTablePointer ();
331 return (*PeiServices
)->FindSectionData3 (PeiServices
, SectionType
, SectionInstance
, FileHandle
, SectionData
, AuthenticationStatus
);
335 This service enables PEIMs to register the permanent memory configuration
336 that has been initialized with the PEI Foundation.
338 @param MemoryBegin The value of a region of installed memory.
339 @param MemoryLength The corresponding length of a region of installed memory.
341 @retval EFI_SUCCESS The region was successfully installed in a HOB.
342 @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
343 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
348 PeiServicesInstallPeiMemory (
349 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
350 IN UINT64 MemoryLength
353 CONST EFI_PEI_SERVICES
**PeiServices
;
355 PeiServices
= GetPeiServicesTablePointer ();
356 return (*PeiServices
)->InstallPeiMemory (PeiServices
, MemoryBegin
, MemoryLength
);
360 This service enables PEIMs to allocate memory.
362 @param MemoryType Type of memory to allocate.
363 @param Pages The number of pages to allocate.
364 @param Memory Pointer of memory allocated.
366 @retval EFI_SUCCESS The memory range was successfully allocated.
367 @retval EFI_INVALID_PARAMETER Type is not equal to EfiLoaderCode, EfiLoaderData, EfiRuntimeServicesCode,
368 EfiRuntimeServicesData, EfiBootServicesCode, EfiBootServicesData,
369 EfiACPIReclaimMemory, EfiReservedMemoryType, or EfiACPIMemoryNVS.
370 @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
375 PeiServicesAllocatePages (
376 IN EFI_MEMORY_TYPE MemoryType
,
378 OUT EFI_PHYSICAL_ADDRESS
*Memory
381 CONST EFI_PEI_SERVICES
**PeiServices
;
383 PeiServices
= GetPeiServicesTablePointer ();
384 return (*PeiServices
)->AllocatePages (PeiServices
, MemoryType
, Pages
, Memory
);
388 This service enables PEIMs to free memory.
390 @param Memory Memory to be freed.
391 @param Pages The number of pages to free.
393 @retval EFI_SUCCESS The requested pages were freed.
394 @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.
395 @retval EFI_NOT_FOUND The requested memory pages were not allocated with
401 PeiServicesFreePages (
402 IN EFI_PHYSICAL_ADDRESS Memory
,
406 CONST EFI_PEI_SERVICES
**PeiServices
;
408 PeiServices
= GetPeiServicesTablePointer ();
409 return (*PeiServices
)->FreePages (PeiServices
, Memory
, Pages
);
413 This service allocates memory from the Hand-Off Block (HOB) heap.
415 @param Size The number of bytes to allocate from the pool.
416 @param Buffer If the call succeeds, a pointer to a pointer to
417 the allocate buffer; otherwise, undefined.
419 @retval EFI_SUCCESS The allocation was successful
420 @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
425 PeiServicesAllocatePool (
430 CONST EFI_PEI_SERVICES
**PeiServices
;
432 PeiServices
= GetPeiServicesTablePointer ();
433 return (*PeiServices
)->AllocatePool (PeiServices
, Size
, Buffer
);
437 Resets the entire platform.
439 @retval EFI_SUCCESS The function completed successfully.
440 @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
445 PeiServicesResetSystem (
449 CONST EFI_PEI_SERVICES
**PeiServices
;
451 PeiServices
= GetPeiServicesTablePointer ();
452 return (*PeiServices
)->ResetSystem (PeiServices
);
456 This service is a wrapper for the PEI Service RegisterForShadow(), except the
457 pointer to the PEI Services Table has been removed. See the Platform
458 Initialization Pre-EFI Initialization Core Interface Specification for details.
460 @param FileHandle PEIM's file handle. Must be the currently
463 @retval EFI_SUCCESS The PEIM was successfully registered for
466 @retval EFI_ALREADY_STARTED The PEIM was previously
467 registered for shadowing.
469 @retval EFI_NOT_FOUND The FileHandle does not refer to a
474 PeiServicesRegisterForShadow (
475 IN EFI_PEI_FILE_HANDLE FileHandle
478 return (*GetPeiServicesTablePointer())->RegisterForShadow (FileHandle
);
482 This service is a wrapper for the PEI Service FfsGetFileInfo(), except the pointer to the PEI Services
483 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
484 Specification for details.
486 @param FileHandle The handle of the file.
488 @param FileInfo Upon exit, points to the file's
491 @retval EFI_SUCCESS File information returned.
493 @retval EFI_INVALID_PARAMETER If FileHandle does not
494 represent a valid file.
496 @retval EFI_INVALID_PARAMETER FileInfo is NULL.
501 PeiServicesFfsGetFileInfo (
502 IN CONST EFI_PEI_FILE_HANDLE FileHandle
,
503 OUT EFI_FV_FILE_INFO
*FileInfo
506 return (*GetPeiServicesTablePointer())->FfsGetFileInfo (FileHandle
, FileInfo
);
510 This service is a wrapper for the PEI Service FfsGetFileInfo2(), except the pointer to the PEI Services
511 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
512 Specification for details.
514 @param FileHandle The handle of the file.
515 @param FileInfo Upon exit, points to the file's
518 @retval EFI_SUCCESS File information returned.
519 @retval EFI_INVALID_PARAMETER If FileHandle does not
520 represent a valid file.
521 @retval EFI_INVALID_PARAMETER FileInfo is NULL.
526 PeiServicesFfsGetFileInfo2 (
527 IN CONST EFI_PEI_FILE_HANDLE FileHandle
,
528 OUT EFI_FV_FILE_INFO2
*FileInfo
531 return (*GetPeiServicesTablePointer())->FfsGetFileInfo2 (FileHandle
, FileInfo
);
535 This service is a wrapper for the PEI Service FfsFindByName(), except the pointer to the PEI Services
536 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
537 Specification for details.
539 @param FileName A pointer to the name of the file to
540 find within the firmware volume.
542 @param VolumeHandle The firmware volume to search FileHandle
543 Upon exit, points to the found file's
544 handle or NULL if it could not be found.
545 @param FileHandle The pointer to found file handle
547 @retval EFI_SUCCESS File was found.
549 @retval EFI_NOT_FOUND File was not found.
551 @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or
557 PeiServicesFfsFindFileByName (
558 IN CONST EFI_GUID
*FileName
,
559 IN CONST EFI_PEI_FV_HANDLE VolumeHandle
,
560 OUT EFI_PEI_FILE_HANDLE
*FileHandle
563 return (*GetPeiServicesTablePointer())->FfsFindFileByName (FileName
, VolumeHandle
, FileHandle
);
568 This service is a wrapper for the PEI Service FfsGetVolumeInfo(), except the pointer to the PEI Services
569 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
570 Specification for details.
572 @param VolumeHandle Handle of the volume.
574 @param VolumeInfo Upon exit, points to the volume's
577 @retval EFI_SUCCESS File information returned.
579 @retval EFI_INVALID_PARAMETER If FileHandle does not
580 represent a valid file.
582 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
587 PeiServicesFfsGetVolumeInfo (
588 IN EFI_PEI_FV_HANDLE VolumeHandle
,
589 OUT EFI_FV_INFO
*VolumeInfo
592 return (*GetPeiServicesTablePointer())->FfsGetVolumeInfo (VolumeHandle
, VolumeInfo
);
596 Install a EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI instance so the PEI Core will be notified about a new firmware volume.
598 This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI using
599 the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI instance.
600 If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI, then ASSERT().
601 If the EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI can not be installed, then ASSERT().
602 If NULL is specified for FvFormat, but FvInfo does not have the firmware file system 2 format, then ASSERT.
604 @param InstallFvInfoPpi Install FvInfo Ppi if it is TRUE. Otherwise, install FvInfo2 Ppi.
605 @param FvFormat Unique identifier of the format of the memory-mapped
606 firmware volume. This parameter is optional and
607 may be NULL. If NULL is specified, the
608 EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
609 @param FvInfo Points to a buffer which allows the
610 EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
611 The format of this buffer is specific to the FvFormat.
612 For memory-mapped firmware volumes, this typically
613 points to the first byte of the firmware volume.
614 @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
615 firmware volumes, this is typically the size of
617 @param ParentFvName If the new firmware volume originated from a file
618 in a different firmware volume, then this parameter
619 specifies the GUID name of the originating firmware
620 volume. Otherwise, this parameter must be NULL.
621 @param ParentFileName If the new firmware volume originated from a file
622 in a different firmware volume, then this parameter
623 specifies the GUID file name of the originating
624 firmware file. Otherwise, this parameter must be NULL.
625 @param AuthenticationStatus Authentication Status, it will be ignored if InstallFvInfoPpi is TRUE.
629 InternalPeiServicesInstallFvInfoPpi (
630 IN BOOLEAN InstallFvInfoPpi
,
631 IN CONST EFI_GUID
*FvFormat
, OPTIONAL
632 IN CONST VOID
*FvInfo
,
633 IN UINT32 FvInfoSize
,
634 IN CONST EFI_GUID
*ParentFvName
, OPTIONAL
635 IN CONST EFI_GUID
*ParentFileName
, OPTIONAL
636 IN UINT32 AuthenticationStatus
640 EFI_PEI_FIRMWARE_VOLUME_INFO_PPI
*FvInfoPpi
;
641 EFI_PEI_PPI_DESCRIPTOR
*FvInfoPpiDescriptor
;
642 EFI_GUID
*ParentFvNameValue
;
643 EFI_GUID
*ParentFileNameValue
;
646 ParentFvNameValue
= NULL
;
647 ParentFileNameValue
= NULL
;
648 if (InstallFvInfoPpi
) {
650 // To install FvInfo Ppi.
652 FvInfoPpi
= AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI
));
653 ASSERT (FvInfoPpi
!= NULL
);
654 PpiGuid
= &gEfiPeiFirmwareVolumeInfoPpiGuid
;
657 // To install FvInfo2 Ppi.
659 FvInfoPpi
= AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI
));
660 ASSERT (FvInfoPpi
!= NULL
);
661 ((EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI
*) FvInfoPpi
)->AuthenticationStatus
= AuthenticationStatus
;
662 PpiGuid
= &gEfiPeiFirmwareVolumeInfo2PpiGuid
;
665 if (FvFormat
!= NULL
) {
666 CopyGuid (&FvInfoPpi
->FvFormat
, FvFormat
);
668 CopyGuid (&FvInfoPpi
->FvFormat
, &gEfiFirmwareFileSystem2Guid
);
670 // Since the EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed if NULL is specified for FvFormat,
671 // check the FileSystemGuid pointed by FvInfo against EFI_FIRMWARE_FILE_SYSTEM2_GUID to make sure
672 // FvInfo has the firmware file system 2 format.
673 // If the ASSERT really appears, FvFormat needs to be specified correctly, for example,
674 // EFI_FIRMWARE_FILE_SYSTEM3_GUID can be used for firmware file system 3 format, or
675 // ((EFI_FIRMWARE_VOLUME_HEADER *) FvInfo)->FileSystemGuid can be just used for both
676 // firmware file system 2 and 3 format.
678 ASSERT (CompareGuid (&(((EFI_FIRMWARE_VOLUME_HEADER
*) FvInfo
)->FileSystemGuid
), &gEfiFirmwareFileSystem2Guid
));
680 FvInfoPpi
->FvInfo
= (VOID
*) FvInfo
;
681 FvInfoPpi
->FvInfoSize
= FvInfoSize
;
682 if (ParentFvName
!= NULL
) {
683 ParentFvNameValue
= AllocateCopyPool (sizeof (EFI_GUID
), ParentFvName
);
684 ASSERT (ParentFvNameValue
!= NULL
);
685 FvInfoPpi
->ParentFvName
= ParentFvNameValue
;
687 if (ParentFileName
!= NULL
) {
688 ParentFileNameValue
= AllocateCopyPool (sizeof (EFI_GUID
), ParentFileName
);
689 ASSERT (ParentFileNameValue
!= NULL
);
690 FvInfoPpi
->ParentFileName
= ParentFileNameValue
;
693 FvInfoPpiDescriptor
= AllocatePool (sizeof (EFI_PEI_PPI_DESCRIPTOR
));
694 ASSERT (FvInfoPpiDescriptor
!= NULL
);
696 FvInfoPpiDescriptor
->Guid
= PpiGuid
;
697 FvInfoPpiDescriptor
->Flags
= EFI_PEI_PPI_DESCRIPTOR_PPI
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
;
698 FvInfoPpiDescriptor
->Ppi
= (VOID
*) FvInfoPpi
;
699 Status
= PeiServicesInstallPpi (FvInfoPpiDescriptor
);
700 ASSERT_EFI_ERROR (Status
);
705 Install a EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance so the PEI Core will be notified about a new firmware volume.
707 This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO_PPI using
708 the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance.
709 If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO_PPI, then ASSERT().
710 If the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI can not be installed, then ASSERT().
711 If NULL is specified for FvFormat, but FvInfo does not have the firmware file system 2 format, then ASSERT.
713 @param FvFormat Unique identifier of the format of the memory-mapped
714 firmware volume. This parameter is optional and
715 may be NULL. If NULL is specified, the
716 EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
717 @param FvInfo Points to a buffer which allows the
718 EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
719 The format of this buffer is specific to the FvFormat.
720 For memory-mapped firmware volumes, this typically
721 points to the first byte of the firmware volume.
722 @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
723 firmware volumes, this is typically the size of
725 @param ParentFvName If the new firmware volume originated from a file
726 in a different firmware volume, then this parameter
727 specifies the GUID name of the originating firmware
728 volume. Otherwise, this parameter must be NULL.
729 @param ParentFileName If the new firmware volume originated from a file
730 in a different firmware volume, then this parameter
731 specifies the GUID file name of the originating
732 firmware file. Otherwise, this parameter must be NULL.
736 PeiServicesInstallFvInfoPpi (
737 IN CONST EFI_GUID
*FvFormat
, OPTIONAL
738 IN CONST VOID
*FvInfo
,
739 IN UINT32 FvInfoSize
,
740 IN CONST EFI_GUID
*ParentFvName
, OPTIONAL
741 IN CONST EFI_GUID
*ParentFileName OPTIONAL
744 InternalPeiServicesInstallFvInfoPpi (TRUE
, FvFormat
, FvInfo
, FvInfoSize
, ParentFvName
, ParentFileName
, 0);
748 Install a EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI instance so the PEI Core will be notified about a new firmware volume.
750 This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI using
751 the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI instance.
752 If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI, then ASSERT().
753 If the EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI can not be installed, then ASSERT().
754 If NULL is specified for FvFormat, but FvInfo does not have the firmware file system 2 format, then ASSERT.
756 @param FvFormat Unique identifier of the format of the memory-mapped
757 firmware volume. This parameter is optional and
758 may be NULL. If NULL is specified, the
759 EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
760 @param FvInfo Points to a buffer which allows the
761 EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
762 The format of this buffer is specific to the FvFormat.
763 For memory-mapped firmware volumes, this typically
764 points to the first byte of the firmware volume.
765 @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
766 firmware volumes, this is typically the size of
768 @param ParentFvName If the new firmware volume originated from a file
769 in a different firmware volume, then this parameter
770 specifies the GUID name of the originating firmware
771 volume. Otherwise, this parameter must be NULL.
772 @param ParentFileName If the new firmware volume originated from a file
773 in a different firmware volume, then this parameter
774 specifies the GUID file name of the originating
775 firmware file. Otherwise, this parameter must be NULL.
776 @param AuthenticationStatus Authentication Status
780 PeiServicesInstallFvInfo2Ppi (
781 IN CONST EFI_GUID
*FvFormat
, OPTIONAL
782 IN CONST VOID
*FvInfo
,
783 IN UINT32 FvInfoSize
,
784 IN CONST EFI_GUID
*ParentFvName
, OPTIONAL
785 IN CONST EFI_GUID
*ParentFileName
, OPTIONAL
786 IN UINT32 AuthenticationStatus
789 InternalPeiServicesInstallFvInfoPpi (FALSE
, FvFormat
, FvInfo
, FvInfoSize
, ParentFvName
, ParentFileName
, AuthenticationStatus
);
793 Resets the entire platform.
795 @param[in] ResetType The type of reset to perform.
796 @param[in] ResetStatus The status code for the reset.
797 @param[in] DataSize The size, in bytes, of ResetData.
798 @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown
799 the data buffer starts with a Null-terminated string, optionally
800 followed by additional binary data. The string is a description
801 that the caller may use to further indicate the reason for the
802 system reset. ResetData is only valid if ResetStatus is something
803 other than EFI_SUCCESS unless the ResetType is EfiResetPlatformSpecific
804 where a minimum amount of ResetData is always required.
809 PeiServicesResetSystem2 (
810 IN EFI_RESET_TYPE ResetType
,
811 IN EFI_STATUS ResetStatus
,
813 IN VOID
*ResetData OPTIONAL
816 (*GetPeiServicesTablePointer())->ResetSystem2 (ResetType
, ResetStatus
, DataSize
, ResetData
);