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.136; helo=mga12.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 A5E5C2116DA05 for ; Fri, 12 Oct 2018 06:32:31 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2018 06:32:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,372,1534834800"; d="scan'208";a="77536178" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga007.fm.intel.com with ESMTP; 12 Oct 2018 06:32:31 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 12 Oct 2018 06:32:31 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 12 Oct 2018 06:32:30 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.48]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.245]) with mapi id 14.03.0319.002; Fri, 12 Oct 2018 21:32:28 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Enhance the *P Flag display for Structure Pcd Thread-Index: AQHUYTDu2iKOxX39zkuId09oQ1yNEqUbnaHg Date: Fri, 12 Oct 2018 13:32:27 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E3393F2@SHSMSX104.ccr.corp.intel.com> References: <1539241576-10044-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1539241576-10044-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTMzMjgwYTItYTAyNi00MDdjLWJkZTAtMzBkOTU4ZmQwZjJhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoia0J4YWhvRkZGdXR5bnNlTkxLUmdcL1RlTHk3ZGV0Rmcza0ZXSXVwMm94ancydE5FYTNwb1UxVHZDS2lEMVdkblMifQ== 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: Enhance the *P Flag display for 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, 12 Oct 2018 13:32:31 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zh= u, Yonghong > Sent: Thursday, October 11, 2018 3:06 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [Patch] BaseTools: Enhance the *P Flag display for Struct= ure Pcd >=20 > Cover the case: > 1.only define the structure Pcd in DEC file, it should not have any > Flag. > 2.In the DEC file and DSC file only have the PCD's default value, and > without the field value, it should have *P Flag. >=20 > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Yonghong Zhu > --- > BaseTools/Source/Python/build/BuildReport.py | 66 ++++++++++++++++------= ------ > 1 file changed, 39 insertions(+), 27 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sou= rce/Python/build/BuildReport.py > index feaf6a5..031594b 100644 > --- a/BaseTools/Source/Python/build/BuildReport.py > +++ b/BaseTools/Source/Python/build/BuildReport.py > @@ -1071,41 +1071,52 @@ class PcdReport(object): > if Pcd.PcdFieldValueFromComm: > BuildOptionMatch =3D True > DecMatch =3D False > elif Pcd.SkuOverrideValues: > DscOverride =3D False > - if not Pcd.SkuInfoList: > - OverrideValues =3D Pcd.SkuOverrideValues > - if OverrideValues: > - Keys =3D list(OverrideValues.keys()) > - Data =3D OverrideValues[Keys[0]] > - Struct =3D list(Data.values())[0] > - DscOverride =3D self.ParseStruct(Struct) > + if Pcd.DefaultFromDSC: > + DscOverride =3D True > else: > - SkuList =3D sorted(Pcd.SkuInfoList.keys()) > - for Sku in SkuList: > - SkuInfo =3D Pcd.SkuInfoList[Sku] > - if TypeName in ('DYNHII', 'DEXHII'): > - if SkuInfo.DefaultStoreDict: > - DefaultStoreList =3D sorted(SkuI= nfo.DefaultStoreDict.keys()) > - for DefaultStore in DefaultStore= List: > - OverrideValues =3D Pcd.SkuOv= errideValues[Sku] > - DscOverride =3D self.ParseSt= ruct(OverrideValues[DefaultStore]) > - if DscOverride: > - break > - else: > - OverrideValues =3D Pcd.SkuOverrideVa= lues[Sku] > + DictLen =3D 0 > + for item in Pcd.SkuOverrideValues: > + DictLen +=3D len(Pcd.SkuOverrideValues[i= tem]) > + if not DictLen: > + DscOverride =3D False > + else: > + if not Pcd.SkuInfoList: > + OverrideValues =3D Pcd.SkuOverrideVa= lues > if OverrideValues: > Keys =3D list(OverrideValues.key= s()) > - OverrideFieldStruct =3D self.Ove= rrideFieldValue(Pcd, OverrideValues[Keys[0]]) > - DscOverride =3D self.ParseStruct= (OverrideFieldStruct) > - if DscOverride: > - break > + Data =3D OverrideValues[Keys[0]] > + Struct =3D list(Data.values()) > + DscOverride =3D self.ParseStruct= (Struct[0]) > + else: > + SkuList =3D sorted(Pcd.SkuInfoList.k= eys()) > + for Sku in SkuList: > + SkuInfo =3D Pcd.SkuInfoList[Sku] > + if TypeName in ('DYNHII', 'DEXHI= I'): > + if SkuInfo.DefaultStoreDict: > + DefaultStoreList =3D sor= ted(SkuInfo.DefaultStoreDict.keys()) > + for DefaultStore in Defa= ultStoreList: > + OverrideValues =3D P= cd.SkuOverrideValues[Sku] > + DscOverride =3D self= .ParseStruct(OverrideValues[DefaultStore]) > + if DscOverride: > + break > + else: > + OverrideValues =3D Pcd.SkuOv= errideValues[Sku] > + if OverrideValues: > + Keys =3D list(OverrideVa= lues.keys()) > + OverrideFieldStruct =3D = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]]) > + DscOverride =3D self.Par= seStruct(OverrideFieldStruct) > + if DscOverride: > + break > if DscOverride: > DscDefaultValue =3D True > DscMatch =3D True > DecMatch =3D False > + else: > + DecMatch =3D True > else: > DscDefaultValue =3D True > DscMatch =3D True > DecMatch =3D False >=20 > @@ -1250,13 +1261,14 @@ class PcdReport(object): > if IsStructure: > OverrideValues =3D Pcd.SkuOverrideValues > if OverrideValues: > Keys =3D list(OverrideValues.keys()) > Data =3D OverrideValues[Keys[0]] > - Struct =3D list(Data.values())[0] > - OverrideFieldStruct =3D self.OverrideFieldValue(Pcd,= Struct) > - self.PrintStructureInfo(File, OverrideFieldStruct) > + Struct =3D list(Data.values()) > + if Struct: > + OverrideFieldStruct =3D self.OverrideFieldValue(= Pcd, Struct[0]) > + self.PrintStructureInfo(File, OverrideFieldStruc= t) > self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDe= faultValue, InfMatch, InfDefaultValue, DecMatch, > DecDefaultValue) > else: > FirstPrint =3D True > SkuList =3D sorted(Pcd.SkuInfoList.keys()) > for Sku in SkuList: > -- > 2.6.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel