From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 EBDC121A0BA9B for ; Thu, 11 May 2017 22:24:47 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 May 2017 22:24:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,328,1491289200"; d="scan'208";a="85893144" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 11 May 2017 22:24:47 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 11 May 2017 22:24:46 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 11 May 2017 22:24:46 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.246]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.193]) with mapi id 14.03.0319.002; Fri, 12 May 2017 13:24:44 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Fix the bug that FixedPcdGetPtr failure for CArray Pcd Thread-Index: AQHSys8alNNHLPSmuU2wGFup7Cv7QaHwKn7A Date: Fri, 12 May 2017 05:24:43 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D72D787@shsmsx102.ccr.corp.intel.com> References: <1494559361-75492-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1494559361-75492-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 the bug that FixedPcdGetPtr failure for CArray Pcd X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 May 2017 05:24:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Zhu, Yonghong >Sent: Friday, May 12, 2017 11:23 AM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [Patch] BaseTools: Fix the bug that FixedPcdGetPtr failure for CA= rray >Pcd > >This patch for the bug FixedPcdGetPtr report failure for the CArray type >Pcd. 1) correct the Fixed Pcd list; 2) correct the Fixed Pcd in Library >AutoGen file to same with Driver AutoGen file format. > >Cc: Liming Gao >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Yonghong Zhu >--- > BaseTools/Source/Python/AutoGen/AutoGen.py | 5 +---- > BaseTools/Source/Python/AutoGen/GenC.py | 7 +++++-- > 2 files changed, 6 insertions(+), 6 deletions(-) > >diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py >b/BaseTools/Source/Python/AutoGen/AutoGen.py >index 205a75d..8d8957b 100644 >--- a/BaseTools/Source/Python/AutoGen/AutoGen.py >+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py >@@ -2757,14 +2757,11 @@ class ModuleAutoGen(AutoGen): > # Get FixedAtBuild Pcds of this Module > def _GetFixedAtBuildPcds(self): > if self._FixedAtBuildPcds: > return self._FixedAtBuildPcds > for Pcd in self.ModulePcdList: >- if self.IsLibrary: >- if not (Pcd.Pending =3D=3D False and Pcd.Type =3D=3D "Fix= edAtBuild"): >- continue >- elif Pcd.Type !=3D "FixedAtBuild": >+ if Pcd.Type !=3D "FixedAtBuild": > continue > if Pcd not in self._FixedAtBuildPcds: > self._FixedAtBuildPcds.append(Pcd) > > return self._FixedAtBuildPcds >diff --git a/BaseTools/Source/Python/AutoGen/GenC.py >b/BaseTools/Source/Python/AutoGen/GenC.py >index 542edb3..ae191d8 100644 >--- a/BaseTools/Source/Python/AutoGen/GenC.py >+++ b/BaseTools/Source/Python/AutoGen/GenC.py >@@ -1216,19 +1216,22 @@ def CreateLibraryPcdCode(Info, AutoGenC, >AutoGenH, Pcd): > AutoGenH.Append('#define %s %s\n' % >(GetModeSizeName,PatchPcdSizeVariableName)) > AutoGenH.Append('extern UINTN %s; \n' % PatchPcdSizeVariableName) > > if PcdItemType =3D=3D TAB_PCDS_FIXED_AT_BUILD or PcdItemType =3D=3D >TAB_PCDS_FEATURE_FLAG: > key =3D ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName)) >- >+ PcdVariableName =3D '_gPcd_' + gItemTypeStringDatabase[Pcd.Type] = + '_' >+ TokenCName > if DatumType =3D=3D 'VOID*' and Array =3D=3D '[]': > DatumType =3D ['UINT8', 'UINT16'][Pcd.DefaultValue[0] =3D=3D = 'L'] > AutoGenH.Append('extern const %s >_gPcd_FixedAtBuild_%s%s;\n' %(DatumType, TokenCName, Array)) > >AutoGenH.Append('#define %s %s_gPcd_FixedAtBuild_%s\n' %(GetModeN >ame, Type, TokenCName)) > AutoGenH.Append('//#define %s ASSERT(FALSE) // It is not allowe= d to >set value for a FIXED_AT_BUILD PCD\n' % SetModeName) > > if PcdItemType =3D=3D TAB_PCDS_FIXED_AT_BUILD and (key in Info.Co= nstPcd >or (Info.IsLibrary and not Info._ReferenceModules)): >- AutoGenH.Append('#define _PCD_VALUE_%s %s\n' %(TokenCName, >Pcd.DefaultValue)) >+ if DatumType =3D=3D 'VOID*': >+ AutoGenH.Append('#define >_PCD_VALUE_%s %s%s\n' %(TokenCName, Type, PcdVariableName)) >+ else: >+ AutoGenH.Append('#define >_PCD_VALUE_%s %s\n' %(TokenCName, Pcd.DefaultValue)) > > if PcdItemType =3D=3D TAB_PCDS_FIXED_AT_BUILD: > PcdDataSize =3D GetPcdSize(Pcd) > AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, >PcdDataSize)) > AutoGenH.Append('#define %s %s\n' % >(GetModeSizeName,FixPcdSizeTokenName)) >-- >2.6.1.windows.1