\r
Private->CurrentFvFileHandles[PeimCount] = FileHandle;\r
}\r
+ \r
+ //\r
+ // Check whether the count of Peims exceeds the max support PEIMs in a FV image\r
+ // If more Peims are required in a FV image, PcdPeiCoreMaxPeimPerFv can be set to a larger value in DSC file.\r
+ //\r
+ ASSERT (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv));\r
\r
Private->AprioriCount = 0;\r
if (AprioriFileHandle != NULL) {\r
//\r
// For Fv type file, Produce new FV PPI and FV hob\r
//\r
- Status = ProcessFvFile (PeiServices, PeimFileHandle, &AuthenticationState);\r
+ Status = ProcessFvFile (PeiServices, VolumeHandle, PeimFileHandle, &AuthenticationState);\r
} else {\r
//\r
// For PEIM driver, Load its entry point\r
EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader;\r
EFI_FFS_FILE_HEADER **FileHeader;\r
EFI_FFS_FILE_HEADER *FfsFileHeader;\r
- EFI_FIRMWARE_VOLUME_EXT_HEADER *FwVolExHeaderInfo;\r
UINT32 FileLength;\r
UINT32 FileOccupiedSize;\r
UINT32 FileOffset;\r
//\r
if ((*FileHeader == NULL) || (FileName != NULL)) {\r
FfsFileHeader = (EFI_FFS_FILE_HEADER *)((UINT8 *)FwVolHeader + FwVolHeader->HeaderLength);\r
- if (FwVolHeader->ExtHeaderOffset != 0) {\r
- FwVolExHeaderInfo = (EFI_FIRMWARE_VOLUME_EXT_HEADER *)(((UINT8 *)FwVolHeader) + FwVolHeader->ExtHeaderOffset);\r
- FfsFileHeader = (EFI_FFS_FILE_HEADER *)(((UINT8 *)FwVolExHeaderInfo) + FwVolExHeaderInfo->ExtHeaderSize);\r
- }\r
} else {\r
//\r
// Length is 24 bits wide so mask upper 8 bits\r
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);\r
\r
if (PrivateData->FvCount >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
+ DEBUG ((EFI_D_ERROR, "The number of Fv Images (%d) exceed the max supported FVs (%d) in Pei", PrivateData->FvCount + 1, FixedPcdGet32 (PcdPeiCoreMaxFvSupported)));\r
+ DEBUG ((EFI_D_ERROR, "PcdPeiCoreMaxFvSupported value need be reconfigurated in DSC"));\r
ASSERT (FALSE);\r
}\r
\r
Fv = (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI *)Ppi;\r
\r
+ //\r
+ // Only add FileSystem2 Fv to Fv list\r
+ //\r
if (CompareGuid (&Fv->FvFormat, &gEfiFirmwareFileSystem2Guid)) {\r
for (FvCount = 0; FvCount < PrivateData->FvCount; FvCount ++) {\r
if ((UINTN)PrivateData->Fv[FvCount].FvHeader == (UINTN)Fv->FvInfo) {\r
\r
PrivateData->Fv[PrivateData->FvCount++].FvHeader = (EFI_FIRMWARE_VOLUME_HEADER*)Fv->FvInfo;\r
\r
- //\r
- // Only add FileSystem2 Fv to the All list\r
- //\r
PrivateData->AllFv[PrivateData->AllFvCount++] = (EFI_PEI_FV_HANDLE)Fv->FvInfo;\r
\r
DEBUG ((EFI_D_INFO, "The %dth FvImage start address is 0x%11p and size is 0x%08x\n", (UINT32)PrivateData->AllFvCount, (VOID *) Fv->FvInfo, Fv->FvInfoSize));\r
//\r
// Process FvFile to install FvInfo ppi and build FvHob\r
// \r
- ProcessFvFile ((CONST EFI_PEI_SERVICES **) PeiServices, FileHandle, &AuthenticationStatus);\r
+ ProcessFvFile ((CONST EFI_PEI_SERVICES **) PeiServices, (EFI_PEI_FV_HANDLE)Fv->FvInfo, FileHandle, &AuthenticationStatus);\r
}\r
} while (FileHandle != NULL);\r
}\r
if (FwVolHeader.Signature != EFI_FVH_SIGNATURE) {\r
return EFI_INVALID_PARAMETER;\r
}\r
+ ZeroMem (VolumeInfo, sizeof (EFI_FV_INFO));\r
VolumeInfo->FvAttributes = FwVolHeader.Attributes;\r
VolumeInfo->FvStart = (VOID *) VolumeHandle;\r
VolumeInfo->FvSize = FwVolHeader.FvLength;\r
Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.\r
\r
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
- @param FvFileHandle File handle of a Fv type file.\r
+ @param ParentFvHandle 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
@param AuthenticationState Pointer to attestation authentication state of image.\r
\r
\r
EFI_STATUS\r
ProcessFvFile (\r
IN CONST EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PEI_FILE_HANDLE FvFileHandle,\r
+ IN EFI_PEI_FV_HANDLE ParentFvHandle,\r
+ IN EFI_PEI_FILE_HANDLE ParentFvFileHandle,\r
OUT UINT32 *AuthenticationState\r
)\r
{\r
EFI_STATUS Status;\r
EFI_PEI_FV_HANDLE FvImageHandle;\r
EFI_FV_INFO FvImageInfo;\r
+ EFI_FV_INFO ParentFvImageInfo;\r
UINT32 FvAlignment;\r
VOID *FvBuffer;\r
EFI_PEI_HOB_POINTERS HobPtr;\r
//\r
HobPtr.Raw = GetHobList ();\r
while ((HobPtr.Raw = GetNextHob (EFI_HOB_TYPE_FV2, HobPtr.Raw)) != NULL) {\r
- if (CompareGuid (&(((EFI_FFS_FILE_HEADER *)FvFileHandle)->Name), &HobPtr.FirmwareVolume2->FileName)) {\r
+ if (CompareGuid (&(((EFI_FFS_FILE_HEADER *)ParentFvFileHandle)->Name), &HobPtr.FirmwareVolume2->FileName)) {\r
//\r
// this FILE has been dispatched, it will not be dispatched again.\r
//\r
Status = PeiFfsFindSectionData (\r
PeiServices,\r
EFI_SECTION_FIRMWARE_VOLUME_IMAGE,\r
- FvFileHandle,\r
+ ParentFvFileHandle,\r
(VOID **)&FvImageHandle\r
);\r
\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
+ //\r
+ // Collect Parent FvImage Info.\r
+ //\r
+ Status = PeiFfsGetVolumeInfo (ParentFvHandle, &ParentFvImageInfo);\r
+ ASSERT_EFI_ERROR (Status); \r
+ \r
//\r
// Collect FvImage Info.\r
//\r
//\r
// Update FvImageInfo after reload FvImage to new aligned memory\r
//\r
- PeiFfsGetVolumeInfo ((EFI_PEI_FV_HANDLE) FvBuffer, &FvImageInfo);\r
+ Status = PeiFfsGetVolumeInfo ((EFI_PEI_FV_HANDLE) FvBuffer, &FvImageInfo);\r
+ ASSERT_EFI_ERROR (Status);\r
}\r
\r
//\r
NULL,\r
FvImageInfo.FvStart,\r
(UINT32) FvImageInfo.FvSize,\r
- &(FvImageInfo.FvName),\r
- &(((EFI_FFS_FILE_HEADER*)FvFileHandle)->Name)\r
+ &ParentFvImageInfo.FvName,\r
+ &(((EFI_FFS_FILE_HEADER*)ParentFvFileHandle)->Name)\r
);\r
\r
//\r
BuildFv2Hob (\r
(EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,\r
FvImageInfo.FvSize,\r
- &FvImageInfo.FvName,\r
- &(((EFI_FFS_FILE_HEADER *)FvFileHandle)->Name)\r
+ &ParentFvImageInfo.FvName,\r
+ &(((EFI_FFS_FILE_HEADER *)ParentFvFileHandle)->Name)\r
);\r
\r
return EFI_SUCCESS;\r
Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.\r
\r
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
- @param FvFileHandle File handle of a Fv type file.\r
+ @param ParentFvHandle Fv handle to parent Fv image that contain this Fv file.\r
+ @param ParentFvFileHandle File handle of a Fv type file that contain this Fv image.\r
@param AuthenticationState Pointer to attestation authentication state of image.\r
If return 0, means pass security checking.\r
\r
EFI_STATUS\r
ProcessFvFile (\r
IN CONST EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PEI_FILE_HANDLE FvFileHandle,\r
+ IN EFI_PEI_FV_HANDLE ParentFvHandle,\r
+ IN EFI_PEI_FILE_HANDLE ParentFvFileHandle,\r
OUT UINT32 *AuthenticationState\r
);\r
\r
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported ## CONSUMES\r
- gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValuePeimDispatch ## CONSUMES\r
+ gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValuePeimDispatch ## CONSUMES\r
gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValuePeiCoreEntry ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize ## CONSUMES\r
\r
//\r
// Since PpiData is used for NotifyList and PpiList, max resource\r
// is reached if the Install reaches the NotifyList\r
+ // PcdPeiCoreMaxPpiSupported can be set to a larger value in DSC to satisfy more PPI requirement.\r
//\r
if (Index == PrivateData->PpiData.NotifyListEnd + 1) {\r
return EFI_OUT_OF_RESOURCES;\r
//\r
// Since PpiData is used for NotifyList and InstallList, max resource\r
// is reached if the Install reaches the PpiList\r
+ // PcdPeiCoreMaxPpiSupported can be set to a larger value in DSC to satisfy more Notify PPIs requirement.\r
//\r
if (Index == PrivateData->PpiData.PpiListEnd - 1) {\r
return EFI_OUT_OF_RESOURCES;\r
\r
[LibraryClasses.common]\r
## @libraryclass IpIo layer upon EFI IP4 Protocol.\r
+ # Ihis library is only intended to be used by UEFI network stack modules.\r
IpIoLib|Include/Library/IpIoLib.h\r
\r
## @libraryclass Basic function for UEFI network stack.\r
+ # Ihis library is only intended to be used by UEFI network stack modules.\r
NetLib|Include/Library/NetLib.h\r
-\r
- ## @libraryclass Defines a set of methods to reset whole system.\r
- ResetSystemLib|Include/Library/ResetSystemLib.h\r
\r
## @libraryclass The helper routines to access UDP service.\r
+ # Ihis library is only intended to be used by UEFI network stack modules.\r
UdpIoLib|Include/Library/UdpIoLib.h\r
\r
+ ## @libraryclass Defines a set of methods to reset whole system.\r
+ ResetSystemLib|Include/Library/ResetSystemLib.h\r
+\r
## @libraryclass Defines a set of methods related do S3 mode.\r
S3Lib|Include/Library/S3Lib.h\r
\r
RecoveryLib|Include/Library/RecoveryLib.h\r
\r
## @libraryclass Basic platform driver override functions.\r
+ # Ihis library is only intended to be used by Platform Driver Override Dxe Driver and Application.\r
PlatformDriverOverrideLib|Include/Library/PlatformDriverOverrideLib.h\r
\r
## @libraryclass Provides HII related functions.\r
gPcdDataBaseHobGuid = { 0xEA296D92, 0x0B69, 0x423C, { 0x8C, 0x28, 0x33, 0xB4, 0xE0, 0xA9, 0x12, 0x68 }}\r
\r
## Guid for EDKII implementation GUIDed opcodes\r
+ # Include/Guid/MdeModuleHii.h\r
gEfiIfrTianoGuid = { 0xf0b1735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 0xaf, 0x48, 0xce }}\r
\r
## Guid for Framework vfr GUIDed opcodes.\r
+ # Include/Guid/MdeModuleHii.h\r
gEfiIfrFrameworkGuid = { 0x31ca5d1a, 0xd511, 0x4931, { 0xb7, 0x82, 0xae, 0x6b, 0x2b, 0x17, 0x8c, 0xd7 }}\r
\r
## Guid to specify the System Non Volatile FV\r
# to store PCD value. \r
#\r
gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0|UINT32|0x00010010\r
- \r
- ## Indicate the max size of the populated capsule image that the platform can support.\r
- # The default max size is 100MB (0x6400000) for more than one large capsule images. \r
- gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule|0x6400000|UINT32|0x0001001e\r
- \r
- ## Indicate the max size of the non-populated capsule image that the platform can support.\r
- # The default max size is 10MB (0xa00000) for the casule image without populated flag setting.\r
- gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule|0xa00000|UINT32|0x0001001f\r
- \r
+ \r
## Maximum number of FV is supported by PeiCore's dispatching.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported|6|UINT32|0x00010030\r
\r
##\r
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes|1|UINT32|0x40000005\r
\r
+ ## Indicate the max size of the populated capsule image that the platform can support.\r
+ # The default max size is 100MB (0x6400000) for more than one large capsule images. \r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule|0x6400000|UINT32|0x0001001e\r
+ \r
+ ## Indicate the max size of the non-populated capsule image that the platform can support.\r
+ # The default max size is 10MB (0xa00000) for the casule image without populated flag setting.\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule|0xa00000|UINT32|0x0001001f\r
+\r
[PcdsFixedAtBuild,PcdsPatchableInModule]\r
## Maximun number of performance log entries during PEI phase.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f\r
[FeaturePcd]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset\r
\r
-[FixedPcd]\r
+[Pcd]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule || PcdSupportUpdateCapsuleReset ## Populate Image requires reset support.\r
\r
// The support max capsule image size\r
//\r
if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) != 0) {\r
- *MaxiumCapsuleSize = FixedPcdGet32(PcdMaxSizePopulateCapsule);\r
+ *MaxiumCapsuleSize = PcdGet32(PcdMaxSizePopulateCapsule);\r
} else {\r
- *MaxiumCapsuleSize = FixedPcdGet32(PcdMaxSizeNonPopulateCapsule);\r
+ *MaxiumCapsuleSize = PcdGet32(PcdMaxSizeNonPopulateCapsule);\r
}\r
\r
return EFI_SUCCESS;\r