From 2b8a6c44e0deb508f79804dd5ff7156bc7e25493 Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Fri, 22 Dec 2017 20:04:04 +0800 Subject: BaseTools: PcdDataBase Optimization for multiple SkuIds 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: Feng Bob C Reviewed-by: Liming Gao --- BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/Workspace/WorkspaceCommon.py') diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py index 67aa530526..c289b9d2b5 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py @@ -44,8 +44,10 @@ def GetPackageList(Platform, BuildDatabase, Arch, Target, Toolchain): # @param Toolchain: Current toolchain # @retval: A dictionary contains instances of PcdClassObject with key (PcdCName, TokenSpaceGuid) # -def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain): +def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain,additionalPkgs): PkgList = GetPackageList(Platform, BuildDatabase, Arch, Target, Toolchain) + PkgList = set(PkgList) + PkgList |= additionalPkgs DecPcds = {} for Pkg in PkgList: for Pcd in Pkg.Pcds: -- cgit v1.2.3