X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FPei%2FPeiMain.h;h=8c7cfe4cacdf842b310cff24a2850fc7537764a9;hp=193704de19a219b5f8bc4f01c9ae91b41aa1f747;hb=fe7819402c285c2d006b79eb66981673fedf3d04;hpb=890e54170e8f85d1357ac3614f7ad1465050ff0c diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h index 193704de19..8c7cfe4cac 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.h +++ b/MdeModulePkg/Core/Pei/PeiMain.h @@ -1,7 +1,7 @@ /** @file Definition of Pei Core Structures and Services -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -22,11 +22,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -87,9 +89,9 @@ typedef struct { /// INTN LastDispatchedNotify; /// - /// Ppi database. + /// Ppi database has the PcdPeiCoreMaxPpiSupported number of entries. /// - PEI_PPI_LIST_POINTERS PpiListPtrs[FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)]; + PEI_PPI_LIST_POINTERS *PpiListPtrs; } PEI_PPI_DATABASE; @@ -107,15 +109,23 @@ typedef struct { EFI_FIRMWARE_VOLUME_HEADER *FvHeader; EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi; EFI_PEI_FV_HANDLE FvHandle; - UINT8 PeimState[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)]; - EFI_PEI_FILE_HANDLE FvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)]; + // + // Ponter to the buffer with the PcdPeiCoreMaxPeimPerFv number of Entries. + // + UINT8 *PeimState; + // + // Ponter to the buffer with the PcdPeiCoreMaxPeimPerFv number of Entries. + // + EFI_PEI_FILE_HANDLE *FvFileHandles; BOOLEAN ScanFv; + UINT32 AuthenticationStatus; } PEI_CORE_FV_HANDLE; typedef struct { EFI_GUID FvFormat; VOID *FvInfo; UINT32 FvInfoSize; + UINT32 AuthenticationStatus; EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor; } PEI_CORE_UNKNOW_FORMAT_FV_INFO; @@ -124,10 +134,19 @@ typedef struct { EFI_COMMON_SECTION_HEADER* Section[CACHE_SETION_MAX_NUMBER]; VOID* SectionData[CACHE_SETION_MAX_NUMBER]; UINTN SectionSize[CACHE_SETION_MAX_NUMBER]; + UINT32 AuthenticationStatus[CACHE_SETION_MAX_NUMBER]; UINTN AllSectionCount; UINTN SectionIndex; } CACHE_SECTION_DATA; +#define HOLE_MAX_NUMBER 0x3 +typedef struct { + EFI_PHYSICAL_ADDRESS Base; + UINTN Size; + UINTN Offset; + BOOLEAN OffsetPositive; +} HOLE_MEMORY_DATA; + /// /// Forward declaration for PEI_CORE_INSTANCE /// @@ -175,13 +194,22 @@ struct _PEI_CORE_INSTANCE { UINTN FvCount; /// - /// The instance arrary for FVs which contains FFS and could be dispatched by PeiCore. + /// Pointer to the buffer with the PcdPeiCoreMaxFvSupported number of entries. + /// Each entry is for one FV which contains FFS and could be dispatched by PeiCore. /// - PEI_CORE_FV_HANDLE Fv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)]; - PEI_CORE_UNKNOW_FORMAT_FV_INFO UnknownFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)]; + PEI_CORE_FV_HANDLE *Fv; + + /// + /// Pointer to the buffer with the PcdPeiCoreMaxFvSupported number of entries. + /// Each entry is for one FV which could not be dispatched by PeiCore. + /// + PEI_CORE_UNKNOW_FORMAT_FV_INFO *UnknownFvInfo; UINTN UnknownFvInfoCount; - EFI_PEI_FILE_HANDLE CurrentFvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)]; + /// + /// Pointer to the buffer with the PcdPeiCoreMaxPeimPerFv number of entries. + /// + EFI_PEI_FILE_HANDLE *CurrentFvFileHandles; UINTN AprioriCount; UINTN CurrentPeimFvCount; UINTN CurrentPeimCount; @@ -221,6 +249,21 @@ struct _PEI_CORE_INSTANCE { // This field points to the shadowed image read function // PE_COFF_LOADER_READ_FILE ShadowedImageRead; + + // + // Pointer to the temp buffer with the PcdPeiCoreMaxPeimPerFv + 1 number of entries. + // + EFI_PEI_FILE_HANDLE *FileHandles; + // + // Pointer to the temp buffer with the PcdPeiCoreMaxPeimPerFv number of entries. + // + EFI_GUID *FileGuid; + + // + // Temp Memory Range is not covered by PeiTempMem and Stack. + // Those Memory Range will be migrated into phisical memory. + // + HOLE_MEMORY_DATA HoleData[HOLE_MAX_NUMBER]; }; /// @@ -583,23 +626,23 @@ VerifyFv ( ); /** - Provide a callout to the security verification service. - @param PrivateData PeiCore's private data structure @param VolumeHandle Handle of FV @param FileHandle Handle of PEIM's ffs + @param AuthenticationStatus Authentication status @retval EFI_SUCCESS Image is OK @retval EFI_SECURITY_VIOLATION Image is illegal - + @retval EFI_NOT_FOUND If security PPI is not installed. **/ EFI_STATUS VerifyPeim ( IN PEI_CORE_INSTANCE *PrivateData, IN EFI_PEI_FV_HANDLE VolumeHandle, - IN EFI_PEI_FILE_HANDLE FileHandle + IN EFI_PEI_FILE_HANDLE FileHandle, + IN UINT32 AuthenticationStatus ); /** @@ -714,6 +757,31 @@ PeiFfsFindSectionData ( OUT VOID **SectionData ); +/** + Searches for the next matching section within the specified file. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param SectionType The value of the section type to find. + @param SectionInstance Section instance to find. + @param FileHandle Handle of the firmware file to search. + @param SectionData A pointer to the discovered section, if successful. + @param AuthenticationStatus A pointer to the authentication status for this section. + + @retval EFI_SUCCESS The section was found. + @retval EFI_NOT_FOUND The section was not found. + +**/ +EFI_STATUS +EFIAPI +PeiFfsFindSectionData3 ( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_SECTION_TYPE SectionType, + IN UINTN SectionInstance, + IN EFI_PEI_FILE_HANDLE FileHandle, + OUT VOID **SectionData, + OUT UINT32 *AuthenticationStatus + ); + /** Search the firmware volumes by index @@ -967,6 +1035,24 @@ PeiFfsGetFileInfo ( OUT EFI_FV_FILE_INFO *FileInfo ); +/** + Returns information about a specific file. + + @param FileHandle Handle of the file. + @param FileInfo Upon exit, points to the file's information. + + @retval EFI_INVALID_PARAMETER If FileInfo is NULL. + @retval EFI_INVALID_PARAMETER If FileHandle does not represent a valid file. + @retval EFI_SUCCESS File information returned. + +**/ +EFI_STATUS +EFIAPI +PeiFfsGetFileInfo2 ( + IN EFI_PEI_FILE_HANDLE FileHandle, + OUT EFI_FV_FILE_INFO2 *FileInfo + ); + /** Returns information about the specified volume. @@ -1061,19 +1147,22 @@ SecurityPpiNotifyCallback ( ); /** - Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob. + Get Fv image from the FV type file, then install FV INFO(2) ppi, Build FV hob. + @param PrivateData PeiCore's private data structure @param ParentFvCoreHandle Pointer of EFI_CORE_FV_HANDLE to parent Fv image that contain this Fv image. @param ParentFvFileHandle File handle of a Fv type file that contain this Fv image. @retval EFI_NOT_FOUND FV image can't be found. @retval EFI_SUCCESS Successfully to process it. @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image + @retval EFI_SECURITY_VIOLATION Image is illegal @retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section **/ EFI_STATUS ProcessFvFile ( + IN PEI_CORE_INSTANCE *PrivateData, IN PEI_CORE_FV_HANDLE *ParentFvCoreHandle, IN EFI_PEI_FILE_HANDLE ParentFvFileHandle );