BaseTools:Not miss the full assign value of FixedAtBuild structure PCD

For structure PCD, if it is a FixedAtBuild PCD, the full assign value in
dsc file should not be missed when updating the structure PCD value.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: ZhiqiangX Zhao <zhiqiangx.zhao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
Zhaozh1x 2018-10-24 20:31:23 +08:00 committed by Liming Gao
parent 63ebde8ef6
commit 8022aca8fd
1 changed files with 16 additions and 12 deletions

View File

@ -1410,6 +1410,7 @@ class DscBuildData(PlatformBuildClassObject):
SkuIds = self.SkuIds SkuIds = self.SkuIds
self.SkuIdMgr.AvailableSkuIdSet.update({TAB_DEFAULT:0}) self.SkuIdMgr.AvailableSkuIdSet.update({TAB_DEFAULT:0})
DefaultStores = {storename for pcdobj in AllPcds.values() for skuobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStoreDict} DefaultStores = {storename for pcdobj in AllPcds.values() for skuobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStoreDict}
DefaultStores.add(TAB_DEFAULT_STORES_DEFAULT)
S_PcdSet = [] S_PcdSet = []
# Find out all possible PCD candidates for self._Arch # Find out all possible PCD candidates for self._Arch
@ -1597,7 +1598,7 @@ class DscBuildData(PlatformBuildClassObject):
# #
AvailableSkuIdSet = copy.copy(self.SkuIds) AvailableSkuIdSet = copy.copy(self.SkuIds)
PcdDict = tdict(True, 3) PcdDict = tdict(True, 4)
PcdSet = set() PcdSet = set()
# Find out all possible PCD candidates for self._Arch # Find out all possible PCD candidates for self._Arch
RecordList = self._RawData[Type, self._Arch] RecordList = self._RawData[Type, self._Arch]
@ -1608,7 +1609,6 @@ class DscBuildData(PlatformBuildClassObject):
if SkuName not in AvailableSkuIdSet: if SkuName not in AvailableSkuIdSet:
EdkLogger.error('build ', PARAMETER_INVALID, 'Sku %s is not defined in [SkuIds] section' % SkuName, EdkLogger.error('build ', PARAMETER_INVALID, 'Sku %s is not defined in [SkuIds] section' % SkuName,
File=self.MetaFile, Line=Dummy5) File=self.MetaFile, Line=Dummy5)
if SkuName in (self.SkuIdMgr.SystemSkuId, TAB_DEFAULT, TAB_COMMON):
if "." not in TokenSpaceGuid: if "." not in TokenSpaceGuid:
PcdSet.add((PcdCName, TokenSpaceGuid, SkuName, Dummy5)) PcdSet.add((PcdCName, TokenSpaceGuid, SkuName, Dummy5))
PcdDict[Arch, PcdCName, TokenSpaceGuid, SkuName] = Setting PcdDict[Arch, PcdCName, TokenSpaceGuid, SkuName] = Setting
@ -1654,10 +1654,11 @@ class DscBuildData(PlatformBuildClassObject):
False, False,
None, None,
IsDsc=True) IsDsc=True)
for SkuName in PcdValueDict[PcdCName, TokenSpaceGuid]:
if self.SkuIdMgr.SystemSkuId not in Pcds[PcdCName, TokenSpaceGuid].DscRawValue: Settings = PcdValueDict[PcdCName, TokenSpaceGuid][SkuName]
Pcds[PcdCName, TokenSpaceGuid].DscRawValue[self.SkuIdMgr.SystemSkuId] = {} if SkuName not in Pcds[PcdCName, TokenSpaceGuid].DscRawValue:
Pcds[PcdCName, TokenSpaceGuid].DscRawValue[self.SkuIdMgr.SystemSkuId][TAB_DEFAULT_STORES_DEFAULT] = PcdValue Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] = {}
Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName][TAB_DEFAULT_STORES_DEFAULT] = Settings[0]
return Pcds return Pcds
def GetStructurePcdMaxSize(self, str_pcd): def GetStructurePcdMaxSize(self, str_pcd):
@ -1892,10 +1893,13 @@ class DscBuildData(PlatformBuildClassObject):
CApp = CApp + "// SkuName: %s, DefaultStoreName: %s \n" % (TAB_DEFAULT, TAB_DEFAULT_STORES_DEFAULT) CApp = CApp + "// SkuName: %s, DefaultStoreName: %s \n" % (TAB_DEFAULT, TAB_DEFAULT_STORES_DEFAULT)
inherit_OverrideValues = Pcd.SkuOverrideValues[SkuName] inherit_OverrideValues = Pcd.SkuOverrideValues[SkuName]
if Pcd.Type in PCD_DYNAMIC_TYPE_SET or Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET:
if (SkuName, DefaultStoreName) == (TAB_DEFAULT, TAB_DEFAULT_STORES_DEFAULT): if (SkuName, DefaultStoreName) == (TAB_DEFAULT, TAB_DEFAULT_STORES_DEFAULT):
pcddefaultvalue = Pcd.DefaultFromDSC.get(TAB_DEFAULT, {}).get(TAB_DEFAULT_STORES_DEFAULT) if Pcd.DefaultFromDSC else None pcddefaultvalue = Pcd.DefaultFromDSC.get(TAB_DEFAULT, {}).get(TAB_DEFAULT_STORES_DEFAULT) if Pcd.DefaultFromDSC else None
else: else:
pcddefaultvalue = Pcd.DscRawValue.get(SkuName, {}).get(DefaultStoreName) pcddefaultvalue = Pcd.DscRawValue.get(SkuName, {}).get(DefaultStoreName)
else:
pcddefaultvalue = Pcd.DscRawValue.get(SkuName, {}).get(TAB_DEFAULT_STORES_DEFAULT)
for FieldList in [pcddefaultvalue, inherit_OverrideValues.get(DefaultStoreName)]: for FieldList in [pcddefaultvalue, inherit_OverrideValues.get(DefaultStoreName)]:
if not FieldList: if not FieldList:
continue continue