From c3415adc4c3fcd6608d442e7aac5df8d710f2b22 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 25 Aug 2024 20:42:21 -0400 Subject: [PATCH] uefi: Deprecate RuntimeServices --- uefi-test-runner/src/main.rs | 3 +++ uefi/src/prelude.rs | 1 + uefi/src/table/runtime.rs | 3 +++ uefi/src/table/system.rs | 2 ++ 4 files changed, 9 insertions(+) diff --git a/uefi-test-runner/src/main.rs b/uefi-test-runner/src/main.rs index 569b36e91..d6af3b28a 100644 --- a/uefi-test-runner/src/main.rs +++ b/uefi-test-runner/src/main.rs @@ -1,5 +1,8 @@ #![no_std] #![no_main] +// TODO: temporarily allow deprecated code so that we can continue to test +// SystemTable/BootServices/RuntimeServices. +#![allow(deprecated)] #[macro_use] extern crate log; diff --git a/uefi/src/prelude.rs b/uefi/src/prelude.rs index f32f9903c..a4ec0e55f 100644 --- a/uefi/src/prelude.rs +++ b/uefi/src/prelude.rs @@ -6,5 +6,6 @@ pub use crate::{cstr16, cstr8, entry, Handle, ResultExt, Status, StatusExt}; // Import the basic table types. pub use crate::table::boot::BootServices; +#[allow(deprecated)] pub use crate::table::runtime::RuntimeServices; pub use crate::table::{Boot, SystemTable}; diff --git a/uefi/src/table/runtime.rs b/uefi/src/table/runtime.rs index 5b14808a3..2c9d4d22a 100644 --- a/uefi/src/table/runtime.rs +++ b/uefi/src/table/runtime.rs @@ -1,5 +1,7 @@ //! UEFI services available at runtime, even after the OS boots. +#![allow(deprecated)] + pub use crate::runtime::{ CapsuleInfo, Time, TimeByteConversionError, TimeError, TimeParams, VariableStorageInfo, }; @@ -35,6 +37,7 @@ use { /// A reference to `RuntimeServices` can only be accessed by calling [`SystemTable::runtime_services`]. /// /// [`SystemTable::runtime_services`]: crate::table::SystemTable::runtime_services +#[deprecated = "Use the uefi::runtime module instead. See https://github.com/rust-osdev/uefi-rs/blob/HEAD/docs/funcs_migration.md"] #[derive(Debug)] #[repr(C)] pub struct RuntimeServices(uefi_raw::table::runtime::RuntimeServices); diff --git a/uefi/src/table/system.rs b/uefi/src/table/system.rs index afdf242f2..53eb4cd58 100644 --- a/uefi/src/table/system.rs +++ b/uefi/src/table/system.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use super::boot::BootServices; use super::runtime::{ResetType, RuntimeServices}; use super::{cfg, Revision};