Skip to content

Commit

Permalink
Merge pull request #1374 from nicholasbishop/bishop-deprecate-boot-types
Browse files Browse the repository at this point in the history
uefi: Deprecate ancillary types in uefi::table::boot
  • Loading branch information
phip1611 authored Aug 27, 2024
2 parents 42eb20d + 6b079ab commit a54e5cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions uefi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ how to integrate the `uefi` crate into them.
## Changed
- The `BootServices` and `RuntimeServices` structs have been deprecated. Use
the `uefi::runtime` and `uefi::boot` modules instead.
- In `uefi::table::boot`, `ScopedProtocol`, `TplGuard`, `ProtocolsPerHandle`,
and `HandleBuffer` have been deprecated. Use the structs of the same name in
`uefi::boot` instead.
- **Breaking:** The conversion functions between device paths and text no longer
take a `BootServices` argument. The global system table is used instead.
- **Breaking:** `GraphicsOutput::modes` no longer takes a `BootServices`
Expand Down
2 changes: 2 additions & 0 deletions uefi/src/fs/file_system/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub type FileSystemResult<T> = Result<T, Error>;
/// associated `ScopedProtocol<'a>` structs are removed this inner type can be
/// removed as well.
enum FileSystemInner<'a> {
#[allow(deprecated)]
WithLifetime(uefi::table::boot::ScopedProtocol<'a, SimpleFileSystemProtocol>),
WithoutLifetime(uefi::boot::ScopedProtocol<SimpleFileSystemProtocol>),
}
Expand Down Expand Up @@ -454,6 +455,7 @@ impl<'a> Debug for FileSystem<'a> {
}
}

#[allow(deprecated)]
impl<'a> From<uefi::table::boot::ScopedProtocol<'a, SimpleFileSystemProtocol>> for FileSystem<'a> {
fn from(proto: uefi::table::boot::ScopedProtocol<'a, SimpleFileSystemProtocol>) -> Self {
Self(FileSystemInner::WithLifetime(proto))
Expand Down
4 changes: 4 additions & 0 deletions uefi/src/table/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,7 @@ impl super::Table for BootServices {
/// RAII guard for task priority level changes
///
/// Will automatically restore the former task priority level when dropped.
#[deprecated = "Use uefi::boot::TplGuard instead. See https://github.com/rust-osdev/uefi-rs/blob/HEAD/docs/funcs_migration.md"]
#[derive(Debug)]
pub struct TplGuard<'boot> {
boot_services: &'boot BootServices,
Expand Down Expand Up @@ -1359,6 +1360,7 @@ impl Drop for TplGuard<'_> {
/// [`LoadedImageDevicePath`]: crate::proto::device_path::LoadedImageDevicePath
/// [`get`]: ScopedProtocol::get
/// [`get_mut`]: ScopedProtocol::get_mut
#[deprecated = "Use uefi::boot::ScopedProtocol instead. See https://github.com/rust-osdev/uefi-rs/blob/HEAD/docs/funcs_migration.md"]
#[derive(Debug)]
pub struct ScopedProtocol<'a, P: Protocol + ?Sized> {
/// The protocol interface.
Expand Down Expand Up @@ -1421,6 +1423,7 @@ impl<'a, P: Protocol + ?Sized> ScopedProtocol<'a, P> {

/// Protocol interface [`Guids`][Guid] that are installed on a [`Handle`] as
/// returned by [`BootServices::protocols_per_handle`].
#[deprecated = "Use uefi::boot::ProtocolsPerHandle instead. See https://github.com/rust-osdev/uefi-rs/blob/HEAD/docs/funcs_migration.md"]
#[derive(Debug)]
pub struct ProtocolsPerHandle<'a> {
// The pointer returned by `protocols_per_handle` has to be free'd with
Expand Down Expand Up @@ -1461,6 +1464,7 @@ impl<'a> ProtocolsPerHandle<'a> {

/// A buffer that contains an array of [`Handles`][Handle] that support the
/// requested protocol. Returned by [`BootServices::locate_handle_buffer`].
#[deprecated = "Use uefi::boot::HandleBuffer instead. See https://github.com/rust-osdev/uefi-rs/blob/HEAD/docs/funcs_migration.md"]
#[derive(Debug)]
pub struct HandleBuffer<'a> {
// The pointer returned by `locate_handle_buffer` has to be freed with
Expand Down

0 comments on commit a54e5cd

Please sign in to comment.