From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CCE0C21106F21 for ; Thu, 25 Oct 2018 18:51:36 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2018 18:51:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,426,1534834800"; d="scan'208";a="268882684" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 25 Oct 2018 18:51:36 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 25 Oct 2018 18:51:35 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 25 Oct 2018 18:51:35 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.102]) by shsmsx102.ccr.corp.intel.com ([169.254.2.84]) with mapi id 14.03.0415.000; Fri, 26 Oct 2018 09:51:33 +0800 From: "Feng, Bob C" To: "Zhao, ZhiqiangX" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [PATCH] BaseTools:Not miss the full assign value of FixedAtBuild structure PCD Thread-Index: AQHUa5m443mO42lemEaRbpOCeC3xjqUwxX4A Date: Fri, 26 Oct 2018 01:51:33 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D15FFEA814@SHSMSX101.ccr.corp.intel.com> References: <20181024130129.103596-1-zhiqiangx.zhao@intel.com> In-Reply-To: <20181024130129.103596-1-zhiqiangx.zhao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODEyOTczZmQtODc1MS00MTViLThjNjAtYzkyZWY5NzAwYTA2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUTZjc1VXelFxcU9SSFFWbXVDRUhOb3lYcE9CNUtiazg5N2VlZGpIYndzN3ZsTDV2ZXNteWt2Q0RPRnRyeGRnUiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] BaseTools:Not miss the full assign value of FixedAtBuild structure PCD X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2018 01:51:37 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Zhao, ZhiqiangX=20 Sent: Wednesday, October 24, 2018 9:01 PM To: edk2-devel@lists.01.org Cc: Zhao, ZhiqiangX ; Gao, Liming ; Zhu, Yonghong ; Feng, Bob C Subject: [PATCH] BaseTools:Not miss the full assign value of FixedAtBuild s= tructure PCD For structure PCD, if it is a FixedAtBuild PCD, the full assign value in ds= c file should not be missed when updating the structure PCD value. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng --- 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 =3D self.SkuIds self.SkuIdMgr.AvailableSkuIdSet.update({TAB_DEFAULT:0}) DefaultStores =3D {storename for pcdobj in AllPcds.values() for sk= uobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStoreDic= t} + DefaultStores.add(TAB_DEFAULT_STORES_DEFAULT) =20 S_PcdSet =3D [] # Find out all possible PCD candidates for self._Arch @@ -1589,7 += 1590,7 @@ class DscBuildData(PlatformBuildClassObject): # AvailableSkuIdSet =3D copy.copy(self.SkuIds) =20 - PcdDict =3D tdict(True, 3) + PcdDict =3D tdict(True, 4) PcdSet =3D set() # Find out all possible PCD candidates for self._Arch RecordList =3D 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 no= t defined in [SkuIds] section' % SkuName, File=3Dself.MetaFile, Line=3DD= ummy5) - if SkuName in (self.SkuIdMgr.SystemSkuId, TAB_DEFAULT, TAB_COM= MON): - if "." not in TokenSpaceGuid: - PcdSet.add((PcdCName, TokenSpaceGuid, SkuName, Dummy5)= ) - PcdDict[Arch, PcdCName, TokenSpaceGuid, SkuName] =3D Setti= ng + if "." not in TokenSpaceGuid: + PcdSet.add((PcdCName, TokenSpaceGuid, SkuName, Dummy5)) + PcdDict[Arch, PcdCName, TokenSpaceGuid, SkuName] =3D Setting =20 for PcdCName, TokenSpaceGuid, SkuName, Dummy4 in PcdSet: Setting =3D PcdDict[self._Arch, PcdCName, TokenSpaceGuid, SkuN= ame] @@ -1646,10 +1646,11 @@ class DscBuildData(PlatformBuildClassObject): False, None, IsDsc=3DTrue) - - if self.SkuIdMgr.SystemSkuId not in Pcds[PcdCName, TokenSpaceG= uid].DscRawValue: - Pcds[PcdCName, TokenSpaceGuid].DscRawValue[self.SkuIdMgr.S= ystemSkuId] =3D {} - Pcds[PcdCName, TokenSpaceGuid].DscRawValue[self.SkuIdMgr.Syste= mSkuId][TAB_DEFAULT_STORES_DEFAULT] =3D PcdValue + for SkuName in PcdValueDict[PcdCName, TokenSpaceGuid]: + Settings =3D PcdValueDict[PcdCName, TokenSpaceGuid][SkuNam= e] + if SkuName not in Pcds[PcdCName, TokenSpaceGuid].DscRawVal= ue: + Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] = =3D {} + Pcds[PcdCName,=20 + TokenSpaceGuid].DscRawValue[SkuName][TAB_DEFAULT_STORES_DEFAULT] =3D=20 + Settings[0] return Pcds =20 def GetStructurePcdMaxSize(self, str_pcd): @@ -1884,10 +1885,13 @@ class DscBuildData(PlatformBuildClassObject): =20 CApp =3D CApp + "// SkuName: %s, DefaultStoreName: %s \n" % (TAB_= DEFAULT, TAB_DEFAULT_STORES_DEFAULT) inherit_OverrideValues =3D Pcd.SkuOverrideValues[SkuName] - if (SkuName, DefaultStoreName) =3D=3D (TAB_DEFAULT, TAB_DEFAULT_ST= ORES_DEFAULT): - pcddefaultvalue =3D Pcd.DefaultFromDSC.get(TAB_DEFAULT, {}).ge= t(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) =3D=3D (TAB_DEFAULT, TAB_DEFAUL= T_STORES_DEFAULT): + pcddefaultvalue =3D Pcd.DefaultFromDSC.get(TAB_DEFAULT, {}= ).get(TAB_DEFAULT_STORES_DEFAULT) if Pcd.DefaultFromDSC else None + else: + pcddefaultvalue =3D Pcd.DscRawValue.get(SkuName,=20 + {}).get(DefaultStoreName) else: - pcddefaultvalue =3D Pcd.DscRawValue.get(SkuName, {}).get(Defau= ltStoreName) + pcddefaultvalue =3D Pcd.DscRawValue.get(SkuName,=20 + {}).get(TAB_DEFAULT_STORES_DEFAULT) for FieldList in [pcddefaultvalue, inherit_OverrideValues.get(Defa= ultStoreName)]: if not FieldList: continue -- 2.14.1.windows.1