{\r
EFI_STATUS Status;\r
EFI_PEI_FV_HANDLE FileHandle;\r
- EFI_PEI_FV_HANDLE AprioriFileHandle;\r
+ EFI_PEI_FILE_HANDLE AprioriFileHandle;\r
EFI_GUID *Apriori;\r
UINTN Index;\r
UINTN Index2;\r
UINTN PeimIndex;\r
UINTN PeimCount;\r
EFI_GUID *Guid;\r
- EFI_PEI_FV_HANDLE TempFileHandles[PEI_CORE_MAX_PEIM_PER_FV];\r
- EFI_GUID FileGuid[PEI_CORE_MAX_PEIM_PER_FV];\r
+ EFI_PEI_FV_HANDLE TempFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r
+ EFI_GUID FileGuid[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r
\r
//\r
// Walk the FV and find all the PEIMs and the Apriori file.\r
//\r
// Go ahead to scan this Fv, and cache FileHandles within it.\r
//\r
- for (PeimCount = 0; PeimCount < PEI_CORE_MAX_PEIM_PER_FV; PeimCount++) {\r
+ for (PeimCount = 0; PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {\r
Status = PeiFindFileEx (\r
VolumeHandle, \r
NULL, \r
//\r
// Read the Apriori file\r
//\r
- Status = PeiServicesFfsFindSectionData (EFI_SECTION_RAW, &AprioriFileHandle, (VOID **) &Apriori);\r
+ Status = PeiServicesFfsFindSectionData (EFI_SECTION_RAW, AprioriFileHandle, (VOID **) &Apriori);\r
if (!EFI_ERROR (Status)) {\r
//\r
// Calculate the number of PEIMs in the A Priori list\r
SaveCurrentFileHandle = Private->CurrentFileHandle;\r
\r
for (Index1 = 0; Index1 <= SaveCurrentFvCount; Index1++) {\r
- for (Index2 = 0; (Index2 < PEI_CORE_MAX_PEIM_PER_FV) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) {\r
+ for (Index2 = 0; (Index2 < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) {\r
if (Private->Fv[Index1].PeimState[Index2] == PEIM_STATE_REGISITER_FOR_SHADOW) {\r
PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2]; \r
Status = PeiLoadImage (\r
// Start to dispatch all modules within the current Fv.\r
//\r
for (PeimCount = Private->CurrentPeimCount; \r
- (PeimCount < PEI_CORE_MAX_PEIM_PER_FV) && (Private->CurrentFvFileHandles[PeimCount] != NULL); \r
+ (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL); \r
PeimCount++) {\r
Private->CurrentPeimCount = PeimCount;\r
PeimFileHandle = Private->CurrentFileHandle = Private->CurrentFvFileHandles[PeimCount];\r
\r
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);\r
\r
- if (PrivateData->FvCount >= PEI_CORE_MAX_FV_SUPPORTED) {\r
+ if (PrivateData->FvCount >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
ASSERT (FALSE);\r
}\r
\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/CacheMaintenanceLib.h>\r
#include <Library/TimerLib.h>\r
+#include <Library/PcdLib.h>\r
#include <IndustryStandard/PeImage.h>\r
#include <Library/PeiServicesTablePointerLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
} PEI_PPI_DATABASE;\r
\r
\r
-#define PEI_CORE_MAX_FV_SUPPORTED 6\r
-#define PEI_CORE_MAX_PEIM_PER_FV 32\r
-\r
//\r
// PEI_CORE_FV_HANDE.PeimState\r
// Do not change these values as there is code doing math to change states.\r
\r
typedef struct {\r
EFI_FIRMWARE_VOLUME_HEADER *FvHeader;\r
- UINT8 PeimState[PEI_CORE_MAX_PEIM_PER_FV]; \r
- EFI_PEI_FILE_HANDLE FvFileHandles[PEI_CORE_MAX_PEIM_PER_FV];\r
+ UINT8 PeimState[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)]; \r
+ EFI_PEI_FILE_HANDLE FvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r
BOOLEAN ScanFv;\r
} PEI_CORE_FV_HANDLE;\r
\r
EFI_PEI_SERVICES *PS; // Point to ServiceTableShadow\r
PEI_PPI_DATABASE PpiData;\r
UINTN FvCount;\r
- PEI_CORE_FV_HANDLE Fv[PEI_CORE_MAX_FV_SUPPORTED];\r
- EFI_PEI_FILE_HANDLE CurrentFvFileHandles[PEI_CORE_MAX_PEIM_PER_FV];\r
+ PEI_CORE_FV_HANDLE Fv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r
+ EFI_PEI_FILE_HANDLE CurrentFvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r
UINTN AprioriCount;\r
UINTN CurrentPeimFvCount; \r
UINTN CurrentPeimCount;\r
EFI_PEI_FILE_HANDLE CurrentFileHandle;\r
UINTN AllFvCount;\r
- EFI_PEI_FV_HANDLE AllFv[PEI_CORE_MAX_FV_SUPPORTED];\r
+ EFI_PEI_FV_HANDLE AllFv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r
EFI_PEI_HOB_POINTERS HobList;\r
BOOLEAN SwitchStackSignal;\r
BOOLEAN PeiMemoryInstalled;\r
gEfiPeiLoadFilePpiGuid\r
gEfiPeiSecurity2PpiGuid\r
\r
+[FixedPcd.common]\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv\r
+\r
[BuildOptions.common]\r
MSFT:DEBUG_*_IA32_CC_FLAGS = /FAcs\r
\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule|0x0|UINT32|0x0001001e\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule|0x0|UINT32|0x0001001f\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|28|UINT8|0x0001002f\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported|6|UINT32|0x00010030\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv|32|UINT32|0x00010031\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x0|UINT32|0x30000001\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0x0|UINT32|0x30000002\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0x0|UINT32|0x30000013\r
gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueMouseInputError|0x01020007|UINT32|0x30001000b\r
gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueMouseReset|0x01020001|UINT32|0x30001000c\r
\r
+\r
[PcdsDynamic.common]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x0|UINT32|0x30000001\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0x0|UINT32|0x30000002\r
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|0\r
gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10\r
\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported|6\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv|32\r
+\r
+\r
[PcdsFixedAtBuild.IPF]\r
gEfiMdePkgTokenSpaceGuid.PcdIoBlockBaseAddressForIpf|0x0ffffc000000\r
\r