Skip to content

Commit 1580a4e

Browse files
uefi: Update doc for OpenProtocolParams::GetProtocol
Make it clear that this can be used by applications as well as drivers. Also add safety docs.
1 parent aee9bf1 commit 1580a4e

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

uefi/src/boot.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,9 +1719,17 @@ impl Drop for TplGuard {
17191719
#[repr(u32)]
17201720
#[derive(Debug)]
17211721
pub enum OpenProtocolAttributes {
1722-
/// Used by drivers to get a protocol interface for a handle. The
1723-
/// driver will not be informed if the interface is uninstalled or
1724-
/// reinstalled.
1722+
/// Used by applications and drivers to open a protocol interface for a
1723+
/// handle.
1724+
///
1725+
/// # Safety
1726+
///
1727+
/// The interface is opened non-exclusively. The caller must ensure that
1728+
/// either the interface is immutable, or that no conflicting concurrent
1729+
/// access occurs.
1730+
///
1731+
/// The caller must ensure that the interface is not uninstalled or
1732+
/// reinstalled while still in use.
17251733
GetProtocol = 0x02,
17261734

17271735
/// Used by bus drivers to show that a protocol is being used by one

0 commit comments

Comments
 (0)