MdeModulePkg: Update PCD driver to support the optimized PcdDataBase
https://bugzilla.tianocore.org/show_bug.cgi?id=546 BaseTools will generate the optimized PCD database to save the image size at build time for multiple SKUs. The optimized PCD database layout will be like below, the PCD database will be composed of the full default SKU data (PCD_DATABASE_INIT) and the non-default SKU delta data(PCD_DATABASE_SKU_DELTA). PCD driver will build HOB to store the full default SKU data, and patch HOB data based on non-default SKU delta data for the SKU set by SetSku(), it can save memory resource at boot time. // // PCD database layout: // +---------------------------------+ // | PCD_DATABASE_INIT (DEFAULT SKU) | // +---------------------------------+ // | PCD_DATABASE_SKU_DELTA (SKU A) | // +---------------------------------+ // | PCD_DATABASE_SKU_DELTA (SKU B) | // +---------------------------------+ // | ...... | // +---------------------------------+ // BaseTools, PCD database and driver updates are needed for this proposal. For single SKU (default) case, this proposal is expected to have no impact. For multi-SKU case, PCD database format will be changed. So, PcdDataBase Version is also updated from 6 to 7. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
@@ -39,7 +39,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
// Please make sure the PCD Serivce DXE Version is consistent with
|
||||
// the version of the generated DXE PCD Database by build tool.
|
||||
//
|
||||
#define PCD_SERVICE_DXE_VERSION 6
|
||||
#define PCD_SERVICE_DXE_VERSION 7
|
||||
|
||||
//
|
||||
// PCD_DXE_SERVICE_DRIVER_VERSION is defined in Autogen.h.
|
||||
@@ -961,24 +961,6 @@ ExGetWorker (
|
||||
IN UINTN GetSize
|
||||
);
|
||||
|
||||
/**
|
||||
Find the local token number according to system SKU ID.
|
||||
|
||||
@param LocalTokenNumber PCD token number
|
||||
@param Size The size of PCD entry.
|
||||
@param IsPeiDb If TRUE, the PCD entry is initialized in PEI phase.
|
||||
If False, the PCD entry is initialized in DXE phase.
|
||||
|
||||
@return Token number according to system SKU ID.
|
||||
|
||||
**/
|
||||
UINT32
|
||||
GetSkuEnabledTokenNumber (
|
||||
UINT32 LocalTokenNumber,
|
||||
UINTN Size,
|
||||
BOOLEAN IsPeiDb
|
||||
);
|
||||
|
||||
/**
|
||||
Get Variable which contains HII type PCD entry.
|
||||
|
||||
@@ -1177,6 +1159,21 @@ VariableLockCallBack (
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
/**
|
||||
Update PCD database base on current SkuId
|
||||
|
||||
@param SkuId Current SkuId
|
||||
@param IsPeiDb Whether to update PEI PCD database.
|
||||
|
||||
@retval EFI_SUCCESS Update PCD database successfully.
|
||||
@retval EFI_NOT_FOUND Not found PCD database for current SkuId.
|
||||
**/
|
||||
EFI_STATUS
|
||||
UpdatePcdDatabase (
|
||||
IN SKU_ID SkuId,
|
||||
IN BOOLEAN IsPeiDb
|
||||
);
|
||||
|
||||
extern PCD_DATABASE mPcdDatabase;
|
||||
|
||||
extern UINT32 mPcdTotalTokenCount;
|
||||
|
Reference in New Issue
Block a user