From nobody Mon Dec 23 13:42:55 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 1516671543808747.8384147684984; Mon, 22 Jan 2018 17:39:03 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 015BF2233377A; Mon, 22 Jan 2018 17:33:34 -0800 (PST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 3D66922333777 for ; Mon, 22 Jan 2018 17:33:33 -0800 (PST) Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2018 17:38:59 -0800 Received: from shwdeopenpsi105.ccr.corp.intel.com ([10.239.9.129]) by fmsmga008.fm.intel.com with ESMTP; 22 Jan 2018 17:38:58 -0800 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.65; helo=mga03.intel.com; envelope-from=bob.c.feng@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.46,398,1511856000"; d="scan'208";a="12395769" From: BobCF To: edk2-devel@lists.01.org Date: Tue, 23 Jan 2018 09:38:36 +0800 Message-Id: <20180123013836.2188-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 Subject: [edk2] [Patch] BaseTools: Fixed build failure for the case that A pcd is initialized under one SKU but is uninitialized under another SKU. 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: , 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" Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng Cc: Liming Gao Reviewed-by: Liming Gao --- BaseTools/Source/Python/AutoGen/GenPcdDb.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source= /Python/AutoGen/GenPcdDb.py index 22283ef7fe..82360ae57d 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -1022,10 +1022,23 @@ def CreateAutoGen(PcdDriverAutoGenData): return (PcdDriverAutoGenData[(skuname,skuid)][0],autogenC) def NewCreatePcdDatabasePhaseSpecificAutoGen(Platform,Phase): def prune_sku(pcd,skuname): new_pcd =3D copy.deepcopy(pcd) new_pcd.SkuInfoList =3D {skuname:pcd.SkuInfoList[skuname]} + new_pcd.isinit =3D 'INIT' + if new_pcd.DatumType in ['UINT8','UINT16','UINT32','UINT64']: + for skuobj in pcd.SkuInfoList.values(): + if skuobj.DefaultValue: + defaultvalue =3D int(skuobj.DefaultValue,16) if skuobj= .DefaultValue.upper().startswith("0X") else int(skuobj.DefaultValue,10) + if defaultvalue !=3D 0: + new_pcd.isinit =3D "INIT" + break + elif skuobj.VariableName: + new_pcd.isinit =3D "INIT" + break + else: + new_pcd.isinit =3D "UNINIT" return new_pcd DynamicPcds =3D Platform.DynamicPcdList DynamicPcdSet_Sku =3D {(SkuName,skuobj.SkuId):[] for pcd in DynamicPcd= s for (SkuName,skuobj) in pcd.SkuInfoList.items() } for skuname,skuid in DynamicPcdSet_Sku: DynamicPcdSet_Sku[(skuname,skuid)] =3D [prune_sku(pcd,skuname) for= pcd in DynamicPcds] @@ -1399,12 +1412,11 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): if "PCD_TYPE_HII" not in Pcd.TokenTypeList: Pcd.TokenTypeList +=3D ['PCD_TYPE_DATA'] if Sku.DefaultValue =3D=3D 'TRUE': Pcd.InitString =3D 'INIT' else: - if int(Sku.DefaultValue, 0) !=3D 0: - Pcd.InitString =3D 'INIT' + Pcd.InitString =3D Pcd.isinit # # For UNIT64 type PCD's value, ULL should be append to avo= id # warning under linux building environment. # if Pcd.DatumType =3D=3D "UINT64": --=20 2.14.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel