Skip to content

Commit

Permalink
uefi: Deprecate table::{system_table_boot,system_table_runtime}
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasbishop committed Aug 27, 2024
1 parent a54e5cd commit 682eaf5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions uefi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ how to integrate the `uefi` crate into them.
- In `uefi::table::boot`, `ScopedProtocol`, `TplGuard`, `ProtocolsPerHandle`,
and `HandleBuffer` have been deprecated. Use the structs of the same name in
`uefi::boot` instead.
- `uefi::table::system_table_boot` and `uefi::table::system_table_runtime` have
been deprecated. Use the `uefi::runtime` and `uefi::boot` modules 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
1 change: 1 addition & 0 deletions uefi/src/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ mod println;
#[must_use]
#[deprecated(note = "use uefi::table::system_table_boot instead")]
pub fn system_table() -> SystemTable<Boot> {
#[allow(deprecated)]
table::system_table_boot().expect("boot services are not active")
}

Expand Down
2 changes: 2 additions & 0 deletions uefi/src/table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub unsafe fn set_system_table(ptr: *const uefi_raw::table::system::SystemTable)
}

/// Get the system table while boot services are active.
#[deprecated = "Use the uefi::boot module instead. See https://github.com/rust-osdev/uefi-rs/blob/HEAD/docs/funcs_migration.md"]
pub fn system_table_boot() -> Option<SystemTable<Boot>> {
let st = SYSTEM_TABLE.load(Ordering::Acquire);
if st.is_null() {
Expand All @@ -77,6 +78,7 @@ pub fn system_table_boot() -> Option<SystemTable<Boot>> {
}

/// Get the system table while runtime services are active.
#[deprecated = "Use the uefi::runtime module instead. See https://github.com/rust-osdev/uefi-rs/blob/HEAD/docs/funcs_migration.md"]
pub fn system_table_runtime() -> Option<SystemTable<Runtime>> {
let st = SYSTEM_TABLE.load(Ordering::Acquire);
if st.is_null() {
Expand Down

0 comments on commit 682eaf5

Please sign in to comment.