public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Pankaj Bansal <pankaj.bansal@nxp.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>
Subject: Re: [RFC] Add Platform Include path in modules
Date: Mon, 26 Feb 2018 16:55:25 +0100	[thread overview]
Message-ID: <76e5168a-e3c2-97bb-dac1-22ffc212c7ee@redhat.com> (raw)
In-Reply-To: <AM0PR0402MB3940EF219DB8AF966B18F90EF1C10@AM0PR0402MB3940.eurprd04.prod.outlook.com>

On 02/26/18 11:55, Pankaj Bansal wrote:
> Hi,
> 
> Consider a simple driver which needs that some data structures be
> filled by the Platform, which is using the driver.
> 
> Driver.c #include <Platform.h>
> 
> Struct a = platformVal;
> 
> We can define platformVal in Platform.h, which would be unique to the
> platform being built. This Platform.h can be placed in include
> directories, whose path would be defined in Platform.dec file.
> 
> Now, whenever we build driver for each unique platform, we need not
> to mention 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
> directories.
> 
> 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.

(Apologies in advance if I failed to grasp the use case.)

If I understand correctly, you have multiple platforms (defined by DSC
and FDF files), and you build a given driver for several of these
platforms, separately. And, when building the driver for the separate
platforms, you'd like the driver to get different initializers for
various static (global) structure variables.

Have you tried the structured PCD format? I think that could cover your
use case.

Unfortunately I couldn't find anything about structured PCDs in the edk2
specs, but there are several BZ references in the following mailing list
message:

[edk2] [Patch 00/14] Enable Structure PCD support in edk2

http://mid.mail-archive.com/1512140335-6932-1-git-send-email-liming.gao@intel.com

Thanks
Laszlo


  reply	other threads:[~2018-02-26 15:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26  6:28 [RFC] Add Platform Include path in modules Pankaj Bansal
2018-02-26  7:42 ` Kinney, Michael D
2018-02-26 10:55   ` Pankaj Bansal
2018-02-26 15:55     ` Laszlo Ersek [this message]
2018-02-26 17:25       ` Kinney, Michael D
2018-02-27  7:39         ` Pankaj Bansal
2018-02-27 11:21           ` Gao, Liming
2018-03-09 10:54             ` Pankaj Bansal
2018-03-09 17:29               ` Kinney, Michael D
2018-02-26 12:55 ` [RFC v2] " Pankaj Bansal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76e5168a-e3c2-97bb-dac1-22ffc212c7ee@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox