UEFI PI 规范1.7--- 3 PEI Services Table

3 PEI Services Table

3.1 Introduction

   The PEI Foundation establishes a system table named the PEI Services Table that is visible to all
Pre-EFI Initialization Modules (PEIMs) in the system. A PEI Service is defined as a function,
command, or other capability manifested by the PEI Foundation when that service’s initialization
requirements are met. Because the PEI phase has no permanent memory available until nearly the
end of the phase, the range of services created during the PEI phase cannot be as rich as those
created during later phases. Because the location of the PEI Foundation and its temporary RAM is
not known at build time, a pointer to the PEI Services Table is passed into each PEIM's entry point
and also to part of each PEIM-to-PEIM Interface (PPI).

      PEI Foundation建立了一个系统表称为PEI Services。在系统中对所有的PEIM可见。PEI Service被PEI Foundation定义为函数、命令或者其他能力的体现,这是当该service的初始化功能被需要的时候。因为PEI阶段接近结束的时候都没有永久的内存可以使用,PEI阶段创建的服务不如后面的阶段来的丰富。因为PEI Foundation和它所在的temporary RAM在编译阶段并不知道。一个指向PEI Services Table存在于每一个PEIM的entry point中,而且也作为PPI的一部分。  

3.2 PEI Services Table

Summary
The PEI Services Table includes a list of function pointers in a table. The table is located in the
temporary or permanent memory, depending upon the capabilities and phase of execution of PEI.

     PEI Services的Table中包含了一系列的函数指针。该table位于临时RAM或者永久RAM取决于PEI的能力以及PEI所执行的阶段。Related Definitions

//
// PEI Specification Revision information
//
#define PEI_SPECIFICATION_MAJOR_REVISION 1
#define PEI_SPECIFICATION_MINOR_REVISION 70
//
// UEFI PEI Services Table
//
#define PEI_SERVICES_SIGNATURE 0x5652455320494550
#define ((PEI_SPECIFICATION_MAJOR_REVISION<<17) | (PEI_SPECIFICATION_MINOR_REVISION))
//
// UEFI PEI Services Table
//
#define PEI_SERVICES_SIGNATURE 0x5652455320494550
#define ((PEI_SPECIFICATION_MAJOR_REVISION<<17) | (PEI_SPECIFICATION_MINOR_REVISION))
typedef EFI_PEI_SERVICES {
EFI_TABLE_HEADER Hdr;

//
// PPI Functions
//
EFI_PEI_INSTALL_PPI InstallPpi;
EFI_PEI_REINSTALL_PPI ReInstallPpi;
EFI_PEI_LOCATE_PPI LocatePpi;
EFI_PEI_NOTIFY_PPI NotifyPpi;

//
// Boot Mode Functions
//
EFI_PEI_GET_BOOT_MODE GetBootMode;
EFI_PEI_SET_BOOT_MODE SetBootMode;

//
// HOB Functions
//
EFI_PEI_GET_HOB_LIST GetHobList;
EFI_PEI_CREATE_HOB CreateHob;

//
// Firmware Volume Functions
//
EFI_PEI_FFS_FIND_NEXT_VOLUME2 FfsFindNextVolume;
EFI_PEI_FFS_FIND_NEXT_FILE2 FfsFindNextFile;
EFI_PEI_FFS_FIND_SECTION_DATA2 FfsFindSectionData;

//
// PEI Memory Functions
//
EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory;
EFI_PEI_ALLOCATE_PAGES AllocatePages;
EFI_PEI_ALLOCATE_POOL AllocatePool;
EFI_PEI_COPY_MEM CopyMem;
EFI_PEI_SET_MEM SetMem;

//
// Status Code
//
EFI_PEI_REPORT_STATUS_CODE ReportStatusCode;

//
// Reset
//
EFI_PEI_RESET_SYSTEM ResetSystem;

//
// (the following interfaces are installed by publishing PEIM)
//
// I/O Abstractions
//
EFI_PEI_CPU_IO_PPI *CpuIo;
EFI_PEI_PCI_CFG2_PPI *PciCfg;

//
// Additional File System-Related Services
//
EFI_PEI_FFS_FIND_BY_NAME FfsFindFileByName;
EFI_PEI_FFS_GET_FILE_INFO FfsGetFileInfo;
EFI_PEI_FFS_GET_VOLUME_INFO FfsGetVolumeInfo;
EFI_PEI_REGISTER_FOR_SHADOW RegisterForShadow;

EFI_PEI_FFS_FIND_SECTION_DATA3 FindSectionData3;
EFI_PEI_FFS_GET_FILE_INFO2 FfsGetFileInfo2;
EFI_PEI_RESET2_SYSTEM ResetSystem2;
EFI_PEI_FREE_PAGES FreePages;
} EFI_PEI_SERVICES;

具体参数含义见第4章

Description
EFI_PEI_SERVICES is a collection of functions whose implementation is provided by the PEI
Foundation. These services fall into various classes, including the following:

EFI_PEI_SERVICES是一个函数的合集,其实现由PEI Foundation来提供。这些服务函数由各自不同的作用,分类如下:

• Managing the boot mode

• Allocating both early and permanent memory

• Supporting the Firmware File System (FFS)

• Abstracting the PPI database abstraction

• Creating Hand-Off Blocks (HOBs)

  • 管理启动模式
  • 分配早期和永久内存
  • FFS进行支持
  • 抽象化PPI database
  • 创建Hand-Off Blocks(HOBS)

     A pointer to the EFI_PEI_SERVICES table is passed into each PEIM when the PEIM is invoked
by the PEI Foundation. As such, every PEIM has access to these services. Unlike the UEFI Boot
Services, the PEI Services have no calling restrictions, such as the UEFI 2.0 Task Priority Level
(TPL) limitations. Specifically, a service can be called from a PEIM or notification service.

       当PEI Foundation唤起PEIM的时候,都会有一个指向EFI_PEI_SERVICES table的指针传递给该PEIM。正由此每个PEIM都可以使用这些services。和UEFI Boot Services不同的是,PEI Services没有调用限制,例如UEFI 2.0的Task Priority Level(TPL)限制。 特别说明的是,services可以被PEIM和notification service调用。

    Some of the services are also a proxy to platform-provided services, such as the Reset Services,
Status Code Services, and I/O abstractions. This partitioning has been designed to provide a
consistent interface to all PEIMs without encumbering a PEI Foundation implementation with
platform-specific knowledge. Any callable services beyond the set in this table should be invoked
using a PPI. The latter PEIM-installed services will return EFI_NOT_AVAILABLE_YET until a
PEIM copies an instance of the interface into the EFI_PEI_SERVICES table.

       有一些服务同样也是平台提供服务的代理,例如Reset Services,Status Code Services和I/O abstractions。这种划分设计为所有PEIMs提供一致的接口,而不妨碍使用特定于平台的知识的PEI Foundation实现。此表中设置之外的任何可调用服务都应该使用PPI调用。之后PEIM所安装的services将会return EFI_NOT_AVAILABLE_YET 直到PEIM复制了该interface的实例到EFI_PEI_SERVICES table。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值