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.88; helo=mga01.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 8EC6920886F35 for ; Tue, 19 Feb 2019 17:16:48 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Feb 2019 17:16:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,388,1544515200"; d="scan'208";a="320426406" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 19 Feb 2019 17:16:48 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 19 Feb 2019 17:16:47 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 19 Feb 2019 17:16:47 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.194]) with mapi id 14.03.0415.000; Wed, 20 Feb 2019 09:16:46 +0800 From: "Feng, Bob C" To: "Fan, ZhijuX" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [PATCH] BaseTools:PCD value error in structure pcd sku case. Thread-Index: AdTHb8AJr2eqycHMTGK42Cqr/Dn5LwBShFeQ Date: Wed, 20 Feb 2019 01:16:45 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D160089F68@SHSMSX101.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] BaseTools:PCD value error in structure pcd sku case. 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: Wed, 20 Feb 2019 01:16:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Fan, ZhijuX=20 Sent: Monday, February 18, 2019 5:53 PM To: edk2-devel@lists.01.org Cc: Gao, Liming ; Feng, Bob C Subject: [PATCH] BaseTools:PCD value error in structure pcd sku case. Defined 2 PCDs(Test4 & Test401) and 2 SKUs(DEFAULT & _), then set "SKUID_De= fines" to ALL, for FixedAtBuild gEfiStructuredPcdPkgTokenSpaceGuid. Test401= in this case, its value should get from "Default" SKU, not from "_" SKU, b= ut we does not set value in SKU "_" in dsc, so Test401 should only display = the value get from dec. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/Common/GlobalData.py | 2 +- BaseTools/Source/Python/Workspace/DscBuildData.py | 3 +++ BaseTools/Source/Python/build/BuildReport.py | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Sourc= e/Python/Common/GlobalData.py index 5eaee06694..f117998b0b 100644 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -103,7 +103,7 @@ MixedPcd =3D {} =20 # Structure Pcd dict gStructurePcd =3D {} - +gPcdSkuOverrides=3D{} # Pcd name for the Pcd which used in the Conditional directives gConditio= nalPcds =3D [] =20 diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 1fd1639ab6..5daefe835e 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1537,6 +1537,9 @@ class DscBuildData(PlatformBuildClassObject): stru_pcd.SkuOverrideValues[skuid] =3D copy.deepcopy(st= ru_pcd.SkuOverrideValues[nextskuid]) if not NoDefault else copy.deepcopy({d= efaultstorename: stru_pcd.DefaultValues for defaultstorename in DefaultStor= es} if DefaultStores else {}) #{TAB_DEFAULT_STORES_DEFAULT:stru_pcd.Default= Values}) if not NoDefault: stru_pcd.ValueChain.add((skuid, '')) + if 'DEFAULT' in stru_pcd.SkuOverrideValues and not GlobalD= ata.gPcdSkuOverrides.get((stru_pcd.TokenCName, stru_pcd.TokenSpaceGuidCName= )): + GlobalData.gPcdSkuOverrides.update( + {(stru_pcd.TokenCName,=20 + stru_pcd.TokenSpaceGuidCName):=20 + {'DEFAULT':stru_pcd.SkuOverrideValues['DEFAULT']}}) if stru_pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_= HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: for skuid in SkuIds: nextskuid =3D skuid diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index 0b98d62cb6..358fdd82d6 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1295,7 +1295,10 @@ class PcdReport(object): FileWrite(File, ' %-*s : %6s %10s =3D %s' % (self.MaxLen= , Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value)) if IsStructure: FiledOverrideFlag =3D False - OverrideValues =3D Pcd.SkuOverrideValues + if (Pcd.TokenCName,Pcd.TokenSpaceGuidCName) in GlobalData.= gPcdSkuOverrides: + OverrideValues =3D GlobalData.gPcdSkuOverrides[(Pcd.To= kenCName,Pcd.TokenSpaceGuidCName)] + else: + OverrideValues =3D Pcd.SkuOverrideValues if OverrideValues: for Data in OverrideValues.values(): Struct =3D list(Data.values()) -- 2.14.1.windows.1