From nobody Sat Nov 2 14:35:59 2024 Delivered-To: importer@patchew.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; Authentication-Results: mx.zoho.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 1486878026335987.5311683572137; Sat, 11 Feb 2017 21:40:26 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3A5A58209F; Sat, 11 Feb 2017 21:40:24 -0800 (PST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 911F681EE5 for ; Sat, 11 Feb 2017 21:40:23 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2017 21:40:22 -0800 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga003.jf.intel.com with ESMTP; 11 Feb 2017 21:40:21 -0800 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,150,1484035200"; d="scan'208";a="932892727" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Sun, 12 Feb 2017 13:40:18 +0800 Message-Id: <1486878018-14408-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [Patch] 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: , Cc: Liming Gao 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" 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/GenC.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Pyt= hon/AutoGen/GenC.py index 63cfe04..6bb975f 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 BS= D License # which accompanies this distribution. The full text of the license may b= e found at # http://opensource.org/licenses/bsd-license.php # @@ -1958,10 +1958,33 @@ def CreateCode(Info, AutoGenC, AutoGenH, StringH, U= niGenCFlag, UniGenBinBuffer, if Guid in Info.Module.GetGuidsUsedByPcd(): continue GuidMacros.append('#define %s %s' % (Guid, Info.Module.Guids[G= uid])) for Guid, Value in Info.Module.Protocols.items() + Info.Module.Ppi= s.items(): GuidMacros.append('#define %s %s' % (Guid, Value)) + # supports FixedAtBuild usage in VFR file + if not Info.IsLibrary and Info.ModulePcdList: + 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 Gl= obalData.MixedPcd[PcdItem]: + TokenCName =3D PcdItem[0] + break + GuidMacros.append('#define %s %s' % ('FixedPcdGetBool(= ' + TokenCName +')', '_PCD_VALUE_'+TokenCName)) + GuidMacros.append('#define %s %s' % ('FixedPcdGet8(' += TokenCName +')', '_PCD_VALUE_'+TokenCName)) + GuidMacros.append('#define %s %s' % ('FixedPcdGet16(' = + TokenCName +')', '_PCD_VALUE_'+TokenCName)) + GuidMacros.append('#define %s %s' % ('FixedPcdGet32(' = + TokenCName +')', '_PCD_VALUE_'+TokenCName)) + GuidMacros.append('#define %s %s' % ('FixedPcdGet64(' = + TokenCName +')', '_PCD_VALUE_'+TokenCName)) + GuidMacros.append('#define %s %s' % ('_PCD_VALUE_'+Tok= enCName, Value)) + if GuidMacros: StringH.Append('\n#ifdef VFRCOMPILE\n%s\n#endif\n' % '\n'.join= (GuidMacros)) =20 StringH.Append("\n#endif\n") AutoGenH.Append('#include "%s"\n' % FileName) --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel