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
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to