From: Yonghong Zhu Date: Wed, 21 Mar 2018 02:36:59 +0000 (+0800) Subject: BaseTools: Override Max size by build Option Pcd for HII type X-Git-Tag: edk2-stable201903~2069 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=c8ae65ac5218973e473ba1ba4bd5f9ccb547a219 BaseTools: Override Max size by build Option Pcd for HII type Current code will generate maxsize for HII type PCD when parser DSC file, while this HII type PCD value maybe override in build command per --pcd option, so the max size need re-calculate. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index d60d491e10..8fe4d4f5cb 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1254,6 +1254,14 @@ class DscBuildData(PlatformBuildClassObject): SkuInfo.HiiDefaultValue = NoFiledValues[(Pcd.TokenSpaceGuidCName,Pcd.TokenCName)][0] for defaultstore in SkuInfo.DefaultStoreDict: SkuInfo.DefaultStoreDict[defaultstore] = NoFiledValues[(Pcd.TokenSpaceGuidCName,Pcd.TokenCName)][0] + if Pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII]]: + if Pcd.DatumType == "VOID*": + if not Pcd.MaxDatumSize: + Pcd.MaxDatumSize = '0' + CurrentSize = int(Pcd.MaxDatumSize,16) if Pcd.MaxDatumSize.upper().startswith("0X") else int(Pcd.MaxDatumSize) + OptionSize = len((StringToArray(Pcd.PcdValueFromComm)).split(",")) + MaxSize = max(CurrentSize, OptionSize) + Pcd.MaxDatumSize = str(MaxSize) else: PcdInDec = self.DecPcds.get((Name,Guid)) if PcdInDec: