]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Pi/PiPeiCis.h
1. Enable use-cases in PEI using SecurityPPI co-equal to the use-cases in DXE using...
[mirror_edk2.git] / MdePkg / Include / Pi / PiPeiCis.h
index 059b90b08495a6eff144f695f94ffc8f4c3e83af..f2da20a2367b906042cf9c60b7f35ee533f2015a 100644 (file)
@@ -1,61 +1,68 @@
-\r
 /** @file\r
   PI PEI master include file. This file should match the PI spec.\r
 \r
-  Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
-  All rights reserved. This program and the accompanying materials                          \r
-  are licensed and made available under the terms and conditions of the BSD License         \r
-  which accompanies this distribution.  The full text of the license may be found at        \r
-  http://opensource.org/licenses/bsd-license.php                                            \r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution.  \r
+The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php.                                            \r
+                                           \r
 \r
-  Module Name:  PiPeiCis.h\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
   @par Revision Reference:\r
-  Version 1.0.\r
+  PI Version 1.2.\r
 \r
 **/\r
 \r
 #ifndef __PI_PEICIS_H__\r
 #define __PI_PEICIS_H__\r
 \r
+#include <Uefi/UefiMultiPhase.h>\r
 #include <Pi/PiMultiPhase.h>\r
 \r
-#define EFI_NOT_AVAILABLE_YET   EFIERR (28)\r
+///\r
+/// The handles of EFI FV.\r
+/// \r
+typedef VOID    *EFI_PEI_FV_HANDLE;\r
 \r
-//\r
-// Handles of EFI FV/FFS.\r
-// \r
-typedef VOID           *EFI_PEI_FV_HANDLE;\r
-typedef VOID           *EFI_PEI_FILE_HANDLE;\r
+///\r
+/// The handles of EFI FFS.\r
+/// \r
+typedef VOID    *EFI_PEI_FILE_HANDLE;\r
 \r
-//\r
-// Declare forward referenced data structures\r
-//\r
+///\r
+/// Declare the forward reference data structure for EFI_PEI_SERVICE.\r
+//\r
 typedef struct _EFI_PEI_SERVICES          EFI_PEI_SERVICES;\r
+\r
+///\r
+/// Declare the forward reference data structure for EFI_PEI_NOTIFY_DESCRIPTOR.\r
+/// \r
 typedef struct _EFI_PEI_NOTIFY_DESCRIPTOR EFI_PEI_NOTIFY_DESCRIPTOR;\r
 \r
 \r
 #include <Ppi/CpuIo.h>\r
 #include <Ppi/PciCfg2.h>\r
 \r
+\r
 /**\r
   The PEI Dispatcher will invoke each PEIM one time.  During this pass, the PEI \r
   Dispatcher will pass control to the PEIM at the AddressOfEntryPoint in the PE Header. \r
 \r
-  @param  FfsHeader        Pointer to the FFS file header.\r
+  @param  FileHandle       Pointer to the FFS file header.\r
   @param  PeiServices      Describes the list of possible PEI Services.\r
 \r
-  @return Status code\r
+  @retval EFI_SUCCESS      The PEI completed successfully.\r
+  @retval !EFI_SUCCESS     There is error in PEIM.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEIM_ENTRY_POINT)(\r
-  IN EFI_FFS_FILE_HEADER       *FfsHeader,\r
-  IN EFI_PEI_SERVICES          **PeiServices\r
+(EFIAPI *EFI_PEIM_ENTRY_POINT2)(\r
+  IN EFI_PEI_FILE_HANDLE             FileHandle,\r
+  IN CONST EFI_PEI_SERVICES          **PeiServices\r
   );\r
 \r
 /**\r
@@ -65,12 +72,11 @@ EFI_STATUS
   @param  NotifyDescriptor Address of the notification descriptor data structure.\r
   @param  Ppi              Address of the PPI that was installed.\r
 \r
-  @return Status code\r
-  \r
+  @return Status of the notification.\r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEIM_NOTIFY_ENTRY_POINT) (\r
+(EFIAPI *EFI_PEIM_NOTIFY_ENTRY_POINT)(\r
   IN EFI_PEI_SERVICES           **PeiServices,\r
   IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,\r
   IN VOID                       *Ppi\r
@@ -86,30 +92,58 @@ EFI_STATUS
 #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES     0x00000060\r
 #define EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST   0x80000000\r
 \r
+///\r
+/// The data structure through which a PEIM describes available services to the PEI Foundation.\r
+/// \r
 typedef struct {\r
+  ///\r
+  /// This field is a set of flags describing the characteristics of this imported table entry.\r
+  /// All flags are defined as EFI_PEI_PPI_DESCRIPTOR_***, which can also be combined into one.\r
+  ///\r
   UINTN     Flags;\r
+  ///\r
+  /// The address of the EFI_GUID that names the interface.\r
+  ///\r
   EFI_GUID  *Guid;\r
+  ///\r
+  /// A pointer to the PPI. It contains the information necessary to install a service.\r
+  ///\r
   VOID      *Ppi;\r
 } EFI_PEI_PPI_DESCRIPTOR;\r
 \r
+/// \r
+/// The data structure in a given PEIM that tells the PEI \r
+/// Foundation where to invoke the notification service.\r
+/// \r
 struct _EFI_PEI_NOTIFY_DESCRIPTOR {\r
+  ///\r
+  /// Details if the type of notification are callback or dispatch.\r
+  ///\r
   UINTN                       Flags;\r
+  ///\r
+  /// The address of the EFI_GUID that names the interface.\r
+  ///\r
   EFI_GUID                    *Guid;\r
+  ///\r
+  /// Address of the notification callback function itself within the PEIM.\r
+  ///\r
   EFI_PEIM_NOTIFY_ENTRY_POINT Notify;\r
 };\r
 \r
-//\r
-// Describes request of the module to be loaded to \r
-// the permanent memory once it is available. Unlike most of the other HOBs, \r
-// this HOB is produced and consumed during the HOB producer phase.\r
-// \r
-typedef struct _EFI_HOB_LOAD_PEIM {\r
-       EFI_HOB_GENERIC_HEADER            Header;\r
-       EFI_PEI_FILE_HANDLE               FileHandle;\r
-       EFI_PEIM_ENTRY_POINT              EntryPoint;\r
-       EFI_PEIM_ENTRY_POINT              InMemEntryPoint;\r
-} EFI_HOB_LOAD_PEIM;\r
-\r
+///\r
+/// This data structure is the means by which callable services are installed and\r
+/// notifications are registered in the PEI phase.\r
+///\r
+typedef union {\r
+  ///\r
+  /// The typedef structure of the notification descriptor.\r
+  ///\r
+  EFI_PEI_NOTIFY_DESCRIPTOR   Notify;\r
+  ///\r
+  /// The typedef structure of the PPI descriptor.\r
+  ///\r
+  EFI_PEI_PPI_DESCRIPTOR      Ppi;\r
+} EFI_PEI_DESCRIPTOR;\r
 \r
 /**\r
   This service is the first one provided by the PEI Foundation.  This function \r
@@ -122,15 +156,17 @@ typedef struct _EFI_HOB_LOAD_PEIM {
   @param  PpiList          A pointer to the list of interfaces that the caller shall install.\r
 \r
   @retval EFI_SUCCESS           The interface was successfully installed.\r
-  @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.\r
+  @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI \r
+                                descriptors in the list do not have the \r
+                                EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.\r
   @retval EFI_OUT_OF_RESOURCES  There is no additional space in the PPI database.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_INSTALL_PPI) (\r
-  IN EFI_PEI_SERVICES            **PeiServices,\r
-  IN EFI_PEI_PPI_DESCRIPTOR      *PpiList\r
+(EFIAPI *EFI_PEI_INSTALL_PPI)(\r
+  IN CONST EFI_PEI_SERVICES            **PeiServices,\r
+  IN CONST EFI_PEI_PPI_DESCRIPTOR      *PpiList\r
   );\r
 \r
 /**\r
@@ -153,10 +189,10 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_REINSTALL_PPI) (\r
-  IN EFI_PEI_SERVICES                **PeiServices,\r
-  IN EFI_PEI_PPI_DESCRIPTOR          *OldPpi,\r
-  IN EFI_PEI_PPI_DESCRIPTOR          *NewPpi\r
+(EFIAPI *EFI_PEI_REINSTALL_PPI)(\r
+  IN CONST EFI_PEI_SERVICES                **PeiServices,\r
+  IN CONST EFI_PEI_PPI_DESCRIPTOR          *OldPpi,\r
+  IN CONST EFI_PEI_PPI_DESCRIPTOR          *NewPpi\r
   );\r
 \r
 /**\r
@@ -174,12 +210,12 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_LOCATE_PPI) (\r
-  IN EFI_PEI_SERVICES            **PeiServices,\r
-  IN EFI_GUID                    *Guid,\r
-  IN UINTN                       Instance,\r
-  IN OUT EFI_PEI_PPI_DESCRIPTOR  **PpiDescriptor,\r
-  IN OUT VOID                    **Ppi\r
+(EFIAPI *EFI_PEI_LOCATE_PPI)(\r
+  IN CONST EFI_PEI_SERVICES            **PeiServices,\r
+  IN CONST EFI_GUID                    *Guid,\r
+  IN UINTN                             Instance,\r
+  IN OUT   EFI_PEI_PPI_DESCRIPTOR      **PpiDescriptor OPTIONAL,\r
+  IN OUT   VOID                        **Ppi\r
   );\r
 \r
 /**\r
@@ -192,16 +228,16 @@ EFI_STATUS
   @param  NotifyList       A pointer to the list of notification interfaces that the caller shall install.\r
 \r
   @retval EFI_SUCCESS           The interface was successfully installed.\r
-  @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI descriptors in the \r
+  @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL, or any of the PEI PPI descriptors in the \r
                                 list do not have the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.\r
   @retval EFI_OUT_OF_RESOURCES  There is no additional space in the PPI database.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_NOTIFY_PPI) (\r
-  IN EFI_PEI_SERVICES                **PeiServices,\r
-  IN EFI_PEI_NOTIFY_DESCRIPTOR       *NotifyList\r
+(EFIAPI *EFI_PEI_NOTIFY_PPI)(\r
+  IN CONST EFI_PEI_SERVICES                **PeiServices,\r
+  IN CONST EFI_PEI_NOTIFY_DESCRIPTOR       *NotifyList\r
   );\r
 \r
 /**\r
@@ -210,14 +246,14 @@ EFI_STATUS
   @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
   @param  BootMode         A pointer to contain the value of the boot mode.\r
 \r
-  @retval EFI_SUCCESS           The boot mode was returned successfully.\r
+  @retval EFI_SUCCESS           The boot mode returned successfully.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_GET_BOOT_MODE) (\r
-  IN EFI_PEI_SERVICES            **PeiServices,\r
-  OUT EFI_BOOT_MODE              *BootMode\r
+(EFIAPI *EFI_PEI_GET_BOOT_MODE)(\r
+  IN CONST EFI_PEI_SERVICES            **PeiServices,\r
+  OUT EFI_BOOT_MODE                    *BootMode\r
   );\r
 \r
 /**\r
@@ -226,14 +262,14 @@ EFI_STATUS
   @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation\r
   @param  BootMode         The value of the boot mode to set.\r
 \r
-  @retval EFI_SUCCESS           The boot mode was returned successfully.\r
+  @retval EFI_SUCCESS           The boot mode returned successfully.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_SET_BOOT_MODE) (\r
-  IN EFI_PEI_SERVICES            **PeiServices,\r
-  IN EFI_BOOT_MODE               BootMode\r
+(EFIAPI *EFI_PEI_SET_BOOT_MODE)(\r
+  IN CONST EFI_PEI_SERVICES            **PeiServices,\r
+  IN EFI_BOOT_MODE                     BootMode\r
   );\r
 \r
 /**\r
@@ -248,13 +284,13 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_GET_HOB_LIST) (\r
-  IN EFI_PEI_SERVICES            **PeiServices,\r
-  IN OUT VOID                    **HobList\r
+(EFIAPI *EFI_PEI_GET_HOB_LIST)(\r
+  IN CONST EFI_PEI_SERVICES        **PeiServices,\r
+  OUT VOID                         **HobList\r
   );\r
 \r
 /**\r
-  This service published by the PEI Foundation abstracts the creation of a Hand-Off Block's (HOB's) headers.\r
+  This service, published by the PEI Foundation, abstracts the creation of a Hand-Off Block's (HOB's) headers.\r
 \r
   @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
   @param  Type             The type of HOB to be installed.\r
@@ -267,90 +303,135 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_CREATE_HOB) (\r
-  IN EFI_PEI_SERVICES            **PeiServices,\r
-  IN UINT16                      Type,\r
-  IN UINT16                      Length,\r
-  IN OUT VOID                    **Hob\r
+(EFIAPI *EFI_PEI_CREATE_HOB)(\r
+  IN CONST EFI_PEI_SERVICES            **PeiServices,\r
+  IN UINT16                            Type,\r
+  IN UINT16                            Length,\r
+  IN OUT VOID                          **Hob\r
   );\r
 \r
 /**\r
   The purpose of the service is to abstract the capability of the PEI \r
   Foundation to discover instances of firmware volumes in the system. \r
-  Given the input file pointer, this service searches for the next \r
-  matching file in the Firmware File System (FFS) volume.\r
+\r
+  This service enables PEIMs to discover additional firmware volumes. The PEI Foundation uses this\r
+  service to abstract the locations and formats of various firmware volumes. These volumes include\r
+  the Boot Firmware Volume and any other volumes exposed by EFI_PEI_FV_PPI. The service\r
+  returns a volume handle of type EFI_PEI_FV_HANDLE, which must be unique within the system.\r
 \r
   @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
-  @param  Instance         This instance of the firmware volume to find. The value 0 is the Boot Firmware Volume (BFV).\r
-  @param  FwVolHeader      Pointer to the firmware volume header of the volume to return.\r
+  @param  Instance         This instance of the firmware volume to find.\r
+                           The value 0 is the Boot Firmware Volume (BFV).\r
+  @param  VolumeHandle     On exit, points to the next volumn handle or NULL if it does not exist.\r
 \r
   @retval EFI_SUCCESS           The volume was found.\r
   @retval EFI_NOT_FOUND         The volume was not found.\r
-  @retval EFI_INVALID_PARAMETER FwVolHeader is NULL\r
+  @retval EFI_INVALID_PARAMETER VolumeHandle is NULL.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_FFS_FIND_NEXT_VOLUME2) (\r
-  IN EFI_PEI_SERVICES                **PeiServices,\r
-  IN UINTN                           Instance,\r
-  IN OUT EFI_FIRMWARE_VOLUME_HEADER  **FwVolHeader\r
+(EFIAPI *EFI_PEI_FFS_FIND_NEXT_VOLUME2)(\r
+  IN CONST EFI_PEI_SERVICES                **PeiServices,\r
+  IN UINTN                                 Instance,\r
+  OUT EFI_PEI_FV_HANDLE                    *VolumeHandle\r
   );\r
 \r
 /**\r
-  The purpose of the service is to abstract the capability of the PEI \r
-  Foundation to discover instances of firmware files in the system. \r
-  Given the input file pointer, this service searches for the next matching \r
-  file in the Firmware File System (FFS) volume.\r
+  Searches for the next matching file in the firmware volume.\r
+\r
+  This service enables PEIMs to discover firmware files within a specified volume.\r
+  To find the first instance of a firmware file, pass a FileHandle value of NULL into the service.\r
+  The service returns a file handle of type EFI_PEI_FILE_HANDLE, which must be unique within\r
+  the system.\r
 \r
   @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
   @param  SearchType       A filter to find files only of this type.\r
-  @param  FwVolHeader      Pointer to the firmware volume header of the volume to search.This parameter \r
-                           must point to a valid FFS volume.\r
-  @param  FileHeader       Pointer to the current file from which to begin searching.This pointer will be \r
-                           updated upon return to reflect the file found.\r
+  @param  FvHandle         Handle of firmware volume in which to search.\r
+  @param  FileHandle       On entry, points to the current handle from which to begin searching\r
+                           or NULL to start at the beginning of the firmware volume.\r
+                           On exit, points the file handle of the next file in the volume or NULL\r
+                           if there are no more files.\r
 \r
-  @retval EFI_SUCCESS           The file was found.\r
-  @retval EFI_NOT_FOUND         The file was not found.\r
-  @retval EFI_NOT_FOUND         The header checksum was not zero.\r
+  @retval EFI_SUCCESS      The file was found.\r
+  @retval EFI_NOT_FOUND    The file was not found.\r
+  @retval EFI_NOT_FOUND    The header checksum was not zero.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE2) (\r
-  IN EFI_PEI_SERVICES            **PeiServices,\r
-  IN EFI_FV_FILETYPE             SearchType,\r
-  IN EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader,\r
-  IN OUT EFI_FFS_FILE_HEADER     **FileHeader\r
+(EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE2)(\r
+  IN CONST EFI_PEI_SERVICES                **PeiServices,\r
+  IN EFI_FV_FILETYPE                       SearchType,\r
+  IN CONST EFI_PEI_FV_HANDLE               FvHandle,\r
+  IN OUT EFI_PEI_FILE_HANDLE               *FileHandle\r
   );\r
 \r
 /**\r
-  Given the input file pointer, this service searches for the next \r
-  matching file in the Firmware File System (FFS) volume. \r
+  Searches for the next matching section within the specified file.\r
+\r
+  This service enables PEI modules to discover the first section of a given type within a valid file.\r
+  This service will search within encapsulation sections (compression and GUIDed) as well. It will\r
+  search inside of a GUIDed section or a compressed section, but may not, for example, search a\r
+  GUIDed section inside a GUIDes section.\r
+  This service will not search within compression sections or GUIDed sections that require\r
+  extraction if memory is not present.\r
 \r
   @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
   @param  SectionType      The value of the section type to find.\r
-  @param  FfsFileHeader    A pointer to the file header that contains the set of sections to be searched.\r
+  @param  FileHandle       Handle of the firmware file to search.\r
   @param  SectionData      A pointer to the discovered section, if successful.\r
 \r
-  @retval EFI_SUCCESS           The section was found.\r
-  @retval EFI_NOT_FOUND         The section was not found.\r
+  @retval EFI_SUCCESS      The section was found.\r
+  @retval EFI_NOT_FOUND    The section was not found.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA2) (\r
-  IN EFI_PEI_SERVICES            **PeiServices,\r
-  IN EFI_SECTION_TYPE            SectionType,\r
-  IN EFI_FFS_FILE_HEADER         *FfsFileHeader,\r
-  IN OUT VOID                    **SectionData\r
+(EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA2)(\r
+  IN CONST EFI_PEI_SERVICES            **PeiServices,\r
+  IN EFI_SECTION_TYPE                  SectionType,\r
+  IN EFI_PEI_FILE_HANDLE               FileHandle,\r
+  OUT VOID                             **SectionData\r
+  );\r
+\r
+/**\r
+  Searches for the next matching section within the specified file.\r
+\r
+  This service enables PEI modules to discover the section of a given type within a valid file.\r
+  This service will search within encapsulation sections (compression and GUIDed) as well. It will\r
+  search inside of a GUIDed section or a compressed section, but may not, for example, search a\r
+  GUIDed section inside a GUIDes section.\r
+  This service will not search within compression sections or GUIDed sections that require\r
+  extraction if memory is not present.\r
+\r
+  @param  PeiServices           An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+  @param  SectionType           The value of the section type to find.\r
+  @param  SectionInstance       Section instance to find.\r
+  @param  FileHandle            Handle of the firmware file to search.\r
+  @param  SectionData           A pointer to the discovered section, if successful.\r
+  @param  AuthenticationStatus  A pointer to the authentication status for this section.\r
+\r
+  @retval EFI_SUCCESS      The section was found.\r
+  @retval EFI_NOT_FOUND    The section was not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA3)(\r
+  IN CONST EFI_PEI_SERVICES            **PeiServices,\r
+  IN EFI_SECTION_TYPE                  SectionType,\r
+  IN UINTN                             SectionInstance,\r
+  IN EFI_PEI_FILE_HANDLE               FileHandle,\r
+  OUT VOID                             **SectionData,\r
+  OUT UINT32                           *AuthenticationStatus\r
   );\r
 \r
 /**\r
   This function registers the found memory configuration with the PEI Foundation.\r
 \r
   @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
-  @param  MemoryBegin      The value of a region of installed memory\r
+  @param  MemoryBegin      The value of a region of installed memory.\r
   @param  MemoryLength     The corresponding length of a region of installed memory.\r
 \r
   @retval EFI_SUCCESS           The region was successfully installed in a HOB.\r
@@ -360,8 +441,8 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_INSTALL_PEI_MEMORY) (\r
-  IN EFI_PEI_SERVICES           **PeiServices,\r
+(EFIAPI *EFI_PEI_INSTALL_PEI_MEMORY)(\r
+  IN CONST EFI_PEI_SERVICES     **PeiServices,\r
   IN EFI_PHYSICAL_ADDRESS       MemoryBegin,\r
   IN UINT64                     MemoryLength\r
   );\r
@@ -373,21 +454,23 @@ EFI_STATUS
   @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
   @param  MemoryType       The type of memory to allocate.\r
   @param  Pages            The number of contiguous 4 KB pages to allocate.\r
-  @param  Memory           Pointer to a physical address. On output, the address is set to the base \r
+  @param  Memory           A pointer to a physical address. On output, the address is set to the base \r
                            of the page range that was allocated.\r
 \r
   @retval EFI_SUCCESS           The memory range was successfully allocated.\r
   @retval EFI_OUT_OF_RESOURCES  The pages could not be allocated.\r
-  @retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.\r
+  @retval EFI_INVALID_PARAMETER The type is not equal to EfiLoaderCode, EfiLoaderData, EfiRuntimeServicesCode, \r
+                                EfiRuntimeServicesData, EfiBootServicesCode, EfiBootServicesData,\r
+                                EfiACPIReclaimMemory, or EfiACPIMemoryNVS.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_ALLOCATE_PAGES) (\r
-  IN EFI_PEI_SERVICES           **PeiServices,\r
+(EFIAPI *EFI_PEI_ALLOCATE_PAGES)(\r
+  IN CONST EFI_PEI_SERVICES     **PeiServices,\r
   IN EFI_MEMORY_TYPE            MemoryType,\r
   IN UINTN                      Pages,\r
-  IN OUT EFI_PHYSICAL_ADDRESS   *Memory\r
+  OUT EFI_PHYSICAL_ADDRESS      *Memory\r
   );\r
 \r
 /**\r
@@ -404,8 +487,8 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_ALLOCATE_POOL) (\r
-  IN EFI_PEI_SERVICES           **PeiServices,\r
+(EFIAPI *EFI_PEI_ALLOCATE_POOL)(\r
+  IN CONST EFI_PEI_SERVICES     **PeiServices,\r
   IN UINTN                      Size,\r
   OUT VOID                      **Buffer\r
   );\r
@@ -413,16 +496,14 @@ EFI_STATUS
 /**\r
   This service copies the contents of one buffer to another buffer.\r
 \r
-  @param  Destination      Pointer to the destination buffer of the memory copy.\r
-  @param  Source           Pointer to the source buffer of the memory copy\r
-  @param  Length           Number of bytes to copy from Source to Destination.\r
-\r
-  @return None\r
+  @param  Destination      The pointer to the destination buffer of the memory copy.\r
+  @param  Source           The pointer to the source buffer of the memory copy.\r
+  @param  Length           The number of bytes to copy from Source to Destination.\r
 \r
 **/\r
 typedef\r
 VOID\r
-(EFIAPI *EFI_PEI_COPY_MEM) (\r
+(EFIAPI *EFI_PEI_COPY_MEM)(\r
   IN VOID                       *Destination,\r
   IN VOID                       *Source,\r
   IN UINTN                      Length\r
@@ -431,16 +512,14 @@ VOID
 /**\r
   The service fills a buffer with a specified value.\r
 \r
-  @param  Buffer           Pointer to the buffer to fill.\r
-  @param  Size             Number of bytes in Buffer to fill.\r
-  @param  Value            Value to fill Buffer with\r
-\r
-  @return None\r
+  @param  Buffer           The pointer to the buffer to fill.\r
+  @param  Size             The number of bytes in Buffer to fill.\r
+  @param  Value            The value to fill Buffer with.\r
 \r
 **/\r
 typedef\r
 VOID\r
-(EFIAPI *EFI_PEI_SET_MEM) (\r
+(EFIAPI *EFI_PEI_SET_MEM)(\r
   IN VOID                       *Buffer,\r
   IN UINTN                      Size,\r
   IN UINT8                      Value\r
@@ -449,6 +528,11 @@ VOID
 /**\r
   This service publishes an interface that allows PEIMs to report status codes.\r
 \r
+  ReportStatusCode() is called by PEIMs that wish to report status information on their\r
+  progress. The principal use model is for a PEIM to emit one of the standard 32-bit error codes. This\r
+  will allow a platform owner to ascertain the state of the system, especially under conditions where\r
+  the full consoles might not have been installed.\r
+\r
   @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
   @param  Type             Indicates the type of status code being reported.\r
   @param  Value            Describes the current status of a hardware or\r
@@ -472,334 +556,461 @@ VOID
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_REPORT_STATUS_CODE) (\r
-  IN EFI_PEI_SERVICES         **PeiServices,\r
-  IN EFI_STATUS_CODE_TYPE     Type,\r
-  IN EFI_STATUS_CODE_VALUE    Value,\r
-  IN UINT32                   Instance,\r
-  IN EFI_GUID                 *CallerId OPTIONAL,\r
-  IN EFI_STATUS_CODE_DATA     *Data OPTIONAL\r
+(EFIAPI *EFI_PEI_REPORT_STATUS_CODE)(\r
+  IN CONST EFI_PEI_SERVICES         **PeiServices,\r
+  IN EFI_STATUS_CODE_TYPE           Type,\r
+  IN EFI_STATUS_CODE_VALUE          Value,\r
+  IN UINT32                         Instance,\r
+  IN CONST EFI_GUID                 *CallerId OPTIONAL,\r
+  IN CONST EFI_STATUS_CODE_DATA     *Data OPTIONAL\r
   );\r
 \r
 /**\r
   Resets the entire platform.\r
 \r
+  This service resets the entire platform, including all processors\r
+  and devices, and reboots the system.\r
+  This service will never return EFI_SUCCESS.  \r
+\r
   @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES\r
                            table published by the PEI Foundation.\r
 \r
-  @retval EFI_SUCCESS           The function completed successfully.\r
   @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_RESET_SYSTEM) (\r
-  IN EFI_PEI_SERVICES   **PeiServices\r
+(EFIAPI *EFI_PEI_RESET_SYSTEM)(\r
+  IN CONST EFI_PEI_SERVICES   **PeiServices\r
   );\r
 \r
 /**\r
-   \r
-       This service searches for files with a specific name, within\r
-       either the specified firmware volume or all firmware volumes.\r
-       The service returns a file handle of type EFI_PEI_FILE_HANDLE,\r
-  which must be unique within the system.\r
+  Find a file within a volume by its name.\r
 \r
-  @param FileName                      A pointer to the name of the file to\r
-                                                                                               find within the firmware volume.\r
+  This service searches for files with a specific name, within\r
+  either the specified firmware volume or all firmware volumes.\r
+  The service returns a file handle of type EFI_PEI_FILE_HANDLE,\r
+  which must be unique within the system.\r
 \r
-  @param VolumeHandle  The firmware volume to search FileHandle\r
-                        Upon exit, points to the found file's\r
+  @param FileName       A pointer to the name of the file to\r
+                        find within the firmware volume.\r
+  @param VolumeHandle   The firmware volume to search.\r
+  @param FileHandle     Upon exit, points to the found file's\r
                         handle or NULL if it could not be found.\r
 \r
-  @retval EFI_SUCCESS                                          File was found.\r
-\r
-  @retval EFI_NOT_FOUND                                        File was not found.\r
-\r
-  @retval EFI_INVALID_PARAMETER        VolumeHandle or FileHandle or\r
-                                                                                                                                       FileName was NULL.\r
-\r
+  @retval EFI_SUCCESS             The file was found.\r
+  @retval EFI_NOT_FOUND           The file was not found.\r
+  @retval EFI_INVALID_PARAMETER   VolumeHandle or FileHandle or\r
+                                  FileName was NULL.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_FFS_FIND_BY_NAME) (\r
-       IN CONST        EFI_GUID                                                *FileName,\r
-       IN CONST        EFI_PEI_FV_HANDLE       VolumeHandle,\r
-       OUT                     EFI_PEI_FILE_HANDLE *FileHandle\r
-);\r
-\r
-\r
-/**\r
-   \r
-  @param FileName      Name of the file.\r
-\r
-  @param FileType      File type. See EFI_FV_FILETYPE, which is\r
-                    defined in the Platform Initialization\r
-                    Firmware Storage Specification.\r
-\r
-  @param FileAttributes        Attributes of the file. Type\r
-                          EFI_FV_FILE_ATTRIBUTES is defined in\r
-                          the Platform Initialization Firmware\r
-                          Storage Specification.\r
-\r
-  @param Buffer        Points to the file's data (not the header).\r
-                  Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED\r
-                  is zero.\r
-\r
-  @param BufferSize    Size of the file's data.\r
+(EFIAPI *EFI_PEI_FFS_FIND_BY_NAME)(\r
+  IN  CONST  EFI_GUID            *FileName,\r
+  IN  EFI_PEI_FV_HANDLE          VolumeHandle,\r
+  OUT EFI_PEI_FILE_HANDLE        *FileHandle\r
+  );\r
 \r
-**/\r
+///\r
+/// The information of the FV file.\r
+///\r
 typedef struct {\r
-       EFI_GUID                                                                FileName;\r
-       EFI_FV_FILETYPE                                 FileType;\r
-       EFI_FV_FILE_ATTRIBUTES  FileAttributes;\r
-       VOID                                                                            *Buffer;\r
-       UINT32                                                                  BufferSize;\r
+  ///\r
+  /// Name of the file.\r
+  ///\r
+  EFI_GUID                FileName;\r
+  ///\r
+  /// File type.\r
+  ///\r
+  EFI_FV_FILETYPE         FileType;\r
+  ///\r
+  /// Attributes of the file.\r
+  ///\r
+  EFI_FV_FILE_ATTRIBUTES  FileAttributes;\r
+  ///\r
+  /// Points to the file's data (not the header).\r
+  /// Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED\r
+  /// is zero.\r
+  ///\r
+  VOID                    *Buffer;\r
+  ///\r
+  /// Size of the file's data.\r
+  ///\r
+  UINT32                  BufferSize;\r
 } EFI_FV_FILE_INFO;\r
 \r
+///\r
+/// The information with authentication status of the FV file.\r
+///\r
+typedef struct {\r
+  ///\r
+  /// Name of the file.\r
+  ///\r
+  EFI_GUID                FileName;\r
+  ///\r
+  /// File type.\r
+  ///\r
+  EFI_FV_FILETYPE         FileType;\r
+  ///\r
+  /// Attributes of the file.\r
+  ///\r
+  EFI_FV_FILE_ATTRIBUTES  FileAttributes;\r
+  ///\r
+  /// Points to the file's data (not the header).\r
+  /// Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED\r
+  /// is zero.\r
+  ///\r
+  VOID                    *Buffer;\r
+  ///\r
+  /// Size of the file's data.\r
+  ///\r
+  UINT32                  BufferSize;\r
+  ///\r
+  /// Authentication status for this file.\r
+  ///\r
+  UINT32                  AuthenticationStatus;\r
+} EFI_FV_FILE_INFO2;\r
+\r
 /**\r
-   \r
-       This function returns information about a specific file,\r
-       including its file name, type, attributes, starting address and\r
-       size. If the firmware volume is not memory mapped then the\r
-  Buffer member will be NULL.\r
+  Returns information about a specific file.\r
 \r
-  @param FileHandle   Handle of the file.\r
+  This function returns information about a specific file,\r
+  including its file name, type, attributes, starting address and\r
+  size. If the firmware volume is not memory mapped, then the\r
+  Buffer member will be NULL.\r
 \r
-  @param FileInfo     Upon exit, points to the file¡¯s\r
+  @param FileHandle   The handle of the file.\r
+  @param FileInfo     Upon exit, points to the file's\r
                       information.\r
 \r
-  @retval EFI_SUCCESS                                          File information returned.\r
-  \r
-  @retval EFI_INVALID_PARAMETER        If FileHandle does not\r
+  @retval EFI_SUCCESS             File information was returned.\r
+  @retval EFI_INVALID_PARAMETER   FileHandle does not\r
                                   represent a valid file.\r
-  \r
-  @retval EFI_INVALID_PARAMETER        If FileInfo is NULL.\r
+  @retval EFI_INVALID_PARAMETER   FileInfo is NULL.\r
   \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_FFS_GET_FILE_INFO) (\r
-       IN CONST        EFI_PEI_FILE_HANDLE     FileHandle,\r
-       OUT                     EFI_FV_FILE_INFO                        *FileInfo\r
-);\r
-\r
+(EFIAPI *EFI_PEI_FFS_GET_FILE_INFO)(\r
+  IN  EFI_PEI_FILE_HANDLE         FileHandle,\r
+  OUT EFI_FV_FILE_INFO            *FileInfo\r
+  );\r
 \r
 /**\r
-   \r
-  @param FvAttributes  Attributes of the firmware volume. Type\r
-                        EFI_FVB_ATTRIBUTES is defined in the\r
-                        Platform Initialization Firmware Storage\r
-                        Specficiation.\r
-\r
-  @param FvFormat                      Format of the firmware volume. For PI\r
-                        Architecture Firmware Volumes, this can\r
-                        be copied from FileSystemGuid in\r
-                        EFI_FIRMWARE_VOLUME_HEADER.\r
-\r
-  @param FvName                                Name of the firmware volume. For PI\r
-                        Architecture Firmware Volumes, this can\r
-                        be copied from VolumeName in the\r
-                        extended header of\r
-                        EFI_FIRMWARE_VOLUME_HEADER.\r
-\r
-  @param FvStart                               Points to the first byte of the firmware\r
-                        volume, if bit EFI_FVB_MEMORY_MAPPED is\r
-                        set in FvAttributes. FvSize Size of the\r
-                        firmware volume.\r
+  Returns information about a specific file.\r
+\r
+  This function returns information about a specific file,\r
+  including its file name, type, attributes, starting address, size and authentication status.\r
+  If the firmware volume is not memory mapped, then the Buffer member will be NULL.\r
+\r
+  @param FileHandle   The handle of the file.\r
+  @param FileInfo     Upon exit, points to the file's\r
+                      information.\r
+\r
+  @retval EFI_SUCCESS             File information was returned.\r
+  @retval EFI_INVALID_PARAMETER   FileHandle does not\r
+                                  represent a valid file.\r
+  @retval EFI_INVALID_PARAMETER   FileInfo is NULL.\r
 \r
 **/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_FFS_GET_FILE_INFO2)(\r
+  IN  EFI_PEI_FILE_HANDLE         FileHandle,\r
+  OUT EFI_FV_FILE_INFO2           *FileInfo\r
+  );\r
+\r
+///\r
+/// The information of the FV volume.\r
+///\r
 typedef struct {\r
-       EFI_FVB_ATTRIBUTES      FvAttributes;\r
-       EFI_GUID                                                FvFormat;\r
-       EFI_GUID                                                FvName;\r
-       VOID                                                            *FvStart;\r
-       UINT64                                                  FvSize;\r
+  ///\r
+  /// Attributes of the firmware volume.\r
+  ///\r
+  EFI_FVB_ATTRIBUTES_2  FvAttributes;\r
+  ///\r
+  /// Format of the firmware volume.\r
+  ///\r
+  EFI_GUID              FvFormat;\r
+  ///\r
+  /// Name of the firmware volume.\r
+  ///\r
+  EFI_GUID              FvName;\r
+  ///\r
+  /// Points to the first byte of the firmware\r
+  /// volume, if bit EFI_FVB_MEMORY_MAPPED is\r
+  /// set in FvAttributes.\r
+  ///\r
+  VOID                  *FvStart;\r
+  ///\r
+  /// Size of the firmware volume.\r
+  ///\r
+  UINT64                FvSize;\r
 } EFI_FV_INFO;\r
 \r
 /**\r
-   \r
-       This function returns information about a specific firmware\r
-       volume, including its name, type, attributes, starting address\r
+  Returns information about the specified volume.\r
+\r
+  This function returns information about a specific firmware\r
+  volume, including its name, type, attributes, starting address\r
   and size.\r
 \r
   @param VolumeHandle   Handle of the volume.\r
+  @param VolumeInfo     Upon exit, points to the volume's information.\r
 \r
-  @param VolumeInfo     Upon exit, points to the volume¡¯s\r
-                        information.\r
-\r
-       @retval EFI_SUCCESS                                             File information returned.\r
-  \r
-  @retval EFI_INVALID_PARAMETER        If FileHandle does not\r
-                                  represent a valid file.\r
-  \r
-  @retval EFI_INVALID_PARAMETER        If FileInfo is NULL.\r
+  @retval EFI_SUCCESS             The volume information returned.\r
+  @retval EFI_INVALID_PARAMETER   If VolumeHandle does not represent a valid volume.\r
+  @retval EFI_INVALID_PARAMETER   If VolumeHandle is NULL.\r
+  @retval EFI_SUCCESS             Information was successfully returned.\r
+  @retval EFI_INVALID_PARAMETER   The volume designated by the VolumeHandle is not available.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_FFS_GET_VOLUME_INFO) (\r
-       IN CONST        EFI_PEI_FV_HANDLE       *VolumeHandle,\r
-       OUT                     EFI_FV_INFO                     *VolumeInfo\r
-);\r
+(EFIAPI *EFI_PEI_FFS_GET_VOLUME_INFO)(\r
+  IN  EFI_PEI_FV_HANDLE       VolumeHandle,\r
+  OUT EFI_FV_INFO             *VolumeInfo\r
+  );\r
 \r
 /**\r
-   \r
-       This service registers a file handle so that after memory is\r
-       available, the PEIM will be re-loaded into permanent memory and\r
-       re-initialized. The PEIM registered this way will always be\r
-       initialized twice. The first time, this function call will\r
-       return EFI_SUCCESS. The second time, this function call will\r
-       return EFI_ALREADY_STARTED. Depending on the order in which\r
-       PEIMs are dispatched, the PEIM making this call may be\r
-       initialized after permanent memory is installed, even the first\r
+  Register a PEIM so that it will be shadowed and called again.\r
+\r
+  This service registers a file handle so that after memory is\r
+  available, the PEIM will be re-loaded into permanent memory and\r
+  re-initialized. The PEIM registered this way will always be\r
+  initialized twice. The first time, this function call will\r
+  return EFI_SUCCESS. The second time, this function call will\r
+  return EFI_ALREADY_STARTED. Depending on the order in which\r
+  PEIMs are dispatched, the PEIM making this call may be\r
+  initialized after permanent memory is installed, even the first\r
   time.\r
 \r
-  @param FileHandle    PEIM¡¯s file handle. Must be the currently\r
-                      xecuting PEIM.\r
+  @param  FileHandle            PEIM's file handle. Must be the currently\r
+                                executing PEIM.\r
   \r
-  @retval EFI_SUCCESS  The PEIM was successfully registered for\r
-                        shadowing.\r
-\r
-  @retval EFI_ALREADY_STARTED  The PEIM was previously\r
+  @retval EFI_SUCCESS           The PEIM was successfully registered for\r
+                                shadowing.\r
+  @retval EFI_ALREADY_STARTED   The PEIM was previously\r
                                 registered for shadowing.\r
-\r
-  @retval EFI_NOT_FOUND        The FileHandle does not refer to a\r
-                                                                                                       valid file handle.\r
+  @retval EFI_NOT_FOUND         The FileHandle does not refer to a\r
+                                valid file handle.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_PEI_REGISTER_FOR_SHADOW) (\r
-       IN CONST        EFI_PEI_FILE_HANDLE FileHandle\r
-);\r
+(EFIAPI *EFI_PEI_REGISTER_FOR_SHADOW)(\r
+  IN  EFI_PEI_FILE_HANDLE FileHandle\r
+  );\r
 \r
 \r
 //\r
 // PEI Specification Revision information\r
 //\r
 #define PEI_SPECIFICATION_MAJOR_REVISION  1\r
-#define PEI_SPECIFICATION_MINOR_REVISION  0\r
-\r
+#define PEI_SPECIFICATION_MINOR_REVISION  20\r
+///\r
+/// Specification inconsistency here: \r
+/// In the PI1.0 spec, PEI_SERVICES_SIGNATURE is defined as 0x5652455320494550. But \r
+/// to pass a multiple tool chain, it appends an ULL.\r
+///\r
 //\r
 // PEI Services Table\r
 //\r
-#define PEI_SERVICES_SIGNATURE         0x5652455320494550\r
-#define PEI_SERVICES_REVISION  (PEI_SPECIFICATION_MAJOR_REVISION<<16) | (PEI_SPECIFICATION_MINOR_REVISION)\r
-\r
-struct EFI_PEI_SERVICES {\r
-       EFI_TABLE_HEADER                                                Hdr;\r
-       //\r
-       // PPI Functions\r
-       //\r
-       EFI_PEI_INSTALL_PPI                             InstallPpi;\r
-       EFI_PEI_REINSTALL_PPI                   ReInstallPpi;\r
-       EFI_PEI_LOCATE_PPI                                      LocatePpi;\r
-       EFI_PEI_NOTIFY_PPI                                      NotifyPpi;\r
-       //\r
-       // Boot Mode Functions\r
-       //\r
-       EFI_PEI_GET_BOOT_MODE                   GetBootMode;\r
-       EFI_PEI_SET_BOOT_MODE                   SetBootMode;\r
-       //\r
-       // HOB Functions\r
-       //\r
-       EFI_PEI_GET_HOB_LIST                            GetHobList;\r
-       EFI_PEI_CREATE_HOB                                      CreateHob;\r
-       //\r
-       // Firmware Volume Functions\r
-       //\r
-       EFI_PEI_FFS_FIND_NEXT_VOLUME2   FfsFindNextVolume;\r
-       EFI_PEI_FFS_FIND_NEXT_FILE2             FfsFindNextFile;\r
-       EFI_PEI_FFS_FIND_SECTION_DATA2  FfsFindSectionData;\r
-       //\r
-       // PEI Memory Functions\r
-       //\r
-       EFI_PEI_INSTALL_PEI_MEMORY      InstallPeiMemory;\r
-       EFI_PEI_ALLOCATE_PAGES                  AllocatePages;\r
-       EFI_PEI_ALLOCATE_POOL                   AllocatePool;\r
-       EFI_PEI_COPY_MEM                                                CopyMem;\r
-       EFI_PEI_SET_MEM                                                 SetMem;\r
-       //\r
-       // Status Code\r
-       EFI_PEI_REPORT_STATUS_CODE      ReportStatusCode;\r
-       //\r
-       // Reset\r
-       //\r
-       EFI_PEI_RESET_SYSTEM                            ResetSystem;\r
-       //\r
-       // (the following interfaces are installed by publishing PEIM)\r
-       //\r
-       // I/O Abstractions\r
-       //\r
-       EFI_PEI_CPU_IO_PPI                                      *CpuIo;\r
-       EFI_PEI_PCI_CFG2_PPI                            *PciCfg;\r
-       //\r
-       // Future Installed Services\r
-       EFI_PEI_FFS_FIND_BY_NAME                FfsFindFileByName;\r
-       EFI_PEI_FFS_GET_FILE_INFO       FfsGetFileInfo;\r
-       EFI_PEI_FFS_GET_VOLUME_INFO FfsGetVolumeInfo;\r
-       EFI_PEI_REGISTER_FOR_SHADOW RegisterForShadow;\r
-} ;\r
+#define PEI_SERVICES_SIGNATURE  0x5652455320494550ULL\r
+///\r
+/// Specification inconsistency here: \r
+/// In the PI1.0 specification, there is a typo error in PEI_SERVICES_REVISION. In the specification the defintion is \r
+/// #define ((PEI_SPECIFICATION_MAJOR_REVISION<<16) |(PEI_SPECIFICATION_MINOR_REVISION))\r
+/// and it should be as follows:\r
+///\r
+#define PEI_SERVICES_REVISION   ((PEI_SPECIFICATION_MAJOR_REVISION<<16) | (PEI_SPECIFICATION_MINOR_REVISION))\r
+\r
+/// \r
+/// EFI_PEI_SERVICES is a collection of functions whose implementation is provided by the PEI\r
+/// Foundation. These services fall into various classes, including the following:\r
+/// - Managing the boot mode\r
+/// - Allocating both early and permanent memory\r
+/// - Supporting the Firmware File System (FFS)\r
+/// - Abstracting the PPI database abstraction\r
+/// - Creating Hand-Off Blocks (HOBs).\r
+///\r
+struct _EFI_PEI_SERVICES {\r
+  ///\r
+  /// The table header for the PEI Services Table.\r
+  ///\r
+  EFI_TABLE_HEADER                Hdr;\r
 \r
+  //\r
+  // PPI Functions\r
+  //\r
+  EFI_PEI_INSTALL_PPI             InstallPpi;\r
+  EFI_PEI_REINSTALL_PPI           ReInstallPpi;\r
+  EFI_PEI_LOCATE_PPI              LocatePpi;\r
+  EFI_PEI_NOTIFY_PPI              NotifyPpi;\r
 \r
-typedef struct _EFI_SEC_PEI_HAND_OFF {\r
   //\r
-  // Size of the data structure.\r
-  // \r
-  UINT16  DataSize;\r
+  // Boot Mode Functions\r
+  //\r
+  EFI_PEI_GET_BOOT_MODE           GetBootMode;\r
+  EFI_PEI_SET_BOOT_MODE           SetBootMode;\r
 \r
   //\r
-  // Points to the first byte of the boot firmware volume, \r
-  // which the PEI Dispatcher should search for \r
-  // PEI modules.\r
-  // \r
-  VOID    *BootFirmwareVolumeBase;\r
+  // HOB Functions\r
+  //\r
+  EFI_PEI_GET_HOB_LIST            GetHobList;\r
+  EFI_PEI_CREATE_HOB              CreateHob;\r
 \r
   //\r
-  // Size of the boot firmware volume, in bytes.\r
-  // \r
-  UINTN   BootFirmwareVolumeSize;\r
+  // Firmware Volume Functions\r
+  //\r
+  EFI_PEI_FFS_FIND_NEXT_VOLUME2   FfsFindNextVolume;\r
+  EFI_PEI_FFS_FIND_NEXT_FILE2     FfsFindNextFile;\r
+  EFI_PEI_FFS_FIND_SECTION_DATA2  FfsFindSectionData;\r
 \r
   //\r
-  // Points to the first byte of the temporary RAM.\r
-  // \r
-  VOID    *TemporaryRamBase;\r
+  // PEI Memory Functions\r
+  //\r
+  EFI_PEI_INSTALL_PEI_MEMORY      InstallPeiMemory;\r
+  EFI_PEI_ALLOCATE_PAGES          AllocatePages;\r
+  EFI_PEI_ALLOCATE_POOL           AllocatePool;\r
+  EFI_PEI_COPY_MEM                CopyMem;\r
+  EFI_PEI_SET_MEM                 SetMem;\r
 \r
   //\r
-  // Size of the temporary RAM, in bytes.\r
-  // \r
-  UINTN   TemporaryRamSize;\r
+  // Status Code\r
+  //\r
+  EFI_PEI_REPORT_STATUS_CODE      ReportStatusCode;\r
 \r
   //\r
-  // Points to the first byte of the temporary RAM \r
-  // available for use by the PEI Foundation. The area \r
-  // described by PeiTemporaryRamBase and PeiTemporaryRamSize \r
-  // must not extend outside beyond the area described by\r
-  // TemporaryRamBase & TemporaryRamSize. This area should not\r
-  // overlap with the area reported by StackBase and \r
-  // StackSize.\r
+  // Reset\r
   //\r
-  VOID    *PeiTemporaryRamBase;\r
+  EFI_PEI_RESET_SYSTEM            ResetSystem;\r
 \r
   //\r
-  // Size of the available temporary RAM available for \r
-  // use by the PEI Foundation, in bytes.\r
-  // \r
-  UINTN   PeiTemporaryRamSize;\r
+  // (the following interfaces are installed by publishing PEIM)\r
+  // I/O Abstractions\r
+  //\r
+  EFI_PEI_CPU_IO_PPI              *CpuIo;\r
+  EFI_PEI_PCI_CFG2_PPI            *PciCfg;\r
 \r
   //\r
-  // Points to the first byte of the stack. \r
-  // This are may be part of the memory described by \r
-  // TemporaryRamBase and TemporaryRamSize \r
-  // or may be an entirely separate area.\r
-  // \r
+  // Future Installed Services\r
+  //\r
+  EFI_PEI_FFS_FIND_BY_NAME        FfsFindFileByName;\r
+  EFI_PEI_FFS_GET_FILE_INFO       FfsGetFileInfo;\r
+  EFI_PEI_FFS_GET_VOLUME_INFO     FfsGetVolumeInfo;\r
+  EFI_PEI_REGISTER_FOR_SHADOW     RegisterForShadow;\r
+  EFI_PEI_FFS_FIND_SECTION_DATA3  FindSectionData3;\r
+  EFI_PEI_FFS_GET_FILE_INFO2      FfsGetFileInfo2;\r
+};\r
+\r
+\r
+///\r
+/// EFI_SEC_PEI_HAND_OFF structure holds information about\r
+/// PEI core's operating environment, such as the size of location of\r
+/// temporary RAM, the stack location and BFV location.\r
+/// \r
+typedef struct _EFI_SEC_PEI_HAND_OFF {\r
+  ///\r
+  /// Size of the data structure.\r
+  /// \r
+  UINT16  DataSize;\r
+\r
+  ///\r
+  /// Points to the first byte of the boot firmware volume, \r
+  /// which the PEI Dispatcher should search for \r
+  /// PEI modules.\r
+  /// \r
+  VOID    *BootFirmwareVolumeBase;\r
+\r
+  ///\r
+  /// Size of the boot firmware volume, in bytes.\r
+  /// \r
+  UINTN   BootFirmwareVolumeSize;\r
+\r
+  ///\r
+  /// Points to the first byte of the temporary RAM.\r
+  /// \r
+  VOID    *TemporaryRamBase;\r
+\r
+  ///\r
+  /// Size of the temporary RAM, in bytes.\r
+  /// \r
+  UINTN   TemporaryRamSize;\r
+\r
+  ///\r
+  /// Points to the first byte of the temporary RAM \r
+  /// available for use by the PEI Foundation. The area \r
+  /// described by PeiTemporaryRamBase and PeiTemporaryRamSize \r
+  /// must not extend outside beyond the area described by\r
+  /// TemporaryRamBase & TemporaryRamSize. This area should not\r
+  /// overlap with the area reported by StackBase and \r
+  /// StackSize.\r
+  ///\r
+  VOID    *PeiTemporaryRamBase;\r
+\r
+  ///\r
+  /// The size of the available temporary RAM available for \r
+  /// use by the PEI Foundation, in bytes.\r
+  /// \r
+  UINTN   PeiTemporaryRamSize;\r
+\r
+  ///\r
+  /// Points to the first byte of the stack. \r
+  /// This are may be part of the memory described by \r
+  /// TemporaryRamBase and TemporaryRamSize \r
+  /// or may be an entirely separate area.\r
+  /// \r
   VOID    *StackBase;\r
 \r
-  //\r
-  // Size of the stack, in bytes.\r
-  // \r
+  ///\r
+  /// Size of the stack, in bytes.\r
+  /// \r
   UINTN   StackSize;\r
 } EFI_SEC_PEI_HAND_OFF;\r
 \r
+\r
+/**\r
+  The entry point of PEI Foundation.\r
+\r
+  This function is the entry point for the PEI Foundation, which\r
+  allows the SEC phase to pass information about the stack,\r
+  temporary RAM and the Boot Firmware Volume. In addition, it also\r
+  allows the SEC phase to pass services and data forward for use\r
+  during the PEI phase in the form of one or more PPIs. There is\r
+  no limit to the number of additional PPIs that can be passed\r
+  from SEC into the PEI Foundation. As part of its initialization\r
+  phase, the PEI Foundation will add these SEC-hosted PPIs to its\r
+  PPI database such that both the PEI Foundation and any modules\r
+  can leverage the associated service calls and/or code in these\r
+  early PPIs.\r
+\r
+  @param SecCoreData    Points to a data structure containing\r
+                        information about the PEI core's\r
+                        operating environment, such as the size\r
+                        and location of temporary RAM, the stack\r
+                        location and the BFV location.\r
+\r
+  @param PpiList        Points to a list of one or more PPI\r
+                        descriptors to be installed initially by\r
+                        the PEI core. An empty PPI list consists\r
+                        of a single descriptor with the end-tag\r
+                        EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.\r
+                        As part of its initialization phase, the\r
+                        PEI Foundation will add these SEC-hosted\r
+                        PPIs to its PPI database such that both\r
+                        the PEI Foundation and any modules can\r
+                        leverage the associated service calls\r
+                        and/or code in these early PPIs.\r
+\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_PEI_CORE_ENTRY_POINT)(\r
+  IN CONST  EFI_SEC_PEI_HAND_OFF    *SecCoreData,\r
+  IN CONST  EFI_PEI_PPI_DESCRIPTOR  *PpiList\r
+);\r
+\r
 #endif\r