From nobody Mon Apr 29 16:13:36 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; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1526820968962945.5045516031847; Sun, 20 May 2018 05:56:08 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E02A22098598A; Sun, 20 May 2018 05:56:07 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 26D4D20985981 for ; Sun, 20 May 2018 05:56:06 -0700 (PDT) Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 May 2018 05:56:05 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by orsmga007.jf.intel.com with ESMTP; 20 May 2018 05:56:04 -0700 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=192.55.52.115; helo=mga14.intel.com; envelope-from=yonghong.zhu@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.49,423,1520924400"; d="scan'208";a="42417522" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Sun, 20 May 2018 20:56:02 +0800 Message-Id: <1526820962-31464-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [Patch] BaseTools: Library PCD type will inherit from the driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yunhua Feng , 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" From: Yunhua Feng If a PCD is not referenced in global PCD section of DSC file at all, but is referenced in module scope, then the default PCD type for libs should be the module scoped PCD type. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D901 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index f29df21..1715101 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -428,10 +428,26 @@ class WorkspaceAutoGen(AutoGen): if key in PlatformModule.Pcds: PcdInPlatform =3D PlatformModule.Pcds[= key] if PcdInPlatform.Type: BuildData.Pcds[key].Type =3D PcdIn= Platform.Type BuildData.Pcds[key].Pending =3D Fa= lse + else: + #Pcd used in Library, Pcd Type from refere= nce module if Pcd Type is Pending + if BuildData.Pcds[key].Pending: + MGen =3D ModuleAutoGen(self, BuildData= .MetaFile, Target, Toolchain, Arch, self.MetaFile) + if MGen and MGen.IsLibrary: + if MGen in PGen.LibraryAutoGenList: + ReferenceModules =3D MGen._Ref= erenceModules + for ReferenceModule in Referen= ceModules: + if ReferenceModule.MetaFil= e in Platform.Modules: + RefPlatformModule =3D = Platform.Modules[str(ReferenceModule.MetaFile)] + if key in RefPlatformM= odule.Pcds: + PcdInReferenceModu= le =3D RefPlatformModule.Pcds[key] + if PcdInReferenceM= odule.Type: + BuildData.Pcds= [key].Type =3D PcdInReferenceModule.Type + BuildData.Pcds= [key].Pending =3D False + break =20 if TAB_PCDS_DYNAMIC_EX in BuildData.Pcds[key].Type: if BuildData.IsBinaryModule: BinaryPcdDict[TAB_PCDS_DYNAMIC_EX].add((Bu= ildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) else: --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel