2 PI PEI master include file. This file should match the PI spec.
4 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
7 @par Revision Reference:
12 #ifndef __PI_PEICIS_H__
13 #define __PI_PEICIS_H__
15 #include <Uefi/UefiMultiPhase.h>
16 #include <Pi/PiMultiPhase.h>
19 /// The handles of EFI FV.
21 typedef VOID
*EFI_PEI_FV_HANDLE
;
24 /// The handles of EFI FFS.
26 typedef VOID
*EFI_PEI_FILE_HANDLE
;
29 /// Declare the forward reference data structure for EFI_PEI_SERVICE.
31 typedef struct _EFI_PEI_SERVICES EFI_PEI_SERVICES
;
34 /// Declare the forward reference data structure for EFI_PEI_NOTIFY_DESCRIPTOR.
36 typedef struct _EFI_PEI_NOTIFY_DESCRIPTOR EFI_PEI_NOTIFY_DESCRIPTOR
;
39 #include <Ppi/CpuIo.h>
40 #include <Ppi/PciCfg2.h>
44 The PEI Dispatcher will invoke each PEIM one time. During this pass, the PEI
45 Dispatcher will pass control to the PEIM at the AddressOfEntryPoint in the PE Header.
47 @param FileHandle Pointer to the FFS file header.
48 @param PeiServices Describes the list of possible PEI Services.
50 @retval EFI_SUCCESS The PEI completed successfully.
51 @retval !EFI_SUCCESS There is error in PEIM.
56 (EFIAPI
*EFI_PEIM_ENTRY_POINT2
)(
57 IN EFI_PEI_FILE_HANDLE FileHandle
,
58 IN CONST EFI_PEI_SERVICES
**PeiServices
62 Entry point of the notification callback function itself within the PEIM.
64 @param PeiServices Indirect reference to the PEI Services Table.
65 @param NotifyDescriptor Address of the notification descriptor data structure.
66 @param Ppi Address of the PPI that was installed.
68 @return Status of the notification.
69 The status code returned from this function is ignored.
73 (EFIAPI
*EFI_PEIM_NOTIFY_ENTRY_POINT
)(
74 IN EFI_PEI_SERVICES
**PeiServices
,
75 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
80 // PEI Ppi Services List Descriptors
82 #define EFI_PEI_PPI_DESCRIPTOR_PIC 0x00000001
83 #define EFI_PEI_PPI_DESCRIPTOR_PPI 0x00000010
84 #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK 0x00000020
85 #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH 0x00000040
86 #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES 0x00000060
87 #define EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST 0x80000000
90 /// The data structure through which a PEIM describes available services to the PEI Foundation.
94 /// This field is a set of flags describing the characteristics of this imported table entry.
95 /// All flags are defined as EFI_PEI_PPI_DESCRIPTOR_***, which can also be combined into one.
99 /// The address of the EFI_GUID that names the interface.
103 /// A pointer to the PPI. It contains the information necessary to install a service.
106 } EFI_PEI_PPI_DESCRIPTOR
;
109 /// The data structure in a given PEIM that tells the PEI
110 /// Foundation where to invoke the notification service.
112 struct _EFI_PEI_NOTIFY_DESCRIPTOR
{
114 /// Details if the type of notification are callback or dispatch.
118 /// The address of the EFI_GUID that names the interface.
122 /// Address of the notification callback function itself within the PEIM.
124 EFI_PEIM_NOTIFY_ENTRY_POINT Notify
;
128 /// This data structure is the means by which callable services are installed and
129 /// notifications are registered in the PEI phase.
133 /// The typedef structure of the notification descriptor.
135 EFI_PEI_NOTIFY_DESCRIPTOR Notify
;
137 /// The typedef structure of the PPI descriptor.
139 EFI_PEI_PPI_DESCRIPTOR Ppi
;
140 } EFI_PEI_DESCRIPTOR
;
143 This service is the first one provided by the PEI Foundation. This function
144 installs an interface in the PEI PPI database by GUID. The purpose of the
145 service is to publish an interface that other parties can use to call
148 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table
149 published by the PEI Foundation.
150 @param PpiList A pointer to the list of interfaces that the caller shall install.
152 @retval EFI_SUCCESS The interface was successfully installed.
153 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI
154 descriptors in the list do not have the
155 EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
156 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
161 (EFIAPI
*EFI_PEI_INSTALL_PPI
)(
162 IN CONST EFI_PEI_SERVICES
**PeiServices
,
163 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
167 This function reinstalls an interface in the PEI PPI database by GUID.
168 The purpose of the service is to publish an interface that other parties
169 can use to replace a same-named interface in the protocol database
170 with a different interface.
172 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table
173 published by the PEI Foundation.
174 @param OldPpi A pointer to the former PPI in the database.
175 @param NewPpi A pointer to the new interfaces that the caller shall install.
177 @retval EFI_SUCCESS The interface was successfully installed.
178 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI descriptors in the
179 list do not have the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
180 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
181 @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been installed.
186 (EFIAPI
*EFI_PEI_REINSTALL_PPI
)(
187 IN CONST EFI_PEI_SERVICES
**PeiServices
,
188 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
189 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
193 This function locates an interface in the PEI PPI database by GUID.
195 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES published by the PEI Foundation.
196 @param Guid A pointer to the GUID whose corresponding interface needs to be found.
197 @param Instance The N-th instance of the interface that is required.
198 @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
199 @param Ppi A pointer to the instance of the interface.
201 @retval EFI_SUCCESS The interface was successfully returned.
202 @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
207 (EFIAPI
*EFI_PEI_LOCATE_PPI
)(
208 IN CONST EFI_PEI_SERVICES
**PeiServices
,
209 IN CONST EFI_GUID
*Guid
,
211 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor OPTIONAL
,
216 This function installs a notification service to be called back when a
217 given interface is installed or reinstalled. The purpose of the service
218 is to publish an interface that other parties can use to call additional PPIs
219 that may materialize later.
221 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
222 @param NotifyList A pointer to the list of notification interfaces that the caller shall install.
224 @retval EFI_SUCCESS The interface was successfully installed.
225 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL, or any of the PEI PPI descriptors in the
226 list do not have the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.
227 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
232 (EFIAPI
*EFI_PEI_NOTIFY_PPI
)(
233 IN CONST EFI_PEI_SERVICES
**PeiServices
,
234 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
238 This function returns the present value of the boot mode.
240 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
241 @param BootMode A pointer to contain the value of the boot mode.
243 @retval EFI_SUCCESS The boot mode returned successfully.
248 (EFIAPI
*EFI_PEI_GET_BOOT_MODE
)(
249 IN CONST EFI_PEI_SERVICES
**PeiServices
,
250 OUT EFI_BOOT_MODE
*BootMode
254 This function sets the value of the boot mode.
256 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
257 @param BootMode The value of the boot mode to set.
259 @retval EFI_SUCCESS The boot mode returned successfully.
264 (EFIAPI
*EFI_PEI_SET_BOOT_MODE
)(
265 IN CONST EFI_PEI_SERVICES
**PeiServices
,
266 IN EFI_BOOT_MODE BootMode
270 This function returns the pointer to the list of Hand-Off Blocks (HOBs) in memory.
272 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
273 @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize
275 @retval EFI_SUCCESS The list was successfully returned.
276 @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
281 (EFIAPI
*EFI_PEI_GET_HOB_LIST
)(
282 IN CONST EFI_PEI_SERVICES
**PeiServices
,
287 This service, published by the PEI Foundation, abstracts the creation of a Hand-Off Block's (HOB's) headers.
289 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
290 @param Type The type of HOB to be installed.
291 @param Length The length of the HOB to be added.
292 @param Hob The address of a pointer that will contain the HOB header.
294 @retval EFI_SUCCESS The HOB was successfully created.
295 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
300 (EFIAPI
*EFI_PEI_CREATE_HOB
)(
301 IN CONST EFI_PEI_SERVICES
**PeiServices
,
308 The purpose of the service is to abstract the capability of the PEI
309 Foundation to discover instances of firmware volumes in the system.
311 This service enables PEIMs to discover additional firmware volumes. The PEI Foundation uses this
312 service to abstract the locations and formats of various firmware volumes. These volumes include
313 the Boot Firmware Volume and any other volumes exposed by EFI_PEI_FV_PPI. The service
314 returns a volume handle of type EFI_PEI_FV_HANDLE, which must be unique within the system.
316 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
317 @param Instance This instance of the firmware volume to find.
318 The value 0 is the Boot Firmware Volume (BFV).
319 @param VolumeHandle On exit, points to the next volumn handle or NULL if it does not exist.
321 @retval EFI_SUCCESS The volume was found.
322 @retval EFI_NOT_FOUND The volume was not found.
323 @retval EFI_INVALID_PARAMETER VolumeHandle is NULL.
328 (EFIAPI
*EFI_PEI_FFS_FIND_NEXT_VOLUME2
)(
329 IN CONST EFI_PEI_SERVICES
**PeiServices
,
331 OUT EFI_PEI_FV_HANDLE
*VolumeHandle
335 Searches for the next matching file in the firmware volume.
337 This service enables PEIMs to discover firmware files within a specified volume.
338 To find the first instance of a firmware file, pass a FileHandle value of NULL into the service.
339 The service returns a file handle of type EFI_PEI_FILE_HANDLE, which must be unique within
342 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
343 @param SearchType A filter to find files only of this type.
344 @param FvHandle Handle of firmware volume in which to search.
345 @param FileHandle On entry, points to the current handle from which to begin searching
346 or NULL to start at the beginning of the firmware volume.
347 On exit, points the file handle of the next file in the volume or NULL
348 if there are no more files.
350 @retval EFI_SUCCESS The file was found.
351 @retval EFI_NOT_FOUND The file was not found.
352 @retval EFI_NOT_FOUND The header checksum was not zero.
357 (EFIAPI
*EFI_PEI_FFS_FIND_NEXT_FILE2
)(
358 IN CONST EFI_PEI_SERVICES
**PeiServices
,
359 IN EFI_FV_FILETYPE SearchType
,
360 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
361 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
365 Searches for the next matching section within the specified file.
367 This service enables PEI modules to discover the first section of a given type within a valid file.
368 This service will search within encapsulation sections (compression and GUIDed) as well. It will
369 search inside of a GUIDed section or a compressed section, but may not, for example, search a
370 GUIDed section inside a GUIDes section.
371 This service will not search within compression sections or GUIDed sections that require
372 extraction if memory is not present.
374 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
375 @param SectionType The value of the section type to find.
376 @param FileHandle Handle of the firmware file to search.
377 @param SectionData A pointer to the discovered section, if successful.
379 @retval EFI_SUCCESS The section was found.
380 @retval EFI_NOT_FOUND The section was not found.
385 (EFIAPI
*EFI_PEI_FFS_FIND_SECTION_DATA2
)(
386 IN CONST EFI_PEI_SERVICES
**PeiServices
,
387 IN EFI_SECTION_TYPE SectionType
,
388 IN EFI_PEI_FILE_HANDLE FileHandle
,
389 OUT VOID
**SectionData
393 Searches for the next matching section within the specified file.
395 This service enables PEI modules to discover the section of a given type within a valid file.
396 This service will search within encapsulation sections (compression and GUIDed) as well. It will
397 search inside of a GUIDed section or a compressed section, but may not, for example, search a
398 GUIDed section inside a GUIDes section.
399 This service will not search within compression sections or GUIDed sections that require
400 extraction if memory is not present.
402 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
403 @param SectionType The value of the section type to find.
404 @param SectionInstance Section instance to find.
405 @param FileHandle Handle of the firmware file to search.
406 @param SectionData A pointer to the discovered section, if successful.
407 @param AuthenticationStatus A pointer to the authentication status for this section.
409 @retval EFI_SUCCESS The section was found.
410 @retval EFI_NOT_FOUND The section was not found.
415 (EFIAPI
*EFI_PEI_FFS_FIND_SECTION_DATA3
)(
416 IN CONST EFI_PEI_SERVICES
**PeiServices
,
417 IN EFI_SECTION_TYPE SectionType
,
418 IN UINTN SectionInstance
,
419 IN EFI_PEI_FILE_HANDLE FileHandle
,
420 OUT VOID
**SectionData
,
421 OUT UINT32
*AuthenticationStatus
425 This function registers the found memory configuration with the PEI Foundation.
427 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
428 @param MemoryBegin The value of a region of installed memory.
429 @param MemoryLength The corresponding length of a region of installed memory.
431 @retval EFI_SUCCESS The region was successfully installed in a HOB.
432 @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
433 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
438 (EFIAPI
*EFI_PEI_INSTALL_PEI_MEMORY
)(
439 IN CONST EFI_PEI_SERVICES
**PeiServices
,
440 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
441 IN UINT64 MemoryLength
445 The purpose of the service is to publish an interface that allows
446 PEIMs to allocate memory ranges that are managed by the PEI Foundation.
448 Prior to InstallPeiMemory() being called, PEI will allocate pages from the heap.
449 After InstallPeiMemory() is called, PEI will allocate pages within the region
450 of memory provided by InstallPeiMemory() service in a best-effort fashion.
451 Location-specific allocations are not managed by the PEI foundation code.
453 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
454 @param MemoryType The type of memory to allocate.
455 @param Pages The number of contiguous 4 KB pages to allocate.
456 @param Memory A pointer to a physical address. On output, the address is set to the base
457 of the page range that was allocated.
459 @retval EFI_SUCCESS The memory range was successfully allocated.
460 @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
461 @retval EFI_INVALID_PARAMETER The type is not equal to EfiLoaderCode, EfiLoaderData, EfiRuntimeServicesCode,
462 EfiRuntimeServicesData, EfiBootServicesCode, EfiBootServicesData,
463 EfiACPIReclaimMemory, EfiReservedMemoryType, or EfiACPIMemoryNVS.
468 (EFIAPI
*EFI_PEI_ALLOCATE_PAGES
)(
469 IN CONST EFI_PEI_SERVICES
**PeiServices
,
470 IN EFI_MEMORY_TYPE MemoryType
,
472 OUT EFI_PHYSICAL_ADDRESS
*Memory
478 @param[in] PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
479 @param[in] Memory The base physical address of the pages to be freed.
480 @param[in] Pages The number of contiguous 4 KB pages to free.
482 @retval EFI_SUCCESS The requested pages were freed.
483 @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.
484 @retval EFI_NOT_FOUND The requested memory pages were not allocated with
490 (EFIAPI
*EFI_PEI_FREE_PAGES
) (
491 IN CONST EFI_PEI_SERVICES
**PeiServices
,
492 IN EFI_PHYSICAL_ADDRESS Memory
,
497 The purpose of this service is to publish an interface that
498 allows PEIMs to allocate memory ranges that are managed by the PEI Foundation.
500 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
501 @param Size The number of bytes to allocate from the pool.
502 @param Buffer If the call succeeds, a pointer to a pointer to the allocated buffer; undefined otherwise.
504 @retval EFI_SUCCESS The allocation was successful.
505 @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
510 (EFIAPI
*EFI_PEI_ALLOCATE_POOL
)(
511 IN CONST EFI_PEI_SERVICES
**PeiServices
,
517 This service copies the contents of one buffer to another buffer.
519 @param Destination The pointer to the destination buffer of the memory copy.
520 @param Source The pointer to the source buffer of the memory copy.
521 @param Length The number of bytes to copy from Source to Destination.
526 (EFIAPI
*EFI_PEI_COPY_MEM
)(
527 IN VOID
*Destination
,
533 The service fills a buffer with a specified value.
535 @param Buffer The pointer to the buffer to fill.
536 @param Size The number of bytes in Buffer to fill.
537 @param Value The value to fill Buffer with.
542 (EFIAPI
*EFI_PEI_SET_MEM
)(
549 This service publishes an interface that allows PEIMs to report status codes.
551 ReportStatusCode() is called by PEIMs that wish to report status information on their
552 progress. The principal use model is for a PEIM to emit one of the standard 32-bit error codes. This
553 will allow a platform owner to ascertain the state of the system, especially under conditions where
554 the full consoles might not have been installed.
556 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
557 @param Type Indicates the type of status code being reported.
558 @param Value Describes the current status of a hardware or
559 software entity. This includes information about the class and
560 subclass that is used to classify the entity as well as an operation.
561 For progress codes, the operation is the current activity.
562 For error codes, it is the exception.For debug codes,it is not defined at this time.
563 @param Instance The enumeration of a hardware or software entity within
564 the system. A system may contain multiple entities that match a class/subclass
565 pairing. The instance differentiates between them. An instance of 0 indicates
566 that instance information is unavailable, not meaningful, or not relevant.
567 Valid instance numbers start with 1.
568 @param CallerId This optional parameter may be used to identify the caller.
569 This parameter allows the status code driver to apply different rules to
571 @param Data This optional parameter may be used to pass additional data.
573 @retval EFI_SUCCESS The function completed successfully.
574 @retval EFI_NOT_AVAILABLE_YET No progress code provider has installed an interface in the system.
579 (EFIAPI
*EFI_PEI_REPORT_STATUS_CODE
)(
580 IN CONST EFI_PEI_SERVICES
**PeiServices
,
581 IN EFI_STATUS_CODE_TYPE Type
,
582 IN EFI_STATUS_CODE_VALUE Value
,
584 IN CONST EFI_GUID
*CallerId OPTIONAL
,
585 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
589 Resets the entire platform.
591 This service resets the entire platform, including all processors
592 and devices, and reboots the system.
593 This service will never return EFI_SUCCESS.
595 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES
596 table published by the PEI Foundation.
598 @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
603 (EFIAPI
*EFI_PEI_RESET_SYSTEM
)(
604 IN CONST EFI_PEI_SERVICES
**PeiServices
608 Resets the entire platform.
610 @param[in] ResetType The type of reset to perform.
611 @param[in] ResetStatus The status code for the reset.
612 @param[in] DataSize The size, in bytes, of ResetData.
613 @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown
614 the data buffer starts with a Null-terminated string, optionally
615 followed by additional binary data. The string is a description
616 that the caller may use to further indicate the reason for the
622 (EFIAPI
*EFI_PEI_RESET2_SYSTEM
) (
623 IN EFI_RESET_TYPE ResetType
,
624 IN EFI_STATUS ResetStatus
,
626 IN VOID
*ResetData OPTIONAL
630 Find a file within a volume by its name.
632 This service searches for files with a specific name, within
633 either the specified firmware volume or all firmware volumes.
634 The service returns a file handle of type EFI_PEI_FILE_HANDLE,
635 which must be unique within the system.
637 @param FileName A pointer to the name of the file to
638 find within the firmware volume.
639 @param VolumeHandle The firmware volume to search.
640 @param FileHandle Upon exit, points to the found file's
641 handle or NULL if it could not be found.
643 @retval EFI_SUCCESS The file was found.
644 @retval EFI_NOT_FOUND The file was not found.
645 @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or
651 (EFIAPI
*EFI_PEI_FFS_FIND_BY_NAME
)(
652 IN CONST EFI_GUID
*FileName
,
653 IN EFI_PEI_FV_HANDLE VolumeHandle
,
654 OUT EFI_PEI_FILE_HANDLE
*FileHandle
658 /// The information of the FV file.
662 /// Name of the file.
668 EFI_FV_FILETYPE FileType
;
670 /// Attributes of the file.
672 EFI_FV_FILE_ATTRIBUTES FileAttributes
;
674 /// Points to the file's data (not the header).
675 /// Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED
680 /// Size of the file's data.
686 /// The information with authentication status of the FV file.
690 /// Name of the file.
696 EFI_FV_FILETYPE FileType
;
698 /// Attributes of the file.
700 EFI_FV_FILE_ATTRIBUTES FileAttributes
;
702 /// Points to the file's data (not the header).
703 /// Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED
708 /// Size of the file's data.
712 /// Authentication status for this file.
714 UINT32 AuthenticationStatus
;
718 Returns information about a specific file.
720 This function returns information about a specific file,
721 including its file name, type, attributes, starting address and
722 size. If the firmware volume is not memory mapped, then the
723 Buffer member will be NULL.
725 @param FileHandle The handle of the file.
726 @param FileInfo Upon exit, points to the file's
729 @retval EFI_SUCCESS File information was returned.
730 @retval EFI_INVALID_PARAMETER FileHandle does not
731 represent a valid file.
732 @retval EFI_INVALID_PARAMETER FileInfo is NULL.
737 (EFIAPI
*EFI_PEI_FFS_GET_FILE_INFO
)(
738 IN EFI_PEI_FILE_HANDLE FileHandle
,
739 OUT EFI_FV_FILE_INFO
*FileInfo
743 Returns information about a specific file.
745 This function returns information about a specific file,
746 including its file name, type, attributes, starting address, size and authentication status.
747 If the firmware volume is not memory mapped, then the Buffer member will be NULL.
749 @param FileHandle The handle of the file.
750 @param FileInfo Upon exit, points to the file's
753 @retval EFI_SUCCESS File information was returned.
754 @retval EFI_INVALID_PARAMETER FileHandle does not
755 represent a valid file.
756 @retval EFI_INVALID_PARAMETER FileInfo is NULL.
761 (EFIAPI
*EFI_PEI_FFS_GET_FILE_INFO2
)(
762 IN EFI_PEI_FILE_HANDLE FileHandle
,
763 OUT EFI_FV_FILE_INFO2
*FileInfo
767 /// The information of the FV volume.
771 /// Attributes of the firmware volume.
773 EFI_FVB_ATTRIBUTES_2 FvAttributes
;
775 /// Format of the firmware volume.
779 /// Name of the firmware volume.
783 /// Points to the first byte of the firmware
784 /// volume, if bit EFI_FVB_MEMORY_MAPPED is
785 /// set in FvAttributes.
789 /// Size of the firmware volume.
795 Returns information about the specified volume.
797 This function returns information about a specific firmware
798 volume, including its name, type, attributes, starting address
801 @param VolumeHandle Handle of the volume.
802 @param VolumeInfo Upon exit, points to the volume's information.
804 @retval EFI_SUCCESS The volume information returned.
805 @retval EFI_INVALID_PARAMETER If VolumeHandle does not represent a valid volume.
806 @retval EFI_INVALID_PARAMETER If VolumeHandle is NULL.
807 @retval EFI_SUCCESS Information was successfully returned.
808 @retval EFI_INVALID_PARAMETER The volume designated by the VolumeHandle is not available.
813 (EFIAPI
*EFI_PEI_FFS_GET_VOLUME_INFO
)(
814 IN EFI_PEI_FV_HANDLE VolumeHandle
,
815 OUT EFI_FV_INFO
*VolumeInfo
819 Register a PEIM so that it will be shadowed and called again.
821 This service registers a file handle so that after memory is
822 available, the PEIM will be re-loaded into permanent memory and
823 re-initialized. The PEIM registered this way will always be
824 initialized twice. The first time, this function call will
825 return EFI_SUCCESS. The second time, this function call will
826 return EFI_ALREADY_STARTED. Depending on the order in which
827 PEIMs are dispatched, the PEIM making this call may be
828 initialized after permanent memory is installed, even the first
831 @param FileHandle PEIM's file handle. Must be the currently
834 @retval EFI_SUCCESS The PEIM was successfully registered for
836 @retval EFI_ALREADY_STARTED The PEIM was previously
837 registered for shadowing.
838 @retval EFI_NOT_FOUND The FileHandle does not refer to a
844 (EFIAPI
*EFI_PEI_REGISTER_FOR_SHADOW
)(
845 IN EFI_PEI_FILE_HANDLE FileHandle
850 // PEI Specification Revision information
852 #define PEI_SPECIFICATION_MAJOR_REVISION 1
853 #define PEI_SPECIFICATION_MINOR_REVISION 60
855 /// Specification inconsistency here:
856 /// In the PI1.0 spec, PEI_SERVICES_SIGNATURE is defined as 0x5652455320494550. But
857 /// to pass a multiple tool chain, it appends an ULL.
860 // PEI Services Table
862 #define PEI_SERVICES_SIGNATURE 0x5652455320494550ULL
864 /// Specification inconsistency here:
865 /// In the PI1.0 specification, there is a typo error in PEI_SERVICES_REVISION. In the specification the defintion is
866 /// #define ((PEI_SPECIFICATION_MAJOR_REVISION<<16) |(PEI_SPECIFICATION_MINOR_REVISION))
867 /// and it should be as follows:
869 #define PEI_SERVICES_REVISION ((PEI_SPECIFICATION_MAJOR_REVISION<<16) | (PEI_SPECIFICATION_MINOR_REVISION))
872 /// EFI_PEI_SERVICES is a collection of functions whose implementation is provided by the PEI
873 /// Foundation. These services fall into various classes, including the following:
874 /// - Managing the boot mode
875 /// - Allocating both early and permanent memory
876 /// - Supporting the Firmware File System (FFS)
877 /// - Abstracting the PPI database abstraction
878 /// - Creating Hand-Off Blocks (HOBs).
880 struct _EFI_PEI_SERVICES
{
882 /// The table header for the PEI Services Table.
884 EFI_TABLE_HEADER Hdr
;
889 EFI_PEI_INSTALL_PPI InstallPpi
;
890 EFI_PEI_REINSTALL_PPI ReInstallPpi
;
891 EFI_PEI_LOCATE_PPI LocatePpi
;
892 EFI_PEI_NOTIFY_PPI NotifyPpi
;
895 // Boot Mode Functions
897 EFI_PEI_GET_BOOT_MODE GetBootMode
;
898 EFI_PEI_SET_BOOT_MODE SetBootMode
;
903 EFI_PEI_GET_HOB_LIST GetHobList
;
904 EFI_PEI_CREATE_HOB CreateHob
;
907 // Firmware Volume Functions
909 EFI_PEI_FFS_FIND_NEXT_VOLUME2 FfsFindNextVolume
;
910 EFI_PEI_FFS_FIND_NEXT_FILE2 FfsFindNextFile
;
911 EFI_PEI_FFS_FIND_SECTION_DATA2 FfsFindSectionData
;
914 // PEI Memory Functions
916 EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory
;
917 EFI_PEI_ALLOCATE_PAGES AllocatePages
;
918 EFI_PEI_ALLOCATE_POOL AllocatePool
;
919 EFI_PEI_COPY_MEM CopyMem
;
920 EFI_PEI_SET_MEM SetMem
;
925 EFI_PEI_REPORT_STATUS_CODE ReportStatusCode
;
930 EFI_PEI_RESET_SYSTEM ResetSystem
;
933 // (the following interfaces are installed by publishing PEIM)
936 EFI_PEI_CPU_IO_PPI
*CpuIo
;
937 EFI_PEI_PCI_CFG2_PPI
*PciCfg
;
940 // Future Installed Services
942 EFI_PEI_FFS_FIND_BY_NAME FfsFindFileByName
;
943 EFI_PEI_FFS_GET_FILE_INFO FfsGetFileInfo
;
944 EFI_PEI_FFS_GET_VOLUME_INFO FfsGetVolumeInfo
;
945 EFI_PEI_REGISTER_FOR_SHADOW RegisterForShadow
;
946 EFI_PEI_FFS_FIND_SECTION_DATA3 FindSectionData3
;
947 EFI_PEI_FFS_GET_FILE_INFO2 FfsGetFileInfo2
;
948 EFI_PEI_RESET2_SYSTEM ResetSystem2
;
949 EFI_PEI_FREE_PAGES FreePages
;
954 /// EFI_SEC_PEI_HAND_OFF structure holds information about
955 /// PEI core's operating environment, such as the size of location of
956 /// temporary RAM, the stack location and BFV location.
958 typedef struct _EFI_SEC_PEI_HAND_OFF
{
960 /// Size of the data structure.
965 /// Points to the first byte of the boot firmware volume,
966 /// which the PEI Dispatcher should search for
969 VOID
*BootFirmwareVolumeBase
;
972 /// Size of the boot firmware volume, in bytes.
974 UINTN BootFirmwareVolumeSize
;
977 /// Points to the first byte of the temporary RAM.
979 VOID
*TemporaryRamBase
;
982 /// Size of the temporary RAM, in bytes.
984 UINTN TemporaryRamSize
;
987 /// Points to the first byte of the temporary RAM
988 /// available for use by the PEI Foundation. The area
989 /// described by PeiTemporaryRamBase and PeiTemporaryRamSize
990 /// must not extend outside beyond the area described by
991 /// TemporaryRamBase & TemporaryRamSize. This area should not
992 /// overlap with the area reported by StackBase and
995 VOID
*PeiTemporaryRamBase
;
998 /// The size of the available temporary RAM available for
999 /// use by the PEI Foundation, in bytes.
1001 UINTN PeiTemporaryRamSize
;
1004 /// Points to the first byte of the stack.
1005 /// This are may be part of the memory described by
1006 /// TemporaryRamBase and TemporaryRamSize
1007 /// or may be an entirely separate area.
1012 /// Size of the stack, in bytes.
1015 } EFI_SEC_PEI_HAND_OFF
;
1019 The entry point of PEI Foundation.
1021 This function is the entry point for the PEI Foundation, which
1022 allows the SEC phase to pass information about the stack,
1023 temporary RAM and the Boot Firmware Volume. In addition, it also
1024 allows the SEC phase to pass services and data forward for use
1025 during the PEI phase in the form of one or more PPIs. These PPI's
1026 will be installed and/or immediately signaled if they are
1027 notification type. There is no limit to the number of additional
1028 PPIs that can be passed from SEC into the PEI Foundation. As part
1029 of its initialization phase, the PEI Foundation will add these
1030 SEC-hosted PPIs to its PPI database such that both the PEI
1031 Foundation and any modules can leverage the associated service
1032 calls and/or code in these early PPIs.
1034 @param SecCoreData Points to a data structure containing
1035 information about the PEI core's
1036 operating environment, such as the size
1037 and location of temporary RAM, the stack
1038 location and the BFV location.
1040 @param PpiList Points to a list of one or more PPI
1041 descriptors to be installed initially by
1042 the PEI core. An empty PPI list consists
1043 of a single descriptor with the end-tag
1044 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.
1045 As part of its initialization phase, the
1046 PEI Foundation will add these SEC-hosted
1047 PPIs to its PPI database such that both
1048 the PEI Foundation and any modules can
1049 leverage the associated service calls
1050 and/or code in these early PPIs.
1056 (EFIAPI
*EFI_PEI_CORE_ENTRY_POINT
)(
1057 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
1058 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList