]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/PeiMain.h
1. Enable use-cases in PEI using SecurityPPI co-equal to the use-cases in DXE using...
[mirror_edk2.git] / MdeModulePkg / Core / Pei / PeiMain.h
index 48f3bc302edacae3fcdd01a92fc414d8631a4513..6a9feb03c23c1192ff68f4ead3e8987fde2eecc0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Definition of Pei Core Structures and Services\r
   \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -22,6 +22,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Ppi/Reset.h>\r
 #include <Ppi/FirmwareVolume.h>\r
 #include <Ppi/FirmwareVolumeInfo.h>\r
+#include <Ppi/FirmwareVolumeInfo2.h>\r
 #include <Ppi/Decompress.h>\r
 #include <Ppi/GuidedSectionExtraction.h>\r
 #include <Ppi/LoadFile.h>\r
@@ -43,6 +44,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/PeiServicesTablePointerLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Guid/FirmwareFileSystem2.h>\r
+#include <Guid/FirmwareFileSystem3.h>\r
 #include <Guid/AprioriFileName.h>\r
 \r
 ///\r
@@ -109,12 +111,14 @@ typedef struct {
   UINT8                               PeimState[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r
   EFI_PEI_FILE_HANDLE                 FvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r
   BOOLEAN                             ScanFv;\r
+  UINT32                              AuthenticationStatus;\r
 } PEI_CORE_FV_HANDLE;\r
 \r
 typedef struct {\r
   EFI_GUID                            FvFormat;\r
   VOID                                *FvInfo;\r
   UINT32                              FvInfoSize;\r
+  UINT32                              AuthenticationStatus;\r
   EFI_PEI_NOTIFY_DESCRIPTOR           NotifyDescriptor;\r
 } PEI_CORE_UNKNOW_FORMAT_FV_INFO;\r
 \r
@@ -123,6 +127,7 @@ typedef struct {
   EFI_COMMON_SECTION_HEADER*          Section[CACHE_SETION_MAX_NUMBER];\r
   VOID*                               SectionData[CACHE_SETION_MAX_NUMBER];\r
   UINTN                               SectionSize[CACHE_SETION_MAX_NUMBER];\r
+  UINT32                              AuthenticationStatus[CACHE_SETION_MAX_NUMBER];\r
   UINTN                               AllSectionCount;\r
   UINTN                               SectionIndex;\r
 } CACHE_SECTION_DATA;\r
@@ -200,6 +205,8 @@ struct _PEI_CORE_INSTANCE {
   EFI_PHYSICAL_ADDRESS               FreePhysicalMemoryTop;\r
   UINTN                              HeapOffset;\r
   BOOLEAN                            HeapOffsetPositive;\r
+  UINTN                              StackOffset;\r
+  BOOLEAN                            StackOffsetPositive;\r
   PEICORE_FUNCTION_POINTER           ShadowedPeiCore;\r
   CACHE_SECTION_DATA                 CacheSection;\r
   //\r
@@ -377,24 +384,15 @@ InitializePpiServices (
 \r
   Migrate the Hob list from the temporary memory stack to PEI installed memory.\r
 \r
-  @param PrivateData         Pointer to PeiCore's private data structure.\r
-  @param OldCheckingBottom   Bottom of temporary memory range. All Ppi in this range\r
-                             will be fixup for PpiData and PpiDescriptor pointer.\r
-  @param OldCheckingTop      Top of temporary memory range. All Ppi in this range\r
-                             will be fixup for PpiData and PpiDescriptor.\r
-  @param Fixup               The address difference between\r
-                             the new Hob list and old Hob list.\r
-  @param FixupPositive       TRUE if new Hob list is above the old Hob list.  \r
-                             Otherwise FALSE.\r
+  @param SecCoreData     Points to a data structure containing SEC to PEI handoff data, such as the size \r
+                         and location of temporary RAM, the stack location and the BFV location.\r
+  @param PrivateData     Pointer to PeiCore's private data structure.\r
 \r
 **/\r
 VOID\r
 ConvertPpiPointers (\r
-  IN PEI_CORE_INSTANCE       *PrivateData,\r
-  IN UINTN                   OldCheckingBottom,\r
-  IN UINTN                   OldCheckingTop,\r
-  IN UINTN                   Fixup,\r
-  IN BOOLEAN                 FixupPositive\r
+  IN CONST EFI_SEC_PEI_HAND_OFF  *SecCoreData,\r
+  IN PEI_CORE_INSTANCE           *PrivateData\r
   );\r
 \r
 /**\r
@@ -589,23 +587,23 @@ VerifyFv (
   );\r
 \r
 /**\r
-\r
   Provide a callout to the security verification service.\r
 \r
-\r
   @param PrivateData     PeiCore's private data structure\r
   @param VolumeHandle    Handle of FV\r
   @param FileHandle      Handle of PEIM's ffs\r
+  @param AuthenticationStatus Authentication status\r
 \r
   @retval EFI_SUCCESS              Image is OK\r
   @retval EFI_SECURITY_VIOLATION   Image is illegal\r
-\r
+  @retval EFI_NOT_FOUND            If security PPI is not installed.\r
 **/\r
 EFI_STATUS\r
 VerifyPeim (\r
   IN PEI_CORE_INSTANCE      *PrivateData,\r
   IN EFI_PEI_FV_HANDLE      VolumeHandle,\r
-  IN EFI_PEI_FILE_HANDLE    FileHandle\r
+  IN EFI_PEI_FILE_HANDLE    FileHandle,\r
+  IN UINT32                 AuthenticationStatus\r
   );\r
 \r
 /**\r
@@ -720,6 +718,31 @@ PeiFfsFindSectionData (
   OUT VOID                     **SectionData\r
   );\r
 \r
+/**\r
+  Searches for the next matching section within the specified file.\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
+EFI_STATUS\r
+EFIAPI\r
+PeiFfsFindSectionData3 (\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
   Search the firmware volumes by index\r
 \r
@@ -973,6 +996,24 @@ PeiFfsGetFileInfo (
   OUT EFI_FV_FILE_INFO    *FileInfo\r
   );\r
 \r
+/**\r
+  Returns information about a specific file.\r
+\r
+  @param FileHandle       Handle of the file.\r
+  @param FileInfo         Upon exit, points to the file's information.\r
+\r
+  @retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r
+  @retval EFI_INVALID_PARAMETER If FileHandle does not represent a valid file.\r
+  @retval EFI_SUCCESS           File information returned.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI \r
+PeiFfsGetFileInfo2 (\r
+  IN EFI_PEI_FILE_HANDLE  FileHandle,\r
+  OUT EFI_FV_FILE_INFO2   *FileInfo\r
+  );\r
+\r
 /**\r
   Returns information about the specified volume.\r
 \r
@@ -1067,19 +1108,22 @@ SecurityPpiNotifyCallback (
   );\r
 \r
 /**\r
-  Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.\r
+  Get Fv image from the FV type file, then install FV INFO(2) ppi, Build FV hob.\r
 \r
+  @param PrivateData          PeiCore's private data structure\r
   @param ParentFvCoreHandle   Pointer of EFI_CORE_FV_HANDLE to parent Fv image that contain this Fv image.\r
   @param ParentFvFileHandle   File handle of a Fv type file that contain this Fv image.\r
 \r
   @retval EFI_NOT_FOUND         FV image can't be found.\r
   @retval EFI_SUCCESS           Successfully to process it.\r
   @retval EFI_OUT_OF_RESOURCES  Can not allocate page when aligning FV image\r
+  @retval EFI_SECURITY_VIOLATION Image is illegal\r
   @retval Others                Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section\r
   \r
 **/\r
 EFI_STATUS\r
 ProcessFvFile (\r
+  IN  PEI_CORE_INSTANCE           *PrivateData,\r
   IN  PEI_CORE_FV_HANDLE          *ParentFvCoreHandle,\r
   IN  EFI_PEI_FILE_HANDLE         ParentFvFileHandle\r
   );\r