From nobody Fri May 3 12:37:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1521784657824968.3383080564612; Thu, 22 Mar 2018 22:57:37 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C8FF8223E0B81; Thu, 22 Mar 2018 22:51:03 -0700 (PDT) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 CE8582264D22C for ; Thu, 22 Mar 2018 22:51:01 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Mar 2018 22:57:34 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by fmsmga004.fm.intel.com with ESMTP; 22 Mar 2018 22:57:33 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,348,1517904000"; d="scan'208";a="39896337" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Fri, 23 Mar 2018 13:57:31 +0800 Message-Id: <1521784651-7280-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [Patch] BaseTools: Fix a bug for Size incorrect of Void* Fixatbuild Pcd X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Liming Gao --- 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 {} =20 ShareFixedAtBuildPcdsSameValue =3D {}=20 for Module in LibAuto._ReferenceModules: =20 - for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildP= cds: + for Pcd in Module.FixedAtBuildPcds: key =3D ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCNa= me)) =20 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 ShareFixedAtB= uildPcdsSameValue[key]: =20 - LibAuto.ConstPcd[key] =3D Pcd.DefaultValue + LibAuto.ConstPcd[key] =3D FixedAtBuildPcds[key] =20 def CollectVariables(self, DynamicPcdSet): =20 VpdRegionSize =3D 0 VpdRegionBase =3D 0 diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Pyt= hon/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 allowed= to set value for a FIXED_AT_BUILD PCD\n' % SetModeName) =20 ConstFixedPcd =3D False if PcdItemType =3D=3D TAB_PCDS_FIXED_AT_BUILD and (key in Info.Con= stPcd 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' %(TokenCNam= e, Type, PcdVariableName)) else: AutoGenH.Append('#define _PCD_VALUE_%s %s\n' %(TokenCName,= Pcd.DefaultValue)) PcdDataSize =3D GetPcdSize(Pcd) --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel