diff --git a/uefi/CHANGELOG.md b/uefi/CHANGELOG.md index b4edf2c69..d9783b89c 100644 --- a/uefi/CHANGELOG.md +++ b/uefi/CHANGELOG.md @@ -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 diff --git a/uefi/src/boot.rs b/uefi/src/boot.rs index a06e84cab..97f439bf7 100644 --- a/uefi/src/boot.rs +++ b/uefi/src/boot.rs @@ -1536,6 +1536,14 @@ pub struct ScopedProtocol { open_params: OpenProtocolParams, } +impl ScopedProtocol

{ + /// Returns the [`OpenProtocolParams`] used to open the [`ScopedProtocol`]. + #[must_use] + pub const fn open_params(&self) -> OpenProtocolParams { + self.open_params + } +} + impl Drop for ScopedProtocol

{ fn drop(&mut self) { let bt = boot_services_raw_panicking(); @@ -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(); @@ -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,