summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorFeng, Bob C <bob.c.feng@intel.com>2018-01-23 09:38:36 +0800
committerLiming Gao <liming.gao@intel.com>2018-01-25 18:08:04 +0800
commit841d86fe406ed6cf504c62b6838876a65cf8f7a0 (patch)
tree580bac2c675e143f12050651bf2c175e8973ae35 /BaseTools
parent6a103440806c33c0aaa401cd443dc786d259397e (diff)
downloadedk2-841d86fe406ed6cf504c62b6838876a65cf8f7a0.tar.gz
edk2-841d86fe406ed6cf504c62b6838876a65cf8f7a0.tar.bz2
edk2-841d86fe406ed6cf504c62b6838876a65cf8f7a0.zip
BaseTools: Fixed build failure for the PCD value initialization.
A pcd is initialized under one SKU but is uninitialized under another SKU. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenPcdDb.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
index 22283ef7fe..82360ae57d 100644
--- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py
+++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
@@ -1024,6 +1024,19 @@ def NewCreatePcdDatabasePhaseSpecificAutoGen(Platform,Phase):
def prune_sku(pcd,skuname):
new_pcd = copy.deepcopy(pcd)
new_pcd.SkuInfoList = {skuname:pcd.SkuInfoList[skuname]}
+ new_pcd.isinit = 'INIT'
+ if new_pcd.DatumType in ['UINT8','UINT16','UINT32','UINT64']:
+ for skuobj in pcd.SkuInfoList.values():
+ if skuobj.DefaultValue:
+ defaultvalue = int(skuobj.DefaultValue,16) if skuobj.DefaultValue.upper().startswith("0X") else int(skuobj.DefaultValue,10)
+ if defaultvalue != 0:
+ new_pcd.isinit = "INIT"
+ break
+ elif skuobj.VariableName:
+ new_pcd.isinit = "INIT"
+ break
+ else:
+ new_pcd.isinit = "UNINIT"
return new_pcd
DynamicPcds = Platform.DynamicPcdList
DynamicPcdSet_Sku = {(SkuName,skuobj.SkuId):[] for pcd in DynamicPcds for (SkuName,skuobj) in pcd.SkuInfoList.items() }
@@ -1401,8 +1414,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, DynamicPcdList, Phase):
if Sku.DefaultValue == 'TRUE':
Pcd.InitString = 'INIT'
else:
- if int(Sku.DefaultValue, 0) != 0:
- Pcd.InitString = 'INIT'
+ Pcd.InitString = Pcd.isinit
#
# For UNIT64 type PCD's value, ULL should be append to avoid
# warning under linux building environment.