PEI代码分析
EFI_PEI_INSTALL_PPI函数原型
描述:
作用:
/**
This service is the first one provided by the PEI Foundation. This function
installs an interface in the PEI PPI database by GUID. The purpose of the
service is to publish an interface that other parties can use to call
additional PEIMs.
//一个由PEI Foundation发布的间接指向EFI_PEI_SERVICES table的指针
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table
published by the PEI Foundation.
//一个指向调用者将要install的接口列表的指针
@param PpiList A pointer to the list of interfaces that the caller shall install.
@retval EFI_SUCCESS The interface was successfully installed.
@retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI
descriptors in the list do not have the
EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
@retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PEI_INSTALL_PPI)(
IN CONST EFI_PEI_SERVICES **PeiServices,
IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
);
EFI_PEI_PPI_DESCRIPTOR结构体
描述:该数据结构通过一个PEIM描述可用的service给PEI Foundation。
作用:每个PPI是由{类型,GUID(名字,以后就根据这个来找到它),Function_Entry_Address}组成。
///
/// The data structure through which a PEIM describes available services to the PEI Foundation.
///
typedef struct {
///
/// This field is a set of flags describing the characteristics of this imported table entry.
/// All flags are defined as EFI_PEI_PPI_DESCRIPTOR_***, which can also be combined into one.
///
UINTN Flags;
///
/// The address of the EFI_GUID that names the interface.
///
EFI_GUID *Guid;
///
/// A pointer to the PPI. It contains the information necessary to install a service.
///
VOID *Ppi;
} EFI_PEI_PPI_DESCRIPTOR;