File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ details of a significant change to the API in this release.
1010 boot services using the global system table.
1111- ` uefi::runtime ` is a new module that provides freestanding functions for
1212 runtime services using the global system table.
13+ - ` uefi::table::system_table_raw ` is a new function to retrieve a raw pointer to
14+ the global system table.
1315- Add standard derives for ` ConfigTableEntry ` .
1416- ` PcrEvent ` /` PcrEventInputs ` impl ` Align ` , ` Eq ` , and ` PartialEq ` .
1517- Added ` PcrEvent::new_in_box ` and ` PcrEventInputs::new_in_box ` .
Original file line number Diff line number Diff line change @@ -18,6 +18,14 @@ use core::sync::atomic::{AtomicPtr, Ordering};
1818static SYSTEM_TABLE : AtomicPtr < uefi_raw:: table:: system:: SystemTable > =
1919 AtomicPtr :: new ( ptr:: null_mut ( ) ) ;
2020
21+ /// Get the raw system table pointer.
22+ ///
23+ /// If called before `set_system_table` has been called, this will return `None`.
24+ pub fn system_table_raw ( ) -> Option < NonNull < uefi_raw:: table:: system:: SystemTable > > {
25+ let ptr = SYSTEM_TABLE . load ( Ordering :: Acquire ) ;
26+ NonNull :: new ( ptr)
27+ }
28+
2129/// Get the raw system table pointer. This may only be called after
2230/// `set_system_table` has been used to set the global pointer.
2331///
@@ -26,8 +34,7 @@ static SYSTEM_TABLE: AtomicPtr<uefi_raw::table::system::SystemTable> =
2634/// Panics if the global system table pointer is null.
2735#[ track_caller]
2836pub ( crate ) fn system_table_raw_panicking ( ) -> NonNull < uefi_raw:: table:: system:: SystemTable > {
29- let ptr = SYSTEM_TABLE . load ( Ordering :: Acquire ) ;
30- NonNull :: new ( ptr) . expect ( "global system table pointer is not set" )
37+ system_table_raw ( ) . expect ( "global system table pointer is not set" )
3138}
3239
3340/// Update the global system table pointer.
You can’t perform that action at this time.
0 commit comments