From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 D81ED21F2E102 for ; Sun, 8 Apr 2018 22:44:19 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Apr 2018 22:44:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,426,1517904000"; d="scan'208";a="218815130" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 08 Apr 2018 22:44:19 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 8 Apr 2018 22:44:18 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 8 Apr 2018 22:44:18 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.239]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.149]) with mapi id 14.03.0319.002; Mon, 9 Apr 2018 13:44:16 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Fix a bug for Size incorrect of Void* Fixatbuild Pcd Thread-Index: AQHTwmvjZ6w+qrov70WklJgji/luiqP4Br2g Date: Mon, 9 Apr 2018 05:44:16 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E20A4E6@SHSMSX104.ccr.corp.intel.com> References: <1521784651-7280-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1521784651-7280-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: 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: Fix a bug for Size incorrect of Void* Fixatbuild Pcd X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 05:44:20 -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 >Yonghong Zhu >Sent: Friday, March 23, 2018 1:58 PM >To: edk2-devel@lists.01.org >Subject: [edk2] [Patch] BaseTools: Fix a bug for Size incorrect of Void* >Fixatbuild Pcd > >when driver link library and there have pcd override in DSC component >section, in the library autogen file, the pcd's size is incorrect, the >size value is from DSC [pcd] section, but not from the override pcd >value that in the [component] section. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Yonghong Zhu >--- > BaseTools/Source/Python/AutoGen/AutoGen.py | 4 ++-- > BaseTools/Source/Python/AutoGen/GenC.py | 2 ++ > 2 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py >b/BaseTools/Source/Python/AutoGen/AutoGen.py >index 439e360..8682217 100644 >--- a/BaseTools/Source/Python/AutoGen/AutoGen.py >+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py >@@ -1281,11 +1281,11 @@ class PlatformAutoGen(AutoGen): > def CollectFixedAtBuildPcds(self): > for LibAuto in self.LibraryAutoGenList: > FixedAtBuildPcds =3D {} > ShareFixedAtBuildPcdsSameValue =3D {} > for Module in LibAuto._ReferenceModules: >- for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuild= Pcds: >+ for Pcd in Module.FixedAtBuildPcds: > key =3D ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCN= ame)) > if key not in FixedAtBuildPcds: > ShareFixedAtBuildPcdsSameValue[key] =3D True > FixedAtBuildPcds[key] =3D Pcd.DefaultValue > else: >@@ -1298,11 +1298,11 @@ class PlatformAutoGen(AutoGen): > else: > DscPcd =3D >self.NonDynamicPcdDict[(Pcd.TokenCName,Pcd.TokenSpaceGuidCName)] > if DscPcd.Type !=3D "FixedAtBuild": > continue > if key in ShareFixedAtBuildPcdsSameValue and >ShareFixedAtBuildPcdsSameValue[key]: >- LibAuto.ConstPcd[key] =3D Pcd.DefaultValue >+ LibAuto.ConstPcd[key] =3D FixedAtBuildPcds[key] > > def CollectVariables(self, DynamicPcdSet): > > VpdRegionSize =3D 0 > VpdRegionBase =3D 0 >diff --git a/BaseTools/Source/Python/AutoGen/GenC.py >b/BaseTools/Source/Python/AutoGen/GenC.py >index fbf892f..0509a9f 100644 >--- a/BaseTools/Source/Python/AutoGen/GenC.py >+++ b/BaseTools/Source/Python/AutoGen/GenC.py >@@ -1354,10 +1354,12 @@ def CreateLibraryPcdCode(Info, AutoGenC, >AutoGenH, Pcd): > AutoGenH.Append('//#define %s ASSERT(FALSE) // It is not allowe= d to >set value for a FIXED_AT_BUILD PCD\n' % SetModeName) > > ConstFixedPcd =3D False > if PcdItemType =3D=3D TAB_PCDS_FIXED_AT_BUILD and (key in Info.Co= nstPcd >or (Info.IsLibrary and not Info._ReferenceModules)): > ConstFixedPcd =3D True >+ if key in Info.ConstPcd: >+ Pcd.DefaultValue =3D Info.ConstPcd[key] > if Pcd.DatumType not in ['UINT8', 'UINT16', 'UINT32', 'UINT64= ', >'BOOLEAN']: > AutoGenH.Append('#define >_PCD_VALUE_%s %s%s\n' %(TokenCName, Type, PcdVariableName)) > else: > AutoGenH.Append('#define _PCD_VALUE_%s %s\n' %(TokenCName= , >Pcd.DefaultValue)) > PcdDataSize =3D GetPcdSize(Pcd) >-- >2.6.1.windows.1 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel