public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Cohen, Eugene" <eugene@hp.com>,
	"edk2-devel@lists.01.org" <edk2-devel@ml01.01.org>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	"Andrew Fish (afish@apple.com)" <afish@apple.com>
Subject: Re: RFC: ProtocolLib for cross DXE and SMM Protocol and Handle Services
Date: Fri, 30 Sep 2016 16:25:11 +0200	[thread overview]
Message-ID: <9877647c-b348-2a36-9ac0-b520a82260d1@redhat.com> (raw)
In-Reply-To: <AT5PR84MB02913834F24106FD51D581D8B4C10@AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM>

On 09/30/16 16:13, Cohen, Eugene wrote:
> Request for Comments...
> 
> Both UEFI/DXE and SMM support the protocol / handle database concept.
> Some protocol definitions are able used in both environments with
> different implementations behind them.
> 
> We'd like to create a library that could be used in either DXE or SMM
> making use of protocol and handle services.  For example, we'd like
> to be able to do a LocateProtocol for a certain protocol and make use
> of the protocol regardless of the environment we're executing in.
> 
> In order to create a neutral API for protocol and handle services
> from either environment, I'm proposing that we create a "ProtocolLib"
> that abstracts protocol install, uninstall, HandleProtocol, install
> notification, LocateHandle and LocateProtocol implementations -
> basically all the protocol and handle services common across UEFI
> Boot Services and SMST.   A DXE instance of ProtocolLib would direct
> functions through the Boot Services table and an SMM instance of
> ProtocolLib would go through the SMST.   (We also would like to
> maintain separation between DXE and SMM in support of the PI 1.5
> Standalone SMM model which is easy to achieve with separate library
> instances.)
> 
> We have a similar model already with the MemoryAllocationLib so this
> would follow in its footsteps.
> 
> 
> Please share your thoughts...

As far as I know:
- the DXE and SMM protocol databases are distinct,
- the same protocol GUID may or may not be installed (on one or more)
handle(s) in either,
- even if a protocol GUID exists uniquely in exactly one of those
databases, the locator function would have to return which database the
GUID was found.

My point is that every wrapper function that returns a protocol
interface (or several protocol interfaces), or handles, each such return
value will likely have to be qualified with the database where it was found.

(This is not meant as an argument against the library, just a remark
about the proposed APIs, as I see them.)

Thanks
Laszlo


  reply	other threads:[~2016-09-30 14:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-30 14:13 RFC: ProtocolLib for cross DXE and SMM Protocol and Handle Services Cohen, Eugene
2016-09-30 14:25 ` Laszlo Ersek [this message]
2016-09-30 16:36   ` Cohen, Eugene
2016-09-30 16:41     ` Tim Lewis
2016-09-30 16:51       ` Cohen, Eugene
2016-09-30 16:55         ` Tim Lewis
2016-09-30 17:02           ` Cohen, Eugene
2016-09-30 17:44     ` Laszlo Ersek
2016-09-30 22:04       ` Cohen, Eugene
2016-10-09  1:49         ` Gao, Liming
2016-10-10 15:24           ` Cohen, Eugene
2016-10-10 15:54             ` Kinney, Michael D
2016-10-10 16:23               ` Cohen, Eugene
2016-10-10 17:50                 ` Kinney, Michael D
2016-10-10 20:11                   ` Cohen, Eugene
2016-10-10 20:39                     ` Kinney, Michael D
2016-10-11 15:17                       ` Cohen, Eugene
2016-10-11 16:37                         ` Kinney, Michael D

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=9877647c-b348-2a36-9ac0-b520a82260d1@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