summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Workspace/DscBuildData.py
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2018-03-21 10:36:59 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-03-21 11:48:33 +0800
commitc8ae65ac5218973e473ba1ba4bd5f9ccb547a219 (patch)
treee7211b37760f8bcc55a1e1190aae4af33adaa3f8 /BaseTools/Source/Python/Workspace/DscBuildData.py
parent2b85beae0b2e980a310193f9a35372fb7dae2c23 (diff)
downloadedk2-c8ae65ac5218973e473ba1ba4bd5f9ccb547a219.tar.gz
edk2-c8ae65ac5218973e473ba1ba4bd5f9ccb547a219.tar.bz2
edk2-c8ae65ac5218973e473ba1ba4bd5f9ccb547a219.zip
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 <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace/DscBuildData.py')
-rw-r--r--BaseTools/Source/Python/Workspace/DscBuildData.py8
1 files changed, 8 insertions, 0 deletions
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: