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
11 #include <Ppi/FirmwareVolumeInfo.h>
12 #include <Ppi/FirmwareVolumeInfo2.h>
13 #include <Guid/FirmwareFileSystem2.h>
15 #include <Library/PeiServicesLib.h>
16 #include <Library/PeiServicesTablePointerLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/MemoryAllocationLib.h>
19 #include <Library/BaseMemoryLib.h>
22 This service enables a given PEIM to register an interface into the PEI Foundation.
24 @param PpiList A pointer to the list of interfaces that the caller shall install.
26 @retval EFI_SUCCESS The interface was successfully installed.
27 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
28 @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
29 EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
30 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
35 PeiServicesInstallPpi (
36 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
39 CONST EFI_PEI_SERVICES
**PeiServices
;
41 PeiServices
= GetPeiServicesTablePointer ();
42 return (*PeiServices
)->InstallPpi (PeiServices
, PpiList
);
46 This service enables PEIMs to replace an entry in the PPI database with an alternate entry.
48 @param OldPpi The pointer to the old PEI PPI Descriptors.
49 @param NewPpi The pointer to the new PEI PPI Descriptors.
51 @retval EFI_SUCCESS The interface was successfully installed.
52 @retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
53 @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
54 EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
55 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
56 @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been
62 PeiServicesReInstallPpi (
63 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
64 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
67 CONST EFI_PEI_SERVICES
**PeiServices
;
69 PeiServices
= GetPeiServicesTablePointer ();
70 return (*PeiServices
)->ReInstallPpi (PeiServices
, OldPpi
, NewPpi
);
74 This service enables PEIMs to discover a given instance of an interface.
76 @param Guid A pointer to the GUID whose corresponding interface needs to be
78 @param Instance The N-th instance of the interface that is required.
79 @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
80 @param Ppi A pointer to the instance of the interface.
82 @retval EFI_SUCCESS The interface was successfully returned.
83 @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
88 PeiServicesLocatePpi (
89 IN CONST EFI_GUID
*Guid
,
91 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor OPTIONAL
,
95 CONST EFI_PEI_SERVICES
**PeiServices
;
97 PeiServices
= GetPeiServicesTablePointer ();
98 return (*PeiServices
)->LocatePpi (PeiServices
, Guid
, Instance
, PpiDescriptor
, Ppi
);
102 This service enables PEIMs to register a given service to be invoked when another service is
103 installed or reinstalled.
105 @param NotifyList A pointer to the list of notification interfaces
106 that the caller shall install.
108 @retval EFI_SUCCESS The interface was successfully installed.
109 @retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
110 @retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do
111 not have the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES
112 bit set in the Flags field.
113 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
118 PeiServicesNotifyPpi (
119 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
122 CONST EFI_PEI_SERVICES
**PeiServices
;
124 PeiServices
= GetPeiServicesTablePointer ();
125 return (*PeiServices
)->NotifyPpi (PeiServices
, NotifyList
);
129 This service enables PEIMs to ascertain the present value of the boot mode.
131 @param BootMode A pointer to contain the value of the boot mode.
133 @retval EFI_SUCCESS The boot mode was returned successfully.
134 @retval EFI_INVALID_PARAMETER BootMode is NULL.
139 PeiServicesGetBootMode (
140 OUT EFI_BOOT_MODE
*BootMode
143 CONST EFI_PEI_SERVICES
**PeiServices
;
145 PeiServices
= GetPeiServicesTablePointer ();
146 return (*PeiServices
)->GetBootMode (PeiServices
, BootMode
);
150 This service enables PEIMs to update the boot mode variable.
152 @param BootMode The value of the boot mode to set.
154 @retval EFI_SUCCESS The value was successfully updated
159 PeiServicesSetBootMode (
160 IN EFI_BOOT_MODE BootMode
163 CONST EFI_PEI_SERVICES
**PeiServices
;
165 PeiServices
= GetPeiServicesTablePointer ();
166 return (*PeiServices
)->SetBootMode (PeiServices
, BootMode
);
170 This service enables a PEIM to ascertain the address of the list of HOBs in memory.
172 @param HobList A pointer to the list of HOBs that the PEI Foundation
175 @retval EFI_SUCCESS The list was successfully returned.
176 @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
181 PeiServicesGetHobList (
185 CONST EFI_PEI_SERVICES
**PeiServices
;
187 PeiServices
= GetPeiServicesTablePointer ();
188 return (*PeiServices
)->GetHobList (PeiServices
, HobList
);
192 This service enables PEIMs to create various types of HOBs.
194 @param Type The type of HOB to be installed.
195 @param Length The length of the HOB to be added.
196 @param Hob The address of a pointer that will contain the
199 @retval EFI_SUCCESS The HOB was successfully created.
200 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
205 PeiServicesCreateHob (
211 CONST EFI_PEI_SERVICES
**PeiServices
;
213 PeiServices
= GetPeiServicesTablePointer ();
214 return (*PeiServices
)->CreateHob (PeiServices
, Type
, Length
, Hob
);
218 This service enables PEIMs to discover additional firmware volumes.
220 @param Instance This instance of the firmware volume to find. The
221 value 0 is the Boot Firmware Volume (BFV).
222 @param VolumeHandle Handle of the firmware volume header of the volume
225 @retval EFI_SUCCESS The volume was found.
226 @retval EFI_NOT_FOUND The volume was not found.
227 @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
232 PeiServicesFfsFindNextVolume (
234 IN OUT EFI_PEI_FV_HANDLE
*VolumeHandle
237 CONST EFI_PEI_SERVICES
**PeiServices
;
239 PeiServices
= GetPeiServicesTablePointer ();
240 return (*PeiServices
)->FfsFindNextVolume (PeiServices
, Instance
, VolumeHandle
);
244 This service enables PEIMs to discover additional firmware files.
246 @param SearchType A filter to find files only of this type.
247 @param VolumeHandle The pointer to the firmware volume header of the
248 volume to search. This parameter must point to a
250 @param FileHandle Handle of the current file from which to begin searching.
252 @retval EFI_SUCCESS The file was found.
253 @retval EFI_NOT_FOUND The file was not found.
254 @retval EFI_NOT_FOUND The header checksum was not zero.
259 PeiServicesFfsFindNextFile (
260 IN EFI_FV_FILETYPE SearchType
,
261 IN EFI_PEI_FV_HANDLE VolumeHandle
,
262 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
265 CONST EFI_PEI_SERVICES
**PeiServices
;
267 PeiServices
= GetPeiServicesTablePointer ();
268 return (*PeiServices
)->FfsFindNextFile (PeiServices
, SearchType
, VolumeHandle
, FileHandle
);
272 This service enables PEIMs to discover sections of a given type within a valid FFS file.
274 @param SectionType The value of the section type to find.
275 @param FileHandle A pointer to the file header that contains the set
276 of sections to be searched.
277 @param SectionData A pointer to the discovered section, if successful.
279 @retval EFI_SUCCESS The section was found.
280 @retval EFI_NOT_FOUND The section was not found.
285 PeiServicesFfsFindSectionData (
286 IN EFI_SECTION_TYPE SectionType
,
287 IN EFI_PEI_FILE_HANDLE FileHandle
,
288 OUT VOID
**SectionData
291 CONST EFI_PEI_SERVICES
**PeiServices
;
293 PeiServices
= GetPeiServicesTablePointer ();
294 return (*PeiServices
)->FfsFindSectionData (PeiServices
, SectionType
, FileHandle
, SectionData
);
298 This service enables PEIMs to discover sections of a given instance and type within a valid FFS file.
300 @param SectionType The value of the section type to find.
301 @param SectionInstance Section instance to find.
302 @param FileHandle A pointer to the file header that contains the set
303 of sections to be searched.
304 @param SectionData A pointer to the discovered section, if successful.
305 @param AuthenticationStatus A pointer to the authentication status for this section.
307 @retval EFI_SUCCESS The section was found.
308 @retval EFI_NOT_FOUND The section was not found.
313 PeiServicesFfsFindSectionData3 (
314 IN EFI_SECTION_TYPE SectionType
,
315 IN UINTN SectionInstance
,
316 IN EFI_PEI_FILE_HANDLE FileHandle
,
317 OUT VOID
**SectionData
,
318 OUT UINT32
*AuthenticationStatus
321 CONST EFI_PEI_SERVICES
**PeiServices
;
323 PeiServices
= GetPeiServicesTablePointer ();
324 return (*PeiServices
)->FindSectionData3 (PeiServices
, SectionType
, SectionInstance
, FileHandle
, SectionData
, AuthenticationStatus
);
328 This service enables PEIMs to register the permanent memory configuration
329 that has been initialized with the PEI Foundation.
331 @param MemoryBegin The value of a region of installed memory.
332 @param MemoryLength The corresponding length of a region of installed memory.
334 @retval EFI_SUCCESS The region was successfully installed in a HOB.
335 @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
336 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
341 PeiServicesInstallPeiMemory (
342 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
343 IN UINT64 MemoryLength
346 CONST EFI_PEI_SERVICES
**PeiServices
;
348 PeiServices
= GetPeiServicesTablePointer ();
349 return (*PeiServices
)->InstallPeiMemory (PeiServices
, MemoryBegin
, MemoryLength
);
353 This service enables PEIMs to allocate memory.
355 @param MemoryType Type of memory to allocate.
356 @param Pages The number of pages to allocate.
357 @param Memory Pointer of memory allocated.
359 @retval EFI_SUCCESS The memory range was successfully allocated.
360 @retval EFI_INVALID_PARAMETER Type is not equal to EfiLoaderCode, EfiLoaderData, EfiRuntimeServicesCode,
361 EfiRuntimeServicesData, EfiBootServicesCode, EfiBootServicesData,
362 EfiACPIReclaimMemory, EfiReservedMemoryType, or EfiACPIMemoryNVS.
363 @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
368 PeiServicesAllocatePages (
369 IN EFI_MEMORY_TYPE MemoryType
,
371 OUT EFI_PHYSICAL_ADDRESS
*Memory
374 CONST EFI_PEI_SERVICES
**PeiServices
;
376 PeiServices
= GetPeiServicesTablePointer ();
377 return (*PeiServices
)->AllocatePages (PeiServices
, MemoryType
, Pages
, Memory
);
381 This service enables PEIMs to free memory.
383 @param Memory Memory to be freed.
384 @param Pages The number of pages to free.
386 @retval EFI_SUCCESS The requested pages were freed.
387 @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.
388 @retval EFI_NOT_FOUND The requested memory pages were not allocated with
394 PeiServicesFreePages (
395 IN EFI_PHYSICAL_ADDRESS Memory
,
399 CONST EFI_PEI_SERVICES
**PeiServices
;
401 PeiServices
= GetPeiServicesTablePointer ();
402 return (*PeiServices
)->FreePages (PeiServices
, Memory
, Pages
);
406 This service allocates memory from the Hand-Off Block (HOB) heap.
408 @param Size The number of bytes to allocate from the pool.
409 @param Buffer If the call succeeds, a pointer to a pointer to
410 the allocate buffer; otherwise, undefined.
412 @retval EFI_SUCCESS The allocation was successful
413 @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
418 PeiServicesAllocatePool (
423 CONST EFI_PEI_SERVICES
**PeiServices
;
425 PeiServices
= GetPeiServicesTablePointer ();
426 return (*PeiServices
)->AllocatePool (PeiServices
, Size
, Buffer
);
430 Resets the entire platform.
432 @retval EFI_SUCCESS The function completed successfully.
433 @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
438 PeiServicesResetSystem (
442 CONST EFI_PEI_SERVICES
**PeiServices
;
444 PeiServices
= GetPeiServicesTablePointer ();
445 return (*PeiServices
)->ResetSystem (PeiServices
);
449 This service is a wrapper for the PEI Service RegisterForShadow(), except the
450 pointer to the PEI Services Table has been removed. See the Platform
451 Initialization Pre-EFI Initialization Core Interface Specification for details.
453 @param FileHandle PEIM's file handle. Must be the currently
456 @retval EFI_SUCCESS The PEIM was successfully registered for
459 @retval EFI_ALREADY_STARTED The PEIM was previously
460 registered for shadowing.
462 @retval EFI_NOT_FOUND The FileHandle does not refer to a
467 PeiServicesRegisterForShadow (
468 IN EFI_PEI_FILE_HANDLE FileHandle
471 return (*GetPeiServicesTablePointer ())->RegisterForShadow (FileHandle
);
475 This service is a wrapper for the PEI Service FfsGetFileInfo(), except the pointer to the PEI Services
476 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
477 Specification for details.
479 @param FileHandle The handle of the file.
481 @param FileInfo Upon exit, points to the file's
484 @retval EFI_SUCCESS File information returned.
486 @retval EFI_INVALID_PARAMETER If FileHandle does not
487 represent a valid file.
489 @retval EFI_INVALID_PARAMETER FileInfo is NULL.
494 PeiServicesFfsGetFileInfo (
495 IN CONST EFI_PEI_FILE_HANDLE FileHandle
,
496 OUT EFI_FV_FILE_INFO
*FileInfo
499 return (*GetPeiServicesTablePointer ())->FfsGetFileInfo (FileHandle
, FileInfo
);
503 This service is a wrapper for the PEI Service FfsGetFileInfo2(), except the pointer to the PEI Services
504 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
505 Specification for details.
507 @param FileHandle The handle of the file.
508 @param FileInfo Upon exit, points to the file's
511 @retval EFI_SUCCESS File information returned.
512 @retval EFI_INVALID_PARAMETER If FileHandle does not
513 represent a valid file.
514 @retval EFI_INVALID_PARAMETER FileInfo is NULL.
519 PeiServicesFfsGetFileInfo2 (
520 IN CONST EFI_PEI_FILE_HANDLE FileHandle
,
521 OUT EFI_FV_FILE_INFO2
*FileInfo
524 return (*GetPeiServicesTablePointer ())->FfsGetFileInfo2 (FileHandle
, FileInfo
);
528 This service is a wrapper for the PEI Service FfsFindByName(), except the pointer to the PEI Services
529 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
530 Specification for details.
532 @param FileName A pointer to the name of the file to
533 find within the firmware volume.
535 @param VolumeHandle The firmware volume to search FileHandle
536 Upon exit, points to the found file's
537 handle or NULL if it could not be found.
538 @param FileHandle The pointer to found file handle
540 @retval EFI_SUCCESS File was found.
542 @retval EFI_NOT_FOUND File was not found.
544 @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or
550 PeiServicesFfsFindFileByName (
551 IN CONST EFI_GUID
*FileName
,
552 IN CONST EFI_PEI_FV_HANDLE VolumeHandle
,
553 OUT EFI_PEI_FILE_HANDLE
*FileHandle
556 return (*GetPeiServicesTablePointer ())->FfsFindFileByName (FileName
, VolumeHandle
, FileHandle
);
560 This service is a wrapper for the PEI Service FfsGetVolumeInfo(), except the pointer to the PEI Services
561 Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
562 Specification for details.
564 @param VolumeHandle Handle of the volume.
566 @param VolumeInfo Upon exit, points to the volume's
569 @retval EFI_SUCCESS File information returned.
571 @retval EFI_INVALID_PARAMETER If FileHandle does not
572 represent a valid file.
574 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
579 PeiServicesFfsGetVolumeInfo (
580 IN EFI_PEI_FV_HANDLE VolumeHandle
,
581 OUT EFI_FV_INFO
*VolumeInfo
584 return (*GetPeiServicesTablePointer ())->FfsGetVolumeInfo (VolumeHandle
, VolumeInfo
);
588 Install a EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI instance so the PEI Core will be notified about a new firmware volume.
590 This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI using
591 the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI instance.
592 If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI, then ASSERT().
593 If the EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI can not be installed, then ASSERT().
594 If NULL is specified for FvFormat, but FvInfo does not have the firmware file system 2 format, then ASSERT.
596 @param InstallFvInfoPpi Install FvInfo Ppi if it is TRUE. Otherwise, install FvInfo2 Ppi.
597 @param FvFormat Unique identifier of the format of the memory-mapped
598 firmware volume. This parameter is optional and
599 may be NULL. If NULL is specified, the
600 EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
601 @param FvInfo Points to a buffer which allows the
602 EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
603 The format of this buffer is specific to the FvFormat.
604 For memory-mapped firmware volumes, this typically
605 points to the first byte of the firmware volume.
606 @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
607 firmware volumes, this is typically the size of
609 @param ParentFvName If the new firmware volume originated from a file
610 in a different firmware volume, then this parameter
611 specifies the GUID name of the originating firmware
612 volume. Otherwise, this parameter must be NULL.
613 @param ParentFileName If the new firmware volume originated from a file
614 in a different firmware volume, then this parameter
615 specifies the GUID file name of the originating
616 firmware file. Otherwise, this parameter must be NULL.
617 @param AuthenticationStatus Authentication Status, it will be ignored if InstallFvInfoPpi is TRUE.
621 InternalPeiServicesInstallFvInfoPpi (
622 IN BOOLEAN InstallFvInfoPpi
,
623 IN CONST EFI_GUID
*FvFormat OPTIONAL
,
624 IN CONST VOID
*FvInfo
,
625 IN UINT32 FvInfoSize
,
626 IN CONST EFI_GUID
*ParentFvName OPTIONAL
,
627 IN CONST EFI_GUID
*ParentFileName OPTIONAL
,
628 IN UINT32 AuthenticationStatus
632 EFI_PEI_FIRMWARE_VOLUME_INFO_PPI
*FvInfoPpi
;
633 EFI_PEI_PPI_DESCRIPTOR
*FvInfoPpiDescriptor
;
634 EFI_GUID
*ParentFvNameValue
;
635 EFI_GUID
*ParentFileNameValue
;
638 ParentFvNameValue
= NULL
;
639 ParentFileNameValue
= NULL
;
640 if (InstallFvInfoPpi
) {
642 // To install FvInfo Ppi.
644 FvInfoPpi
= AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI
));
645 ASSERT (FvInfoPpi
!= NULL
);
646 PpiGuid
= &gEfiPeiFirmwareVolumeInfoPpiGuid
;
649 // To install FvInfo2 Ppi.
651 FvInfoPpi
= AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI
));
652 ASSERT (FvInfoPpi
!= NULL
);
653 ((EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI
*)FvInfoPpi
)->AuthenticationStatus
= AuthenticationStatus
;
654 PpiGuid
= &gEfiPeiFirmwareVolumeInfo2PpiGuid
;
657 if (FvFormat
!= NULL
) {
658 CopyGuid (&FvInfoPpi
->FvFormat
, FvFormat
);
660 CopyGuid (&FvInfoPpi
->FvFormat
, &gEfiFirmwareFileSystem2Guid
);
662 // Since the EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed if NULL is specified for FvFormat,
663 // check the FileSystemGuid pointed by FvInfo against EFI_FIRMWARE_FILE_SYSTEM2_GUID to make sure
664 // FvInfo has the firmware file system 2 format.
665 // If the ASSERT really appears, FvFormat needs to be specified correctly, for example,
666 // EFI_FIRMWARE_FILE_SYSTEM3_GUID can be used for firmware file system 3 format, or
667 // ((EFI_FIRMWARE_VOLUME_HEADER *) FvInfo)->FileSystemGuid can be just used for both
668 // firmware file system 2 and 3 format.
670 ASSERT (CompareGuid (&(((EFI_FIRMWARE_VOLUME_HEADER
*)FvInfo
)->FileSystemGuid
), &gEfiFirmwareFileSystem2Guid
));
673 FvInfoPpi
->FvInfo
= (VOID
*)FvInfo
;
674 FvInfoPpi
->FvInfoSize
= FvInfoSize
;
675 if (ParentFvName
!= NULL
) {
676 ParentFvNameValue
= AllocateCopyPool (sizeof (EFI_GUID
), ParentFvName
);
677 ASSERT (ParentFvNameValue
!= NULL
);
678 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
);
698 Install a EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance so the PEI Core will be notified about a new firmware volume.
700 This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO_PPI using
701 the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance.
702 If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO_PPI, then ASSERT().
703 If the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI can not be installed, then ASSERT().
704 If NULL is specified for FvFormat, but FvInfo does not have the firmware file system 2 format, then ASSERT.
706 @param FvFormat Unique identifier of the format of the memory-mapped
707 firmware volume. This parameter is optional and
708 may be NULL. If NULL is specified, the
709 EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
710 @param FvInfo Points to a buffer which allows the
711 EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
712 The format of this buffer is specific to the FvFormat.
713 For memory-mapped firmware volumes, this typically
714 points to the first byte of the firmware volume.
715 @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
716 firmware volumes, this is typically the size of
718 @param ParentFvName If the new firmware volume originated from a file
719 in a different firmware volume, then this parameter
720 specifies the GUID name of the originating firmware
721 volume. Otherwise, this parameter must be NULL.
722 @param ParentFileName If the new firmware volume originated from a file
723 in a different firmware volume, then this parameter
724 specifies the GUID file name of the originating
725 firmware file. Otherwise, this parameter must be NULL.
729 PeiServicesInstallFvInfoPpi (
730 IN CONST EFI_GUID
*FvFormat OPTIONAL
,
731 IN CONST VOID
*FvInfo
,
732 IN UINT32 FvInfoSize
,
733 IN CONST EFI_GUID
*ParentFvName OPTIONAL
,
734 IN CONST EFI_GUID
*ParentFileName OPTIONAL
737 InternalPeiServicesInstallFvInfoPpi (TRUE
, FvFormat
, FvInfo
, FvInfoSize
, ParentFvName
, ParentFileName
, 0);
741 Install a EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI instance so the PEI Core will be notified about a new firmware volume.
743 This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI using
744 the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI instance.
745 If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI, then ASSERT().
746 If the EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI can not be installed, then ASSERT().
747 If NULL is specified for FvFormat, but FvInfo does not have the firmware file system 2 format, then ASSERT.
749 @param FvFormat Unique identifier of the format of the memory-mapped
750 firmware volume. This parameter is optional and
751 may be NULL. If NULL is specified, the
752 EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
753 @param FvInfo Points to a buffer which allows the
754 EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
755 The format of this buffer is specific to the FvFormat.
756 For memory-mapped firmware volumes, this typically
757 points to the first byte of the firmware volume.
758 @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
759 firmware volumes, this is typically the size of
761 @param ParentFvName If the new firmware volume originated from a file
762 in a different firmware volume, then this parameter
763 specifies the GUID name of the originating firmware
764 volume. Otherwise, this parameter must be NULL.
765 @param ParentFileName If the new firmware volume originated from a file
766 in a different firmware volume, then this parameter
767 specifies the GUID file name of the originating
768 firmware file. Otherwise, this parameter must be NULL.
769 @param AuthenticationStatus Authentication Status
773 PeiServicesInstallFvInfo2Ppi (
774 IN CONST EFI_GUID
*FvFormat OPTIONAL
,
775 IN CONST VOID
*FvInfo
,
776 IN UINT32 FvInfoSize
,
777 IN CONST EFI_GUID
*ParentFvName OPTIONAL
,
778 IN CONST EFI_GUID
*ParentFileName OPTIONAL
,
779 IN UINT32 AuthenticationStatus
782 InternalPeiServicesInstallFvInfoPpi (FALSE
, FvFormat
, FvInfo
, FvInfoSize
, ParentFvName
, ParentFileName
, AuthenticationStatus
);
786 Resets the entire platform.
788 @param[in] ResetType The type of reset to perform.
789 @param[in] ResetStatus The status code for the reset.
790 @param[in] DataSize The size, in bytes, of ResetData.
791 @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown
792 the data buffer starts with a Null-terminated string, optionally
793 followed by additional binary data. The string is a description
794 that the caller may use to further indicate the reason for the
800 PeiServicesResetSystem2 (
801 IN EFI_RESET_TYPE ResetType
,
802 IN EFI_STATUS ResetStatus
,
804 IN VOID
*ResetData OPTIONAL
807 (*GetPeiServicesTablePointer ())->ResetSystem2 (ResetType
, ResetStatus
, DataSize
, ResetData
);