Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions uefi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- Added `proto::scsi::pass_thru::ExtScsiPassThru`.
- Added `proto::nvme::pass_thru::NvmePassThru`.
- Added `proto::ata::pass_thru::AtaPassThru`.
- Added `boot::ScopedProtocol::open_params()`.
- Added `boot::TplGuard::old_tpl()`.

## Changed
- **Breaking:** Removed `BootPolicyError` as `BootPolicy` construction is no
Expand Down
18 changes: 17 additions & 1 deletion uefi/src/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,14 @@ pub struct ScopedProtocol<P: Protocol + ?Sized> {
open_params: OpenProtocolParams,
}

impl<P: Protocol + ?Sized> ScopedProtocol<P> {
/// Returns the [`OpenProtocolParams`] used to open the [`ScopedProtocol`].
#[must_use]
pub const fn open_params(&self) -> OpenProtocolParams {
self.open_params
}
}

impl<P: Protocol + ?Sized> Drop for ScopedProtocol<P> {
fn drop(&mut self) {
let bt = boot_services_raw_panicking();
Expand Down Expand Up @@ -1598,6 +1606,14 @@ pub struct TplGuard {
old_tpl: Tpl,
}

impl TplGuard {
/// Returns the previous [`Tpl`].
#[must_use]
pub const fn old_tpl(&self) -> Tpl {
self.old_tpl
}
}

impl Drop for TplGuard {
fn drop(&mut self) {
let bt = boot_services_raw_panicking();
Expand Down Expand Up @@ -1659,7 +1675,7 @@ pub enum OpenProtocolAttributes {
}

/// Parameters passed to [`open_protocol`].
#[derive(Debug)]
#[derive(Clone, Copy, Debug)]
pub struct OpenProtocolParams {
/// The handle for the protocol to open.
pub handle: Handle,
Expand Down