File tree 2 files changed +11
-2
lines changed
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.
10
10
boot services using the global system table.
11
11
- ` uefi::runtime ` is a new module that provides freestanding functions for
12
12
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.
13
15
- Add standard derives for ` ConfigTableEntry ` .
14
16
- ` PcrEvent ` /` PcrEventInputs ` impl ` Align ` , ` Eq ` , and ` PartialEq ` .
15
17
- 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};
18
18
static SYSTEM_TABLE : AtomicPtr < uefi_raw:: table:: system:: SystemTable > =
19
19
AtomicPtr :: new ( ptr:: null_mut ( ) ) ;
20
20
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
+
21
29
/// Get the raw system table pointer. This may only be called after
22
30
/// `set_system_table` has been used to set the global pointer.
23
31
///
@@ -26,8 +34,7 @@ static SYSTEM_TABLE: AtomicPtr<uefi_raw::table::system::SystemTable> =
26
34
/// Panics if the global system table pointer is null.
27
35
#[ track_caller]
28
36
pub ( 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" )
31
38
}
32
39
33
40
/// Update the global system table pointer.
You can’t perform that action at this time.
0 commit comments