From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 C01A2820ED for ; Sun, 12 Feb 2017 22:04:18 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2017 22:04:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,155,1484035200"; d="scan'208";a="1125763504" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 12 Feb 2017 22:04:18 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 12 Feb 2017 22:04:17 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX103.ccr.corp.intel.com ([10.239.4.69]) with mapi id 14.03.0248.002; Mon, 13 Feb 2017 14:04:15 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [Patch V2] BaseTools: Enhance BaseTools supports FixedAtBuild usage in VFR file Thread-Index: AQHShb7cCqBN1ZvrdESctugYBoF5q6FmcoBw Date: Mon, 13 Feb 2017 06:04:15 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D6DA49B@shsmsx102.ccr.corp.intel.com> References: <1486965764-24604-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1486965764-24604-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 V2] BaseTools: Enhance BaseTools supports FixedAtBuild usage in VFR file X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 06:04:18 -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: Monday, February 13, 2017 2:03 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [Patch V2] BaseTools: Enhance BaseTools supports FixedAtBuild >usage in VFR file > >This patch is to update BaseTools generate Fixed PCD APIs and Value into >$(MODULE_NAME)StrDefs.h for VFR only. If the module has VFR files, and it >directly consumes FixedAtBuild PCD, BaseTool will generate those >FixedAtBuild PCD value into its $(MODULE_NAME)StrDefs.h. FixedPcdGetXX >macro are always generated. Every FixedPcd _PCD_VALUE_PcdName will be >generated without the postfix U or UL or ULL. > >Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D348 >Cc: Liming Gao >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Yonghong Zhu >--- > BaseTools/Source/Python/AutoGen/AutoGen.py | 13 ++++++++++++- > BaseTools/Source/Python/AutoGen/GenC.py | 25 >++++++++++++++++++++++++- > BaseTools/Source/Python/Common/DataType.py | 3 ++- > 3 files changed, 38 insertions(+), 3 deletions(-) > >diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py >b/BaseTools/Source/Python/AutoGen/AutoGen.py >index f35ae25..c35f0b2 100644 >--- a/BaseTools/Source/Python/AutoGen/AutoGen.py >+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py >@@ -1,9 +1,9 @@ > ## @file > # Generate AutoGen.h, AutoGen.c and *.depex files > # >-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
>+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
> # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the B= SD >License > # which accompanies this distribution. The full text of the license may = be >found at > # http://opensource.org/licenses/bsd-license.php > # >@@ -2589,10 +2589,11 @@ class ModuleAutoGen(AutoGen): > > self._IncludePathList =3D None > self._IncludePathLength =3D 0 > self._AutoGenFileList =3D None > self._UnicodeFileList =3D None >+ self._VfrFileList =3D None > self._IdfFileList =3D None > self._SourceFileList =3D None > self._ObjectFileList =3D None > self._BinaryFileList =3D None > >@@ -3114,10 +3115,19 @@ class ModuleAutoGen(AutoGen): > self._UnicodeFileList =3D self.FileTypes[TAB_UNICODE_FILE= ] > else: > self._UnicodeFileList =3D [] > return self._UnicodeFileList > >+ ## Return the list of vfr files >+ def _GetVfrFileList(self): >+ if self._VfrFileList =3D=3D None: >+ if TAB_VFR_FILE in self.FileTypes: >+ self._VfrFileList =3D self.FileTypes[TAB_VFR_FILE] >+ else: >+ self._VfrFileList =3D [] >+ return self._VfrFileList >+ > ## Return the list of Image Definition files > def _GetIdfFileList(self): > if self._IdfFileList =3D=3D None: > if TAB_IMAGE_FILE in self.FileTypes: > self._IdfFileList =3D self.FileTypes[TAB_IMAGE_FILE] >@@ -4078,10 +4088,11 @@ class ModuleAutoGen(AutoGen): > > IncludePathList =3D property(_GetIncludePathList) > IncludePathLength =3D property(_GetIncludePathLength) > AutoGenFileList =3D property(_GetAutoGenFileList) > UnicodeFileList =3D property(_GetUnicodeFileList) >+ VfrFileList =3D property(_GetVfrFileList) > SourceFileList =3D property(_GetSourceFileList) > BinaryFileList =3D property(_GetBinaryFiles) # FileType : [File List= ] > Targets =3D property(_GetTargets) > IntroTargetList =3D property(_GetIntroTargetList) > CodaTargetList =3D property(_GetFinalTargetList) >diff --git a/BaseTools/Source/Python/AutoGen/GenC.py >b/BaseTools/Source/Python/AutoGen/GenC.py >index 63cfe04..c1d64cc 100644 >--- a/BaseTools/Source/Python/AutoGen/GenC.py >+++ b/BaseTools/Source/Python/AutoGen/GenC.py >@@ -1,9 +1,9 @@ > ## @file > # Routines for generating AutoGen.h and AutoGen.c > # >-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
>+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
> # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the B= SD >License > # which accompanies this distribution. The full text of the license may = be >found at > # http://opensource.org/licenses/bsd-license.php > # >@@ -1958,10 +1958,33 @@ def CreateCode(Info, AutoGenC, AutoGenH, >StringH, UniGenCFlag, UniGenBinBuffer, > if Guid in Info.Module.GetGuidsUsedByPcd(): > continue > GuidMacros.append('#define %s %s' % (Guid, >Info.Module.Guids[Guid])) > for Guid, Value in Info.Module.Protocols.items() + >Info.Module.Ppis.items(): > GuidMacros.append('#define %s %s' % (Guid, Value)) >+ # supports FixedAtBuild usage in VFR file >+ if Info.VfrFileList and Info.ModulePcdList: >+ GuidMacros.append('#define %s %s' % >('FixedPcdGetBool(TokenName)', '_PCD_VALUE_##TokenName')) >+ GuidMacros.append('#define %s %s' % ('FixedPcdGet8(TokenName)= ', >'_PCD_VALUE_##TokenName')) >+ GuidMacros.append('#define %s %s' % ('FixedPcdGet16(TokenName= )', >'_PCD_VALUE_##TokenName')) >+ GuidMacros.append('#define %s %s' % ('FixedPcdGet32(TokenName= )', >'_PCD_VALUE_##TokenName')) >+ GuidMacros.append('#define %s %s' % ('FixedPcdGet64(TokenName= )', >'_PCD_VALUE_##TokenName')) >+ for Pcd in Info.ModulePcdList: >+ if Pcd.Type =3D=3D TAB_PCDS_FIXED_AT_BUILD: >+ TokenCName =3D Pcd.TokenCName >+ Value =3D Pcd.DefaultValue >+ if Pcd.DatumType =3D=3D 'BOOLEAN': >+ BoolValue =3D Value.upper() >+ if BoolValue =3D=3D 'TRUE': >+ Value =3D '1' >+ elif BoolValue =3D=3D 'FALSE': >+ Value =3D '0' >+ for PcdItem in GlobalData.MixedPcd: >+ if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) in >GlobalData.MixedPcd[PcdItem]: >+ TokenCName =3D PcdItem[0] >+ break >+ GuidMacros.append('#define %s %s' % >('_PCD_VALUE_'+TokenCName, Value)) >+ > if GuidMacros: > StringH.Append('\n#ifdef VFRCOMPILE\n%s\n#endif\n' % >'\n'.join(GuidMacros)) > > StringH.Append("\n#endif\n") > AutoGenH.Append('#include "%s"\n' % FileName) >diff --git a/BaseTools/Source/Python/Common/DataType.py >b/BaseTools/Source/Python/Common/DataType.py >index 60cbfbe..6edc0c0 100644 >--- a/BaseTools/Source/Python/Common/DataType.py >+++ b/BaseTools/Source/Python/Common/DataType.py >@@ -1,9 +1,9 @@ > ## @file > # This file is used to define common static strings used by INF/DEC/DSC f= iles > # >-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
>+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
> # Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
> # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the B= SD >License > # which accompanies this distribution. The full text of the license may = be >found at > # http://opensource.org/licenses/bsd-license.php >@@ -472,10 +472,11 @@ TAB_UNICODE_FILE =3D "UNICODE-TEXT-FILE" > TAB_IMAGE_FILE =3D "IMAGE-DEFINITION-FILE" > TAB_DEPENDENCY_EXPRESSION_FILE =3D "DEPENDENCY-EXPRESSION-FILE" > TAB_UNKNOWN_FILE =3D "UNKNOWN-TYPE-FILE" > TAB_DEFAULT_BINARY_FILE =3D "_BINARY_FILE_" > TAB_OBJECT_FILE =3D "OBJECT-FILE" >+TAB_VFR_FILE =3D 'VISUAL-FORM-REPRESENTATION-FILE' > > # used by BRG > TAB_BRG_PCD =3D 'PCD' > TAB_BRG_LIBRARY =3D 'Library' > >-- >2.6.1.windows.1