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
;
38 #include <Ppi/CpuIo.h>
39 #include <Ppi/PciCfg2.h>
42 The PEI Dispatcher will invoke each PEIM one time. During this pass, the PEI
43 Dispatcher will pass control to the PEIM at the AddressOfEntryPoint in the PE Header.
45 @param FileHandle Pointer to the FFS file header.
46 @param PeiServices Describes the list of possible PEI Services.
48 @retval EFI_SUCCESS The PEI completed successfully.
49 @retval !EFI_SUCCESS There is error in PEIM.
54 (EFIAPI
*EFI_PEIM_ENTRY_POINT2
)(
55 IN EFI_PEI_FILE_HANDLE FileHandle
,
56 IN CONST EFI_PEI_SERVICES
**PeiServices
60 Entry point of the notification callback function itself within the PEIM.
62 @param PeiServices Indirect reference to the PEI Services Table.
63 @param NotifyDescriptor Address of the notification descriptor data structure.
64 @param Ppi Address of the PPI that was installed.
66 @return Status of the notification.
67 The status code returned from this function is ignored.
71 (EFIAPI
*EFI_PEIM_NOTIFY_ENTRY_POINT
)(
72 IN EFI_PEI_SERVICES
**PeiServices
,
73 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
78 // PEI Ppi Services List Descriptors
80 #define EFI_PEI_PPI_DESCRIPTOR_PIC 0x00000001
81 #define EFI_PEI_PPI_DESCRIPTOR_PPI 0x00000010
82 #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK 0x00000020
83 #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH 0x00000040
84 #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES 0x00000060
85 #define EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST 0x80000000
88 /// The data structure through which a PEIM describes available services to the PEI Foundation.
92 /// This field is a set of flags describing the characteristics of this imported table entry.
93 /// All flags are defined as EFI_PEI_PPI_DESCRIPTOR_***, which can also be combined into one.
97 /// The address of the EFI_GUID that names the interface.
101 /// A pointer to the PPI. It contains the information necessary to install a service.
104 } EFI_PEI_PPI_DESCRIPTOR
;
107 /// The data structure in a given PEIM that tells the PEI
108 /// Foundation where to invoke the notification service.
110 struct _EFI_PEI_NOTIFY_DESCRIPTOR
{
112 /// Details if the type of notification are callback or dispatch.
116 /// The address of the EFI_GUID that names the interface.
120 /// Address of the notification callback function itself within the PEIM.
122 EFI_PEIM_NOTIFY_ENTRY_POINT Notify
;
126 /// This data structure is the means by which callable services are installed and
127 /// notifications are registered in the PEI phase.
131 /// The typedef structure of the notification descriptor.
133 EFI_PEI_NOTIFY_DESCRIPTOR Notify
;
135 /// The typedef structure of the PPI descriptor.
137 EFI_PEI_PPI_DESCRIPTOR Ppi
;
138 } EFI_PEI_DESCRIPTOR
;
141 This service is the first one provided by the PEI Foundation. This function
142 installs an interface in the PEI PPI database by GUID. The purpose of the
143 service is to publish an interface that other parties can use to call
146 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table
147 published by the PEI Foundation.
148 @param PpiList A pointer to the list of interfaces that the caller shall install.
150 @retval EFI_SUCCESS The interface was successfully installed.
151 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI
152 descriptors in the list do not have the
153 EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
154 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
159 (EFIAPI
*EFI_PEI_INSTALL_PPI
)(
160 IN CONST EFI_PEI_SERVICES
**PeiServices
,
161 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
165 This function reinstalls an interface in the PEI PPI database by GUID.
166 The purpose of the service is to publish an interface that other parties
167 can use to replace a same-named interface in the protocol database
168 with a different interface.
170 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table
171 published by the PEI Foundation.
172 @param OldPpi A pointer to the former PPI in the database.
173 @param NewPpi A pointer to the new interfaces that the caller shall install.
175 @retval EFI_SUCCESS The interface was successfully installed.
176 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI descriptors in the
177 list do not have the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
178 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
179 @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been installed.
184 (EFIAPI
*EFI_PEI_REINSTALL_PPI
)(
185 IN CONST EFI_PEI_SERVICES
**PeiServices
,
186 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
187 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
191 This function locates an interface in the PEI PPI database by GUID.
193 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES published by the PEI Foundation.
194 @param Guid A pointer to the GUID whose corresponding interface needs to be found.
195 @param Instance The N-th instance of the interface that is required.
196 @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
197 @param Ppi A pointer to the instance of the interface.
199 @retval EFI_SUCCESS The interface was successfully returned.
200 @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
205 (EFIAPI
*EFI_PEI_LOCATE_PPI
)(
206 IN CONST EFI_PEI_SERVICES
**PeiServices
,
207 IN CONST EFI_GUID
*Guid
,
209 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor OPTIONAL
,
214 This function installs a notification service to be called back when a
215 given interface is installed or reinstalled. The purpose of the service
216 is to publish an interface that other parties can use to call additional PPIs
217 that may materialize later.
219 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
220 @param NotifyList A pointer to the list of notification interfaces that the caller shall install.
222 @retval EFI_SUCCESS The interface was successfully installed.
223 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL, or any of the PEI PPI descriptors in the
224 list do not have the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.
225 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
230 (EFIAPI
*EFI_PEI_NOTIFY_PPI
)(
231 IN CONST EFI_PEI_SERVICES
**PeiServices
,
232 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
236 This function returns the present value of the boot mode.
238 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
239 @param BootMode A pointer to contain the value of the boot mode.
241 @retval EFI_SUCCESS The boot mode returned successfully.
246 (EFIAPI
*EFI_PEI_GET_BOOT_MODE
)(
247 IN CONST EFI_PEI_SERVICES
**PeiServices
,
248 OUT EFI_BOOT_MODE
*BootMode
252 This function sets the value of the boot mode.
254 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
255 @param BootMode The value of the boot mode to set.
257 @retval EFI_SUCCESS The boot mode returned successfully.
262 (EFIAPI
*EFI_PEI_SET_BOOT_MODE
)(
263 IN CONST EFI_PEI_SERVICES
**PeiServices
,
264 IN EFI_BOOT_MODE BootMode
268 This function returns the pointer to the list of Hand-Off Blocks (HOBs) in memory.
270 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
271 @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize
273 @retval EFI_SUCCESS The list was successfully returned.
274 @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
279 (EFIAPI
*EFI_PEI_GET_HOB_LIST
)(
280 IN CONST EFI_PEI_SERVICES
**PeiServices
,
285 This service, published by the PEI Foundation, abstracts the creation of a Hand-Off Block's (HOB's) headers.
287 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
288 @param Type The type of HOB to be installed.
289 @param Length The length of the HOB to be added.
290 @param Hob The address of a pointer that will contain the HOB header.
292 @retval EFI_SUCCESS The HOB was successfully created.
293 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
298 (EFIAPI
*EFI_PEI_CREATE_HOB
)(
299 IN CONST EFI_PEI_SERVICES
**PeiServices
,
306 The purpose of the service is to abstract the capability of the PEI
307 Foundation to discover instances of firmware volumes in the system.
309 This service enables PEIMs to discover additional firmware volumes. The PEI Foundation uses this
310 service to abstract the locations and formats of various firmware volumes. These volumes include
311 the Boot Firmware Volume and any other volumes exposed by EFI_PEI_FV_PPI. The service
312 returns a volume handle of type EFI_PEI_FV_HANDLE, which must be unique within the system.
314 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
315 @param Instance This instance of the firmware volume to find.
316 The value 0 is the Boot Firmware Volume (BFV).
317 @param VolumeHandle On exit, points to the next volumn handle or NULL if it does not exist.
319 @retval EFI_SUCCESS The volume was found.
320 @retval EFI_NOT_FOUND The volume was not found.
321 @retval EFI_INVALID_PARAMETER VolumeHandle is NULL.
326 (EFIAPI
*EFI_PEI_FFS_FIND_NEXT_VOLUME2
)(
327 IN CONST EFI_PEI_SERVICES
**PeiServices
,
329 OUT EFI_PEI_FV_HANDLE
*VolumeHandle
333 Searches for the next matching file in the firmware volume.
335 This service enables PEIMs to discover firmware files within a specified volume.
336 To find the first instance of a firmware file, pass a FileHandle value of NULL into the service.
337 The service returns a file handle of type EFI_PEI_FILE_HANDLE, which must be unique within
340 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
341 @param SearchType A filter to find files only of this type.
342 @param FvHandle Handle of firmware volume in which to search.
343 @param FileHandle On entry, points to the current handle from which to begin searching
344 or NULL to start at the beginning of the firmware volume.
345 On exit, points the file handle of the next file in the volume or NULL
346 if there are no more files.
348 @retval EFI_SUCCESS The file was found.
349 @retval EFI_NOT_FOUND The file was not found.
350 @retval EFI_NOT_FOUND The header checksum was not zero.
355 (EFIAPI
*EFI_PEI_FFS_FIND_NEXT_FILE2
)(
356 IN CONST EFI_PEI_SERVICES
**PeiServices
,
357 IN EFI_FV_FILETYPE SearchType
,
358 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
359 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
363 Searches for the next matching section within the specified file.
365 This service enables PEI modules to discover the first section of a given type within a valid file.
366 This service will search within encapsulation sections (compression and GUIDed) as well. It will
367 search inside of a GUIDed section or a compressed section, but may not, for example, search a
368 GUIDed section inside a GUIDes section.
369 This service will not search within compression sections or GUIDed sections that require
370 extraction if memory is not present.
372 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
373 @param SectionType The value of the section type to find.
374 @param FileHandle Handle of the firmware file to search.
375 @param SectionData A pointer to the discovered section, if successful.
377 @retval EFI_SUCCESS The section was found.
378 @retval EFI_NOT_FOUND The section was not found.
383 (EFIAPI
*EFI_PEI_FFS_FIND_SECTION_DATA2
)(
384 IN CONST EFI_PEI_SERVICES
**PeiServices
,
385 IN EFI_SECTION_TYPE SectionType
,
386 IN EFI_PEI_FILE_HANDLE FileHandle
,
387 OUT VOID
**SectionData
391 Searches for the next matching section within the specified file.
393 This service enables PEI modules to discover the section of a given type within a valid file.
394 This service will search within encapsulation sections (compression and GUIDed) as well. It will
395 search inside of a GUIDed section or a compressed section, but may not, for example, search a
396 GUIDed section inside a GUIDes section.
397 This service will not search within compression sections or GUIDed sections that require
398 extraction if memory is not present.
400 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
401 @param SectionType The value of the section type to find.
402 @param SectionInstance Section instance to find.
403 @param FileHandle Handle of the firmware file to search.
404 @param SectionData A pointer to the discovered section, if successful.
405 @param AuthenticationStatus A pointer to the authentication status for this section.
407 @retval EFI_SUCCESS The section was found.
408 @retval EFI_NOT_FOUND The section was not found.
413 (EFIAPI
*EFI_PEI_FFS_FIND_SECTION_DATA3
)(
414 IN CONST EFI_PEI_SERVICES
**PeiServices
,
415 IN EFI_SECTION_TYPE SectionType
,
416 IN UINTN SectionInstance
,
417 IN EFI_PEI_FILE_HANDLE FileHandle
,
418 OUT VOID
**SectionData
,
419 OUT UINT32
*AuthenticationStatus
423 This function registers the found memory configuration with the PEI Foundation.
425 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
426 @param MemoryBegin The value of a region of installed memory.
427 @param MemoryLength The corresponding length of a region of installed memory.
429 @retval EFI_SUCCESS The region was successfully installed in a HOB.
430 @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
431 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
436 (EFIAPI
*EFI_PEI_INSTALL_PEI_MEMORY
)(
437 IN CONST EFI_PEI_SERVICES
**PeiServices
,
438 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
439 IN UINT64 MemoryLength
443 The purpose of the service is to publish an interface that allows
444 PEIMs to allocate memory ranges that are managed by the PEI Foundation.
446 Prior to InstallPeiMemory() being called, PEI will allocate pages from the heap.
447 After InstallPeiMemory() is called, PEI will allocate pages within the region
448 of memory provided by InstallPeiMemory() service in a best-effort fashion.
449 Location-specific allocations are not managed by the PEI foundation code.
451 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
452 @param MemoryType The type of memory to allocate.
453 @param Pages The number of contiguous 4 KB pages to allocate.
454 @param Memory A pointer to a physical address. On output, the address is set to the base
455 of the page range that was allocated.
457 @retval EFI_SUCCESS The memory range was successfully allocated.
458 @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
459 @retval EFI_INVALID_PARAMETER The type is not equal to EfiLoaderCode, EfiLoaderData, EfiRuntimeServicesCode,
460 EfiRuntimeServicesData, EfiBootServicesCode, EfiBootServicesData,
461 EfiACPIReclaimMemory, EfiReservedMemoryType, or EfiACPIMemoryNVS.
466 (EFIAPI
*EFI_PEI_ALLOCATE_PAGES
)(
467 IN CONST EFI_PEI_SERVICES
**PeiServices
,
468 IN EFI_MEMORY_TYPE MemoryType
,
470 OUT EFI_PHYSICAL_ADDRESS
*Memory
476 @param[in] PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
477 @param[in] Memory The base physical address of the pages to be freed.
478 @param[in] Pages The number of contiguous 4 KB pages to free.
480 @retval EFI_SUCCESS The requested pages were freed.
481 @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.
482 @retval EFI_NOT_FOUND The requested memory pages were not allocated with
488 (EFIAPI
*EFI_PEI_FREE_PAGES
)(
489 IN CONST EFI_PEI_SERVICES
**PeiServices
,
490 IN EFI_PHYSICAL_ADDRESS Memory
,
495 The purpose of this service is to publish an interface that
496 allows PEIMs to allocate memory ranges that are managed by the PEI Foundation.
498 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
499 @param Size The number of bytes to allocate from the pool.
500 @param Buffer If the call succeeds, a pointer to a pointer to the allocated buffer; undefined otherwise.
502 @retval EFI_SUCCESS The allocation was successful.
503 @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
508 (EFIAPI
*EFI_PEI_ALLOCATE_POOL
)(
509 IN CONST EFI_PEI_SERVICES
**PeiServices
,
515 This service copies the contents of one buffer to another buffer.
517 @param Destination The pointer to the destination buffer of the memory copy.
518 @param Source The pointer to the source buffer of the memory copy.
519 @param Length The number of bytes to copy from Source to Destination.
524 (EFIAPI
*EFI_PEI_COPY_MEM
)(
525 IN VOID
*Destination
,
531 The service fills a buffer with a specified value.
533 @param Buffer The pointer to the buffer to fill.
534 @param Size The number of bytes in Buffer to fill.
535 @param Value The value to fill Buffer with.
540 (EFIAPI
*EFI_PEI_SET_MEM
)(
547 This service publishes an interface that allows PEIMs to report status codes.
549 ReportStatusCode() is called by PEIMs that wish to report status information on their
550 progress. The principal use model is for a PEIM to emit one of the standard 32-bit error codes. This
551 will allow a platform owner to ascertain the state of the system, especially under conditions where
552 the full consoles might not have been installed.
554 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
555 @param Type Indicates the type of status code being reported.
556 @param Value Describes the current status of a hardware or
557 software entity. This includes information about the class and
558 subclass that is used to classify the entity as well as an operation.
559 For progress codes, the operation is the current activity.
560 For error codes, it is the exception.For debug codes,it is not defined at this time.
561 @param Instance The enumeration of a hardware or software entity within
562 the system. A system may contain multiple entities that match a class/subclass
563 pairing. The instance differentiates between them. An instance of 0 indicates
564 that instance information is unavailable, not meaningful, or not relevant.
565 Valid instance numbers start with 1.
566 @param CallerId This optional parameter may be used to identify the caller.
567 This parameter allows the status code driver to apply different rules to
569 @param Data This optional parameter may be used to pass additional data.
571 @retval EFI_SUCCESS The function completed successfully.
572 @retval EFI_NOT_AVAILABLE_YET No progress code provider has installed an interface in the system.
577 (EFIAPI
*EFI_PEI_REPORT_STATUS_CODE
)(
578 IN CONST EFI_PEI_SERVICES
**PeiServices
,
579 IN EFI_STATUS_CODE_TYPE Type
,
580 IN EFI_STATUS_CODE_VALUE Value
,
582 IN CONST EFI_GUID
*CallerId OPTIONAL
,
583 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
587 Resets the entire platform.
589 This service resets the entire platform, including all processors
590 and devices, and reboots the system.
591 This service will never return EFI_SUCCESS.
593 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES
594 table published by the PEI Foundation.
596 @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
601 (EFIAPI
*EFI_PEI_RESET_SYSTEM
)(
602 IN CONST EFI_PEI_SERVICES
**PeiServices
606 Resets the entire platform.
608 @param[in] ResetType The type of reset to perform.
609 @param[in] ResetStatus The status code for the reset.
610 @param[in] DataSize The size, in bytes, of ResetData.
611 @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown
612 the data buffer starts with a Null-terminated string, optionally
613 followed by additional binary data. The string is a description
614 that the caller may use to further indicate the reason for the
620 (EFIAPI
*EFI_PEI_RESET2_SYSTEM
)(
621 IN EFI_RESET_TYPE ResetType
,
622 IN EFI_STATUS ResetStatus
,
624 IN VOID
*ResetData OPTIONAL
628 Find a file within a volume by its name.
630 This service searches for files with a specific name, within
631 either the specified firmware volume or all firmware volumes.
632 The service returns a file handle of type EFI_PEI_FILE_HANDLE,
633 which must be unique within the system.
635 @param FileName A pointer to the name of the file to
636 find within the firmware volume.
637 @param VolumeHandle The firmware volume to search.
638 @param FileHandle Upon exit, points to the found file's
639 handle or NULL if it could not be found.
641 @retval EFI_SUCCESS The file was found.
642 @retval EFI_NOT_FOUND The file was not found.
643 @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or
649 (EFIAPI
*EFI_PEI_FFS_FIND_BY_NAME
)(
650 IN CONST EFI_GUID
*FileName
,
651 IN EFI_PEI_FV_HANDLE VolumeHandle
,
652 OUT EFI_PEI_FILE_HANDLE
*FileHandle
656 /// The information of the FV file.
660 /// Name of the file.
666 EFI_FV_FILETYPE FileType
;
668 /// Attributes of the file.
670 EFI_FV_FILE_ATTRIBUTES FileAttributes
;
672 /// Points to the file's data (not the header).
673 /// Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED
678 /// Size of the file's data.
684 /// The information with authentication status of the FV file.
688 /// Name of the file.
694 EFI_FV_FILETYPE FileType
;
696 /// Attributes of the file.
698 EFI_FV_FILE_ATTRIBUTES FileAttributes
;
700 /// Points to the file's data (not the header).
701 /// Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED
706 /// Size of the file's data.
710 /// Authentication status for this file.
712 UINT32 AuthenticationStatus
;
716 Returns information about a specific file.
718 This function returns information about a specific file,
719 including its file name, type, attributes, starting address and
720 size. If the firmware volume is not memory mapped, then the
721 Buffer member will be NULL.
723 @param FileHandle The handle of the file.
724 @param FileInfo Upon exit, points to the file's
727 @retval EFI_SUCCESS File information was returned.
728 @retval EFI_INVALID_PARAMETER FileHandle does not
729 represent a valid file.
730 @retval EFI_INVALID_PARAMETER FileInfo is NULL.
735 (EFIAPI
*EFI_PEI_FFS_GET_FILE_INFO
)(
736 IN EFI_PEI_FILE_HANDLE FileHandle
,
737 OUT EFI_FV_FILE_INFO
*FileInfo
741 Returns information about a specific file.
743 This function returns information about a specific file,
744 including its file name, type, attributes, starting address, size and authentication status.
745 If the firmware volume is not memory mapped, then the Buffer member will be NULL.
747 @param FileHandle The handle of the file.
748 @param FileInfo Upon exit, points to the file's
751 @retval EFI_SUCCESS File information was returned.
752 @retval EFI_INVALID_PARAMETER FileHandle does not
753 represent a valid file.
754 @retval EFI_INVALID_PARAMETER FileInfo is NULL.
759 (EFIAPI
*EFI_PEI_FFS_GET_FILE_INFO2
)(
760 IN EFI_PEI_FILE_HANDLE FileHandle
,
761 OUT EFI_FV_FILE_INFO2
*FileInfo
765 /// The information of the FV volume.
769 /// Attributes of the firmware volume.
771 EFI_FVB_ATTRIBUTES_2 FvAttributes
;
773 /// Format of the firmware volume.
777 /// Name of the firmware volume.
781 /// Points to the first byte of the firmware
782 /// volume, if bit EFI_FVB_MEMORY_MAPPED is
783 /// set in FvAttributes.
787 /// Size of the firmware volume.
793 Returns information about the specified volume.
795 This function returns information about a specific firmware
796 volume, including its name, type, attributes, starting address
799 @param VolumeHandle Handle of the volume.
800 @param VolumeInfo Upon exit, points to the volume's information.
802 @retval EFI_SUCCESS The volume information returned.
803 @retval EFI_INVALID_PARAMETER If VolumeHandle does not represent a valid volume.
804 @retval EFI_INVALID_PARAMETER If VolumeHandle is NULL.
805 @retval EFI_SUCCESS Information was successfully returned.
806 @retval EFI_INVALID_PARAMETER The volume designated by the VolumeHandle is not available.
811 (EFIAPI
*EFI_PEI_FFS_GET_VOLUME_INFO
)(
812 IN EFI_PEI_FV_HANDLE VolumeHandle
,
813 OUT EFI_FV_INFO
*VolumeInfo
817 Register a PEIM so that it will be shadowed and called again.
819 This service registers a file handle so that after memory is
820 available, the PEIM will be re-loaded into permanent memory and
821 re-initialized. The PEIM registered this way will always be
822 initialized twice. The first time, this function call will
823 return EFI_SUCCESS. The second time, this function call will
824 return EFI_ALREADY_STARTED. Depending on the order in which
825 PEIMs are dispatched, the PEIM making this call may be
826 initialized after permanent memory is installed, even the first
829 @param FileHandle PEIM's file handle. Must be the currently
832 @retval EFI_SUCCESS The PEIM was successfully registered for
834 @retval EFI_ALREADY_STARTED The PEIM was previously
835 registered for shadowing.
836 @retval EFI_NOT_FOUND The FileHandle does not refer to a
842 (EFIAPI
*EFI_PEI_REGISTER_FOR_SHADOW
)(
843 IN EFI_PEI_FILE_HANDLE FileHandle
847 // PEI Specification Revision information
849 #define PEI_SPECIFICATION_MAJOR_REVISION 1
850 #define PEI_SPECIFICATION_MINOR_REVISION 70
852 /// Specification inconsistency here:
853 /// In the PI1.0 spec, PEI_SERVICES_SIGNATURE is defined as 0x5652455320494550. But
854 /// to pass a multiple tool chain, it appends an ULL.
857 // PEI Services Table
859 #define PEI_SERVICES_SIGNATURE 0x5652455320494550ULL
861 /// Specification inconsistency here:
862 /// In the PI1.0 specification, there is a typo error in PEI_SERVICES_REVISION. In the specification the defintion is
863 /// #define ((PEI_SPECIFICATION_MAJOR_REVISION<<16) |(PEI_SPECIFICATION_MINOR_REVISION))
864 /// and it should be as follows:
866 #define PEI_SERVICES_REVISION ((PEI_SPECIFICATION_MAJOR_REVISION<<16) | (PEI_SPECIFICATION_MINOR_REVISION))
869 /// EFI_PEI_SERVICES is a collection of functions whose implementation is provided by the PEI
870 /// Foundation. These services fall into various classes, including the following:
871 /// - Managing the boot mode
872 /// - Allocating both early and permanent memory
873 /// - Supporting the Firmware File System (FFS)
874 /// - Abstracting the PPI database abstraction
875 /// - Creating Hand-Off Blocks (HOBs).
877 struct _EFI_PEI_SERVICES
{
879 /// The table header for the PEI Services Table.
881 EFI_TABLE_HEADER Hdr
;
886 EFI_PEI_INSTALL_PPI InstallPpi
;
887 EFI_PEI_REINSTALL_PPI ReInstallPpi
;
888 EFI_PEI_LOCATE_PPI LocatePpi
;
889 EFI_PEI_NOTIFY_PPI NotifyPpi
;
892 // Boot Mode Functions
894 EFI_PEI_GET_BOOT_MODE GetBootMode
;
895 EFI_PEI_SET_BOOT_MODE SetBootMode
;
900 EFI_PEI_GET_HOB_LIST GetHobList
;
901 EFI_PEI_CREATE_HOB CreateHob
;
904 // Firmware Volume Functions
906 EFI_PEI_FFS_FIND_NEXT_VOLUME2 FfsFindNextVolume
;
907 EFI_PEI_FFS_FIND_NEXT_FILE2 FfsFindNextFile
;
908 EFI_PEI_FFS_FIND_SECTION_DATA2 FfsFindSectionData
;
911 // PEI Memory Functions
913 EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory
;
914 EFI_PEI_ALLOCATE_PAGES AllocatePages
;
915 EFI_PEI_ALLOCATE_POOL AllocatePool
;
916 EFI_PEI_COPY_MEM CopyMem
;
917 EFI_PEI_SET_MEM SetMem
;
922 EFI_PEI_REPORT_STATUS_CODE ReportStatusCode
;
927 EFI_PEI_RESET_SYSTEM ResetSystem
;
930 // (the following interfaces are installed by publishing PEIM)
933 EFI_PEI_CPU_IO_PPI
*CpuIo
;
934 EFI_PEI_PCI_CFG2_PPI
*PciCfg
;
937 // Future Installed Services
939 EFI_PEI_FFS_FIND_BY_NAME FfsFindFileByName
;
940 EFI_PEI_FFS_GET_FILE_INFO FfsGetFileInfo
;
941 EFI_PEI_FFS_GET_VOLUME_INFO FfsGetVolumeInfo
;
942 EFI_PEI_REGISTER_FOR_SHADOW RegisterForShadow
;
943 EFI_PEI_FFS_FIND_SECTION_DATA3 FindSectionData3
;
944 EFI_PEI_FFS_GET_FILE_INFO2 FfsGetFileInfo2
;
945 EFI_PEI_RESET2_SYSTEM ResetSystem2
;
946 EFI_PEI_FREE_PAGES FreePages
;
950 /// EFI_SEC_PEI_HAND_OFF structure holds information about
951 /// PEI core's operating environment, such as the size of location of
952 /// temporary RAM, the stack location and BFV location.
954 typedef struct _EFI_SEC_PEI_HAND_OFF
{
956 /// Size of the data structure.
961 /// Points to the first byte of the boot firmware volume,
962 /// which the PEI Dispatcher should search for
965 VOID
*BootFirmwareVolumeBase
;
968 /// Size of the boot firmware volume, in bytes.
970 UINTN BootFirmwareVolumeSize
;
973 /// Points to the first byte of the temporary RAM.
975 VOID
*TemporaryRamBase
;
978 /// Size of the temporary RAM, in bytes.
980 UINTN TemporaryRamSize
;
983 /// Points to the first byte of the temporary RAM
984 /// available for use by the PEI Foundation. The area
985 /// described by PeiTemporaryRamBase and PeiTemporaryRamSize
986 /// must not extend outside beyond the area described by
987 /// TemporaryRamBase & TemporaryRamSize. This area should not
988 /// overlap with the area reported by StackBase and
991 VOID
*PeiTemporaryRamBase
;
994 /// The size of the available temporary RAM available for
995 /// use by the PEI Foundation, in bytes.
997 UINTN PeiTemporaryRamSize
;
1000 /// Points to the first byte of the stack.
1001 /// This are may be part of the memory described by
1002 /// TemporaryRamBase and TemporaryRamSize
1003 /// or may be an entirely separate area.
1008 /// Size of the stack, in bytes.
1011 } EFI_SEC_PEI_HAND_OFF
;
1014 The entry point of PEI Foundation.
1016 This function is the entry point for the PEI Foundation, which
1017 allows the SEC phase to pass information about the stack,
1018 temporary RAM and the Boot Firmware Volume. In addition, it also
1019 allows the SEC phase to pass services and data forward for use
1020 during the PEI phase in the form of one or more PPIs. These PPI's
1021 will be installed and/or immediately signaled if they are
1022 notification type. There is no limit to the number of additional
1023 PPIs that can be passed from SEC into the PEI Foundation. As part
1024 of its initialization phase, the PEI Foundation will add these
1025 SEC-hosted PPIs to its PPI database such that both the PEI
1026 Foundation and any modules can leverage the associated service
1027 calls and/or code in these early PPIs.
1029 @param SecCoreData Points to a data structure containing
1030 information about the PEI core's
1031 operating environment, such as the size
1032 and location of temporary RAM, the stack
1033 location and the BFV location.
1035 @param PpiList Points to a list of one or more PPI
1036 descriptors to be installed initially by
1037 the PEI core. An empty PPI list consists
1038 of a single descriptor with the end-tag
1039 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.
1040 As part of its initialization phase, the
1041 PEI Foundation will add these SEC-hosted
1042 PPIs to its PPI database such that both
1043 the PEI Foundation and any modules can
1044 leverage the associated service calls
1045 and/or code in these early PPIs.
1051 (EFIAPI
*EFI_PEI_CORE_ENTRY_POINT
)(
1052 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
1053 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList