MdeModulePkg PeiCore: Remove the using of PcdPeiCoreMaxPpiSupported

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1405

Background as below.

Problem:
As static configuration from the PCDs, the binary PeiCore (for example
in FSP binary with dispatch mode) could not predict how many FVs,
Files or PPIs for different platforms.

Burden:
Platform developers need configure the PCDs accordingly for different
platforms.

To solve the problem and remove the burden, we can update code to
remove the using of PcdPeiCoreMaxFvSupported, PcdPeiCoreMaxPeimPerFv
and PcdPeiCoreMaxPpiSupported by extending buffer dynamically for FV,
File and PPI management.

This patch removes the using of PcdPeiCoreMaxPpiSupported in PeiCore.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
This commit is contained in:
Star Zeng
2018-11-20 10:32:07 +08:00
parent 111e6c920d
commit f2bc359ced
5 changed files with 259 additions and 204 deletions

View File

@@ -66,37 +66,60 @@ typedef union {
} PEI_PPI_LIST_POINTERS;
///
/// PPI database structure which contains two link: PpiList and NotifyList. PpiList
/// is in head of PpiListPtrs array and notify is in end of PpiListPtrs.
/// Number of PEI_PPI_LIST_POINTERS to grow by each time we run out of room
///
#define PPI_GROWTH_STEP 64
#define CALLBACK_NOTIFY_GROWTH_STEP 32
#define DISPATCH_NOTIFY_GROWTH_STEP 8
typedef struct {
UINTN CurrentCount;
UINTN MaxCount;
UINTN LastDispatchedCount;
///
/// MaxCount number of entries.
///
PEI_PPI_LIST_POINTERS *PpiPtrs;
} PEI_PPI_LIST;
typedef struct {
UINTN CurrentCount;
UINTN MaxCount;
///
/// MaxCount number of entries.
///
PEI_PPI_LIST_POINTERS *NotifyPtrs;
} PEI_CALLBACK_NOTIFY_LIST;
typedef struct {
UINTN CurrentCount;
UINTN MaxCount;
UINTN LastDispatchedCount;
///
/// MaxCount number of entries.
///
PEI_PPI_LIST_POINTERS *NotifyPtrs;
} PEI_DISPATCH_NOTIFY_LIST;
///
/// PPI database structure which contains three links:
/// PpiList, CallbackNotifyList and DispatchNotifyList.
///
typedef struct {
///
/// index of end of PpiList link list.
/// PPI List.
///
INTN PpiListEnd;
PEI_PPI_LIST PpiList;
///
/// index of end of notify link list.
/// Notify List at dispatch level.
///
INTN NotifyListEnd;
PEI_CALLBACK_NOTIFY_LIST CallbackNotifyList;
///
/// index of the dispatched notify list.
/// Notify List at callback level.
///
INTN DispatchListEnd;
///
/// index of last installed Ppi description in PpiList link list.
///
INTN LastDispatchedInstall;
///
/// index of last dispatched notify in Notify link list.
///
INTN LastDispatchedNotify;
///
/// Ppi database has the PcdPeiCoreMaxPpiSupported number of entries.
///
PEI_PPI_LIST_POINTERS *PpiListPtrs;
PEI_DISPATCH_NOTIFY_LIST DispatchNotifyList;
} PEI_PPI_DATABASE;
//
// PEI_CORE_FV_HANDE.PeimState
// Do not change these values as there is code doing math to change states.
@@ -555,13 +578,13 @@ PeiNotifyPpi (
**/
VOID
ProcessNotifyList (
ProcessDispatchNotifyList (
IN PEI_CORE_INSTANCE *PrivateData
);
/**
Dispatch notifications.
Process notifications.
@param PrivateData PeiCore's private data structure
@param NotifyType Type of notify to fire.
@@ -572,7 +595,7 @@ ProcessNotifyList (
**/
VOID
DispatchNotify (
ProcessNotify (
IN PEI_CORE_INSTANCE *PrivateData,
IN UINTN NotifyType,
IN INTN InstallStartIndex,