From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.0.87; helo=eur01-he1-obe.outbound.protection.outlook.com; envelope-from=pankaj.bansal@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0087.outbound.protection.outlook.com [104.47.0.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DFB3F209574C9 for ; Mon, 26 Feb 2018 02:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4QVNBNjIwuzaZAvsGvhBVTuAq6C1oJiq81BQ0dAvm64=; b=RaJDN3WXQQZs8muk3WaehlpCYnqBTPPLYoVEwCsALn1VG8k4IOZ6WiGjPjcrjnJDoatF6+KzYMPu6sgW4IwiFkmXiDPnfeSMyb8doueGA+6O58UVwidZhrENxuKTih8flPD/WSA96GzL/OX/lF/HvCHQ/1gm073nI0rIwz/e7XM= Received: from AM0PR0402MB3940.eurprd04.prod.outlook.com (52.133.40.140) by AM0PR0402MB3937.eurprd04.prod.outlook.com (52.133.39.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.527.15; Mon, 26 Feb 2018 10:55:16 +0000 Received: from AM0PR0402MB3940.eurprd04.prod.outlook.com ([fe80::4815:8101:2a92:25ea]) by AM0PR0402MB3940.eurprd04.prod.outlook.com ([fe80::4815:8101:2a92:25ea%13]) with mapi id 15.20.0527.021; Mon, 26 Feb 2018 10:55:16 +0000 From: Pankaj Bansal To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , Yonghong Zhu Thread-Topic: [edk2] [RFC] Add Platform Include path in modules Thread-Index: AQHTrstDp/N2pDL1sEClpK3XeydQGKO2TS0AgAAvbjA= Date: Mon, 26 Feb 2018 10:55:16 +0000 Message-ID: References: <1519626521-15902-1-git-send-email-pankaj.bansal@nxp.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=pankaj.bansal@nxp.com; x-originating-ip: [14.143.30.134] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR0402MB3937; 6:OK/aHkoftgH6hHdpU/3n1Qpfbfy0A7IS0dhXrmcyU6M8qe43UuzRtIBA3ceJALlViq5Y5zKx3ZX3DmTj5cp2ypyqBSFyrP1mpwnJcpOnNx1DfxrwIMQFylbkKYacTfuc9Ql09RU1ATNa/rG0ERhRPgp1VaPBjivP42MMYth2FuC7SltHIT22RLUCJGzBggmYgrNx0K5wPb/Y3IPM0X94t8KLr11O39znOdG9/HhLetL3GWSvwVw+s7zkTdO09Hj4XOCHf5D8CCfHWRHz1/Q534kEAy5w0c2K2tePzMhxNTzjGvfTC6Tae6/IsaYbgWwDn9763vwAo2rc46Mc/EpHBpEA6WNvELS2EjRl7sAzX7BsBrSdRiR8U3mFsU20fSYS; 5:VqHg1jYMtqbGgobpxpd7ktfx50wX2fqEpFK6e0Pe8jLfdWRzuShzPk580j/a+nxJ5OsH5Gwy0bqXr1LVVvr8hCcdsQK9t3filpKs6cx2jc5Lq1Z2478miqF0uT6JuqxSl1sCifELoVB9b2pktt6I7DGp0NPLCLg4fR5BVubppXE=; 24:fnpfvS+wg2vBRAN5YmSzkdz4T1+msoC4KL3MCRKKWP8iN4Bz/EpaYl0PeKxAABQrvdFZ13C8KsBfgGNsfAJP9nBGSDZ0jtqcz/nK0kcNaTM=; 7:yKUX1qQdtPzCR7Io4HkP5j0OIXWjUKqtBBh5C9IdznHcmHGgbWvv2meraqAcec+81CVv0b6myqt7KW8nifAaGgCYGkzc0MzL8hGLI6YMdFVpfkqjGysn7fYhSlhWTb6nlTdFfClP0bKaKxAR9OYBVBwKBLlCcGniK+xjrcIwrI4zJmNkzIPsmyKZKz840bHR5cyI6qFS9qesmIYX+rxWqPX8RyWo9tVYybl55Kq9haAaJJ65lhjbPhpFZ98clYG/ x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 95ab9278-05af-4df3-e3a6-08d57d076b57 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM0PR0402MB3937; x-ms-traffictypediagnostic: AM0PR0402MB3937: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(189930954265078)(185117386973197)(162533806227266)(45079756050767)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231220)(944501161)(93006095)(93001095)(6055026)(6041288)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:AM0PR0402MB3937; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0402MB3937; x-forefront-prvs: 05954A7C45 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(346002)(376002)(396003)(39380400002)(189003)(199004)(13464003)(2501003)(81156014)(81166006)(45080400002)(6246003)(9686003)(55016002)(33656002)(6116002)(2906002)(6436002)(8936002)(8676002)(99286004)(105586002)(305945005)(229853002)(25786009)(53936002)(76176011)(6306002)(97736004)(554214002)(7696005)(7736002)(316002)(66066001)(68736007)(478600001)(74316002)(14454004)(2950100002)(2900100001)(4326008)(110136005)(54906003)(106356001)(55236004)(102836004)(26005)(5250100002)(6506007)(3846002)(86362001)(5660300001)(186003)(3660700001)(3280700002)(966005)(53546011); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0402MB3937; H:AM0PR0402MB3940.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Zrke/NWFyjmfyLELgh4cDaWFtlrbfzmPZdtib6yDzDYRe04mDdXzMWI5dDa1kty0psTvMusZNvS3J8pT3mqynfQnzEWqQVfaLj5SzOsc17D7GJnUpP9tRM3qJrBlWQlWoYOAI6z+QnHNFhLcqH/iPGesvyomY1yubkbDvZgvU9U= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95ab9278-05af-4df3-e3a6-08d57d076b57 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2018 10:55:16.1333 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0402MB3937 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 10:49:15 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, Consider a simple driver which needs that some data structures be filled by= the Platform, which is using the driver. Driver.c #include Struct a =3D platformVal; We can define platformVal in Platform.h, which would be unique to the platf= orm being built. This Platform.h can be placed in include directories, whose path would be d= efined in Platform.dec file. Now, whenever we build driver for each unique platform, we need not to ment= ion Platform.dec file in driver.inf [packages] section. We can append Platform.dec include paths to each driver. i.e. look for the = include files in [packages] section as well as in Platform include director= ies. For this, I am looking for Platform.dec file in same directory as Platform.= dsc and using same name as Platform.dsc We can refine this change further. i.e. add Platform include directories to= driver's include paths based on some condition in driver.inf file. Thanks & Regards, Pankaj Bansal > -----Original Message----- > From: Kinney, Michael D [mailto:michael.d.kinney@intel.com] > Sent: Monday, February 26, 2018 1:13 PM > To: Pankaj Bansal ; edk2-devel@lists.01.org; > Kinney, Michael D > Cc: Gao, Liming > Subject: RE: [edk2] [RFC] Add Platform Include path in modules >=20 > Hi, >=20 > Can you provide a simple example that shows how this feature is used and > how it works? >=20 > Thanks, >=20 > Mike >=20 > > -----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 > > > > 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. > > > > But sometimes we want to use header files for such data.e.g. if the > > values are complex structures. > > > > we need a mechanism that platform be able to supply these header files > > to a module, without changing module code. > > > > This patch is an attempt to achieve this functionality. > > > > 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(+) > > > > 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: > > > > 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 > > > > def _GetIncludePathLength(self): > > -- > > 2.7.4 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fli= s > > ts.01.org%2Fmailman%2Flistinfo%2Fedk2- > devel&data=3D02%7C01%7Cpankaj.bans > > > al%40nxp.com%7Ccaec1b6b479b4111c26308d57cec86ac%7C686ea1d3bc2b4 > c6fa92c > > > d99c5c301635%7C0%7C0%7C636552277685045614&sdata=3DG3VP7FkkVcBKN4 > bkA5RRdJ > > FzfpdIBhuxmRmBMcFvMY8%3D&reserved=3D0