From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org 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 E51A320955F06 for ; Sun, 25 Feb 2018 23:36:38 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2018 23:42:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,396,1515484800"; d="scan'208";a="203748609" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by orsmga005.jf.intel.com with ESMTP; 25 Feb 2018 23:42:43 -0800 Received: from orsmsx153.amr.corp.intel.com (10.22.226.247) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 25 Feb 2018 23:42:43 -0800 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.232]) by ORSMSX153.amr.corp.intel.com ([169.254.12.78]) with mapi id 14.03.0319.002; Sun, 25 Feb 2018 23:42:43 -0800 From: "Kinney, Michael D" To: Pankaj Bansal , "edk2-devel@lists.01.org" , "Kinney, Michael D" CC: "Gao, Liming" Thread-Topic: [edk2] [RFC] Add Platform Include path in modules Thread-Index: AQHTrstKuAYiAv4k2UKkWNfdFkwjRKO2TM/w Date: Mon, 26 Feb 2018 07:42:42 +0000 Message-ID: References: <1519626521-15902-1-git-send-email-pankaj.bansal@nxp.com> In-Reply-To: <1519626521-15902-1-git-send-email-pankaj.bansal@nxp.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Subject: Re: [RFC] Add Platform Include path in modules 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: , X-List-Received-Date: Mon, 26 Feb 2018 07:36:39 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, Can you provide a simple example that shows how=20 this feature is used and how it works? Thanks, Mike > -----Original Message----- > From: edk2-devel [mailto:edk2-devel- > bounces@lists.01.org] On Behalf Of Pankaj Bansal > Sent: Sunday, February 25, 2018 10:29 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [RFC] Add Platform Include path in > modules >=20 > When we are writing the drivers for IP modules, then > sometimes we want > that Platform specific customizations or platform > dependent values be > supplied to IP module driver. normally we achieve this > using Pcd values. >=20 > But sometimes we want to use header files for such > data.e.g. if the > values are complex structures. >=20 > we need a mechanism that platform be able to supply > these header files > to a module, without changing module code. >=20 > This patch is an attempt to achieve this functionality. >=20 > Cc: Yonghong Zhu > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Pankaj Bansal > --- > BaseTools/Source/Python/AutoGen/AutoGen.py | 12 > ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py > b/BaseTools/Source/Python/AutoGen/AutoGen.py > index 405bfa1..de4a17c 100644 > --- a/BaseTools/Source/Python/AutoGen/AutoGen.py > +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py > @@ -3783,6 +3783,18 @@ class ModuleAutoGen(AutoGen): > for Inc in IncludesList: > if Inc not in > self._IncludePathList: >=20 > self._IncludePathList.append(str(Inc)) > + PackageFile =3D > PathClass(os.path.join(self.PlatformInfo.MetaFile.SubDir > , self.PlatformInfo.MetaFile.BaseName + '.dec'), > self.PlatformInfo.MetaFile.Root) > + Package =3D self.BuildDatabase[PackageFile, > self.Arch, self.BuildTarget, self.ToolChain] > + PackageDir =3D mws.join(self.WorkspaceDir, > Package.MetaFile.Dir) > + if PackageDir not in self._IncludePathList: > + > self._IncludePathList.append(PackageDir) > + IncludesList =3D Package.Includes > + if Package._PrivateIncludes: > + if not > self.MetaFile.Path.startswith(PackageDir): > + IncludesList =3D > list(set(Package.Includes).difference(set(Package._Priva > teIncludes))) > + for Inc in IncludesList: > + if Inc not in self._IncludePathList: > + > self._IncludePathList.append(str(Inc)) > return self._IncludePathList >=20 > def _GetIncludePathLength(self): > -- > 2.7.4 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel