Skip to content

Commit a54e5cd

Browse files
authored
Merge pull request #1374 from nicholasbishop/bishop-deprecate-boot-types
uefi: Deprecate ancillary types in uefi::table::boot
2 parents 42eb20d + 6b079ab commit a54e5cd

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

uefi/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ how to integrate the `uefi` crate into them.
1313
## Changed
1414
- The `BootServices` and `RuntimeServices` structs have been deprecated. Use
1515
the `uefi::runtime` and `uefi::boot` modules instead.
16+
- In `uefi::table::boot`, `ScopedProtocol`, `TplGuard`, `ProtocolsPerHandle`,
17+
and `HandleBuffer` have been deprecated. Use the structs of the same name in
18+
`uefi::boot` instead.
1619
- **Breaking:** The conversion functions between device paths and text no longer
1720
take a `BootServices` argument. The global system table is used instead.
1821
- **Breaking:** `GraphicsOutput::modes` no longer takes a `BootServices`

uefi/src/fs/file_system/fs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub type FileSystemResult<T> = Result<T, Error>;
1818
/// associated `ScopedProtocol<'a>` structs are removed this inner type can be
1919
/// removed as well.
2020
enum FileSystemInner<'a> {
21+
#[allow(deprecated)]
2122
WithLifetime(uefi::table::boot::ScopedProtocol<'a, SimpleFileSystemProtocol>),
2223
WithoutLifetime(uefi::boot::ScopedProtocol<SimpleFileSystemProtocol>),
2324
}
@@ -454,6 +455,7 @@ impl<'a> Debug for FileSystem<'a> {
454455
}
455456
}
456457

458+
#[allow(deprecated)]
457459
impl<'a> From<uefi::table::boot::ScopedProtocol<'a, SimpleFileSystemProtocol>> for FileSystem<'a> {
458460
fn from(proto: uefi::table::boot::ScopedProtocol<'a, SimpleFileSystemProtocol>) -> Self {
459461
Self(FileSystemInner::WithLifetime(proto))

uefi/src/table/boot.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,7 @@ impl super::Table for BootServices {
13291329
/// RAII guard for task priority level changes
13301330
///
13311331
/// Will automatically restore the former task priority level when dropped.
1332+
#[deprecated = "Use uefi::boot::TplGuard instead. See https://github.com/rust-osdev/uefi-rs/blob/HEAD/docs/funcs_migration.md"]
13321333
#[derive(Debug)]
13331334
pub struct TplGuard<'boot> {
13341335
boot_services: &'boot BootServices,
@@ -1359,6 +1360,7 @@ impl Drop for TplGuard<'_> {
13591360
/// [`LoadedImageDevicePath`]: crate::proto::device_path::LoadedImageDevicePath
13601361
/// [`get`]: ScopedProtocol::get
13611362
/// [`get_mut`]: ScopedProtocol::get_mut
1363+
#[deprecated = "Use uefi::boot::ScopedProtocol instead. See https://github.com/rust-osdev/uefi-rs/blob/HEAD/docs/funcs_migration.md"]
13621364
#[derive(Debug)]
13631365
pub struct ScopedProtocol<'a, P: Protocol + ?Sized> {
13641366
/// The protocol interface.
@@ -1421,6 +1423,7 @@ impl<'a, P: Protocol + ?Sized> ScopedProtocol<'a, P> {
14211423

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

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

0 commit comments

Comments
 (0)