From: Zhaozh1x <zhiqiangx.zhao@intel.com>
To: edk2-devel@lists.01.org
Cc: Zhaozh1x <zhiqiangx.zhao@intel.com>,
Liming Gao <liming.gao@intel.com>,
Yonghong Zhu <yonghong.zhu@intel.com>,
Bob Feng <bob.c.feng@intel.com>
Subject: [PATCH] BaseTools:Not miss the full assign value of FixedAtBuild structure PCD
Date: Wed, 24 Oct 2018 21:01:29 +0800 [thread overview]
Message-ID: <20181024130129.103596-1-zhiqiangx.zhao@intel.com> (raw)
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>
---
BaseTools/Source/Python/Workspace/DscBuildData.py | 28 +++++++++++++----------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index b0e88a93ce..e24daa63b6 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1420,6 +1420,7 @@ class DscBuildData(PlatformBuildClassObject):
SkuIds = self.SkuIds
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.add(TAB_DEFAULT_STORES_DEFAULT)
S_PcdSet = []
# Find out all possible PCD candidates for self._Arch
@@ -1589,7 +1590,7 @@ class DscBuildData(PlatformBuildClassObject):
#
AvailableSkuIdSet = copy.copy(self.SkuIds)
- PcdDict = tdict(True, 3)
+ PcdDict = tdict(True, 4)
PcdSet = set()
# Find out all possible PCD candidates for self._Arch
RecordList = self._RawData[Type, self._Arch]
@@ -1600,10 +1601,9 @@ class DscBuildData(PlatformBuildClassObject):
if SkuName not in AvailableSkuIdSet:
EdkLogger.error('build ', PARAMETER_INVALID, 'Sku %s is not defined in [SkuIds] section' % SkuName,
File=self.MetaFile, Line=Dummy5)
- if SkuName in (self.SkuIdMgr.SystemSkuId, TAB_DEFAULT, TAB_COMMON):
- if "." not in TokenSpaceGuid:
- PcdSet.add((PcdCName, TokenSpaceGuid, SkuName, Dummy5))
- PcdDict[Arch, PcdCName, TokenSpaceGuid, SkuName] = Setting
+ if "." not in TokenSpaceGuid:
+ PcdSet.add((PcdCName, TokenSpaceGuid, SkuName, Dummy5))
+ PcdDict[Arch, PcdCName, TokenSpaceGuid, SkuName] = Setting
for PcdCName, TokenSpaceGuid, SkuName, Dummy4 in PcdSet:
Setting = PcdDict[self._Arch, PcdCName, TokenSpaceGuid, SkuName]
@@ -1646,10 +1646,11 @@ class DscBuildData(PlatformBuildClassObject):
False,
None,
IsDsc=True)
-
- if self.SkuIdMgr.SystemSkuId not in Pcds[PcdCName, TokenSpaceGuid].DscRawValue:
- Pcds[PcdCName, TokenSpaceGuid].DscRawValue[self.SkuIdMgr.SystemSkuId] = {}
- Pcds[PcdCName, TokenSpaceGuid].DscRawValue[self.SkuIdMgr.SystemSkuId][TAB_DEFAULT_STORES_DEFAULT] = PcdValue
+ for SkuName in PcdValueDict[PcdCName, TokenSpaceGuid]:
+ Settings = PcdValueDict[PcdCName, TokenSpaceGuid][SkuName]
+ if SkuName not in Pcds[PcdCName, TokenSpaceGuid].DscRawValue:
+ Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] = {}
+ Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName][TAB_DEFAULT_STORES_DEFAULT] = Settings[0]
return Pcds
def GetStructurePcdMaxSize(self, str_pcd):
@@ -1884,10 +1885,13 @@ class DscBuildData(PlatformBuildClassObject):
CApp = CApp + "// SkuName: %s, DefaultStoreName: %s \n" % (TAB_DEFAULT, TAB_DEFAULT_STORES_DEFAULT)
inherit_OverrideValues = Pcd.SkuOverrideValues[SkuName]
- 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
+ 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):
+ pcddefaultvalue = Pcd.DefaultFromDSC.get(TAB_DEFAULT, {}).get(TAB_DEFAULT_STORES_DEFAULT) if Pcd.DefaultFromDSC else None
+ else:
+ pcddefaultvalue = Pcd.DscRawValue.get(SkuName, {}).get(DefaultStoreName)
else:
- pcddefaultvalue = Pcd.DscRawValue.get(SkuName, {}).get(DefaultStoreName)
+ pcddefaultvalue = Pcd.DscRawValue.get(SkuName, {}).get(TAB_DEFAULT_STORES_DEFAULT)
for FieldList in [pcddefaultvalue, inherit_OverrideValues.get(DefaultStoreName)]:
if not FieldList:
continue
--
2.14.1.windows.1
next reply other threads:[~2018-10-24 13:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-24 13:01 Zhaozh1x [this message]
2018-10-26 1:51 ` [PATCH] BaseTools:Not miss the full assign value of FixedAtBuild structure PCD Feng, Bob C
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181024130129.103596-1-zhiqiangx.zhao@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox