diff options
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r-- | MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 14 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/FwVol/FwVol.c | 2 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/PeiMain.h | 14 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/PeiMain.inf | 4 |
4 files changed, 18 insertions, 16 deletions
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index 7294d85c6c..6923181475 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -55,15 +55,15 @@ Returns: {
EFI_STATUS Status;
EFI_PEI_FV_HANDLE FileHandle;
- EFI_PEI_FV_HANDLE AprioriFileHandle;
+ EFI_PEI_FILE_HANDLE AprioriFileHandle;
EFI_GUID *Apriori;
UINTN Index;
UINTN Index2;
UINTN PeimIndex;
UINTN PeimCount;
EFI_GUID *Guid;
- EFI_PEI_FV_HANDLE TempFileHandles[PEI_CORE_MAX_PEIM_PER_FV];
- EFI_GUID FileGuid[PEI_CORE_MAX_PEIM_PER_FV];
+ EFI_PEI_FV_HANDLE TempFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];
+ EFI_GUID FileGuid[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];
//
// Walk the FV and find all the PEIMs and the Apriori file.
@@ -84,7 +84,7 @@ Returns: //
// Go ahead to scan this Fv, and cache FileHandles within it.
//
- for (PeimCount = 0; PeimCount < PEI_CORE_MAX_PEIM_PER_FV; PeimCount++) {
+ for (PeimCount = 0; PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {
Status = PeiFindFileEx (
VolumeHandle,
NULL,
@@ -104,7 +104,7 @@ Returns: //
// Read the Apriori file
//
- Status = PeiServicesFfsFindSectionData (EFI_SECTION_RAW, &AprioriFileHandle, (VOID **) &Apriori);
+ Status = PeiServicesFfsFindSectionData (EFI_SECTION_RAW, AprioriFileHandle, (VOID **) &Apriori);
if (!EFI_ERROR (Status)) {
//
// Calculate the number of PEIMs in the A Priori list
@@ -249,7 +249,7 @@ Returns: SaveCurrentFileHandle = Private->CurrentFileHandle;
for (Index1 = 0; Index1 <= SaveCurrentFvCount; Index1++) {
- for (Index2 = 0; (Index2 < PEI_CORE_MAX_PEIM_PER_FV) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) {
+ for (Index2 = 0; (Index2 < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) {
if (Private->Fv[Index1].PeimState[Index2] == PEIM_STATE_REGISITER_FOR_SHADOW) {
PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2];
Status = PeiLoadImage (
@@ -318,7 +318,7 @@ Returns: // Start to dispatch all modules within the current Fv.
//
for (PeimCount = Private->CurrentPeimCount;
- (PeimCount < PEI_CORE_MAX_PEIM_PER_FV) && (Private->CurrentFvFileHandles[PeimCount] != NULL);
+ (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL);
PeimCount++) {
Private->CurrentPeimCount = PeimCount;
PeimFileHandle = Private->CurrentFileHandle = Private->CurrentFvFileHandles[PeimCount];
diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index cd1de1b41b..181cfa0b5c 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -366,7 +366,7 @@ Returns: PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
- if (PrivateData->FvCount >= PEI_CORE_MAX_FV_SUPPORTED) {
+ if (PrivateData->FvCount >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {
ASSERT (FALSE);
}
diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h index 0f87305881..8c133d2b1a 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.h +++ b/MdeModulePkg/Core/Pei/PeiMain.h @@ -49,6 +49,7 @@ Revision History #include <Library/BaseMemoryLib.h>
#include <Library/CacheMaintenanceLib.h>
#include <Library/TimerLib.h>
+#include <Library/PcdLib.h>
#include <IndustryStandard/PeImage.h>
#include <Library/PeiServicesTablePointerLib.h>
#include <Library/MemoryAllocationLib.h>
@@ -80,9 +81,6 @@ typedef struct { } PEI_PPI_DATABASE;
-#define PEI_CORE_MAX_FV_SUPPORTED 6
-#define PEI_CORE_MAX_PEIM_PER_FV 32
-
//
// PEI_CORE_FV_HANDE.PeimState
// Do not change these values as there is code doing math to change states.
@@ -95,8 +93,8 @@ typedef struct { typedef struct {
EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
- UINT8 PeimState[PEI_CORE_MAX_PEIM_PER_FV];
- EFI_PEI_FILE_HANDLE FvFileHandles[PEI_CORE_MAX_PEIM_PER_FV];
+ UINT8 PeimState[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];
+ EFI_PEI_FILE_HANDLE FvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];
BOOLEAN ScanFv;
} PEI_CORE_FV_HANDLE;
@@ -111,14 +109,14 @@ typedef struct{ EFI_PEI_SERVICES *PS; // Point to ServiceTableShadow
PEI_PPI_DATABASE PpiData;
UINTN FvCount;
- PEI_CORE_FV_HANDLE Fv[PEI_CORE_MAX_FV_SUPPORTED];
- EFI_PEI_FILE_HANDLE CurrentFvFileHandles[PEI_CORE_MAX_PEIM_PER_FV];
+ PEI_CORE_FV_HANDLE Fv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];
+ EFI_PEI_FILE_HANDLE CurrentFvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];
UINTN AprioriCount;
UINTN CurrentPeimFvCount;
UINTN CurrentPeimCount;
EFI_PEI_FILE_HANDLE CurrentFileHandle;
UINTN AllFvCount;
- EFI_PEI_FV_HANDLE AllFv[PEI_CORE_MAX_FV_SUPPORTED];
+ EFI_PEI_FV_HANDLE AllFv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];
EFI_PEI_HOB_POINTERS HobList;
BOOLEAN SwitchStackSignal;
BOOLEAN PeiMemoryInstalled;
diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf index 647e709417..a954cadeda 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.inf +++ b/MdeModulePkg/Core/Pei/PeiMain.inf @@ -97,6 +97,10 @@ gEfiPeiLoadFilePpiGuid
gEfiPeiSecurity2PpiGuid
+[FixedPcd.common]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv
+
[BuildOptions.common]
MSFT:DEBUG_*_IA32_CC_FLAGS = /FAcs
|