From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 3E18121BC6ADB for ; Sun, 26 Mar 2017 19:37:02 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP; 26 Mar 2017 19:37:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="1112395345" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 26 Mar 2017 19:37:01 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 26 Mar 2017 19:37:01 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.212]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.224]) with mapi id 14.03.0248.002; Mon, 27 Mar 2017 10:36:59 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Fix build failure for DynamicEx Pcd used in the Library Thread-Index: AQHSoq32ba2x9yZ2ekyF73kJ6zGVfaGoAJqQ Date: Mon, 27 Mar 2017 02:36:58 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D702AC4@shsmsx102.ccr.corp.intel.com> References: <1490147110-29700-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1490147110-29700-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 build failure for DynamicEx Pcd used in the Library 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: Mon, 27 Mar 2017 02:37:02 -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: Wednesday, March 22, 2017 9:45 AM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [Patch] BaseTools: Fix build failure for DynamicEx Pcd used in th= e >Library > >Update DynExPcdTokenNumberMapping logic, currently even it is Library, >its self's Pcd is saved into ModulePcdList. > >Fixes:https://bugzilla.tianocore.org/show_bug.cgi?id=3D434 >Cc: Liming Gao >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Yonghong Zhu >--- > BaseTools/Source/Python/AutoGen/GenC.py | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > >diff --git a/BaseTools/Source/Python/AutoGen/GenC.py >b/BaseTools/Source/Python/AutoGen/GenC.py >index c1d64cc..96b1459 100644 >--- a/BaseTools/Source/Python/AutoGen/GenC.py >+++ b/BaseTools/Source/Python/AutoGen/GenC.py >@@ -672,14 +672,12 @@ gModuleTypeHeaderFile =3D { > # > # > def DynExPcdTokenNumberMapping(Info, AutoGenH): > ExTokenCNameList =3D [] > PcdExList =3D [] >- if Info.IsLibrary: >- PcdList =3D Info.LibraryPcdList >- else: >- PcdList =3D Info.ModulePcdList >+ # Even it is the Library, the PCD is saved in the ModulePcdList >+ PcdList =3D Info.ModulePcdList > for Pcd in PcdList: > if Pcd.Type in gDynamicExPcd: > ExTokenCNameList.append(Pcd.TokenCName) > PcdExList.append(Pcd) > if len(ExTokenCNameList) =3D=3D 0: >@@ -1153,11 +1151,11 @@ def CreateLibraryPcdCode(Info, AutoGenC, >AutoGenH, Pcd): > # If PcdGet/Set used in the Pcds with different Guids but same CN= ame, it >should failed to build. > if PcdExCNameList.count(Pcd.TokenCName) > 1: > AutoGenH.Append('// Disabled the macros, as PcdToken and >PcdGet/Set are not allowed in the case that more than one DynamicEx Pcds >are different Guids but same CName.\n') > AutoGenH.Append('// #define %s %s\n' % (PcdTokenName, >PcdExTokenName)) > AutoGenH.Append('// #define %s LibPcdGetEx%s(&%s, %s)\n' % >(GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, >PcdTokenName)) >- AutoGenH.Append('// #define %s LibPcdGetExSize(&%s, %s \n' % >(GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName)) >+ AutoGenH.Append('// #define %s LibPcdGetExSize(&%s, %s)\n' % >(GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName)) > if Pcd.DatumType =3D=3D 'VOID*': > AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) >LibPcdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, >DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName)) > AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) >LibPcdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % >(SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, >PcdTokenName)) > else: > AutoGenH.Append('// #define %s(Value) LibPcdSetEx%s(&%s,= %s, >(Value))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, >PcdTokenName)) >-- >2.6.1.windows.1