Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

uefi: update open protocol doc #1733

Open
@phip1611

Description

I have been trying to get non-exclusive access to a protocol as an app, but I don't understand the API yet

Use boot::open_protocol with OpenProtocolAttributes::GetProtocol. Here's an example:

let block_io = boot::open_protocol::<BlockIO>(
OpenProtocolParams {
handle,
agent: boot::image_handle(),
controller: None,
},
OpenProtocolAttributes::GetProtocol,
)

The documentation (and spec) are a little confusing since they say it's for drivers, but it works just as well with applications. (You can see in edk2 that BY_HANDLE_PROTOCOL and GET_PROTOCOL are handled the same way, and you can see example usages in popular UEFI applications such as shim and grub.) We should certainly update our docs to make this less confusing.

Originally posted by @nicholasbishop in #1725

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /