File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,25 @@ pub use header::Header;
11
11
pub use system:: { Boot , Runtime , SystemTable } ;
12
12
pub use uefi_raw:: table:: Revision ;
13
13
14
- use core:: ptr;
14
+ use core:: ptr:: { self , NonNull } ;
15
15
use core:: sync:: atomic:: { AtomicPtr , Ordering } ;
16
16
17
17
/// Global system table pointer. This is only modified by [`set_system_table`].
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. This may only be called after
22
+ /// `set_system_table` has been used to set the global pointer.
23
+ ///
24
+ /// # Panics
25
+ ///
26
+ /// Panics if the global system table pointer is null.
27
+ #[ track_caller]
28
+ 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" )
31
+ }
32
+
21
33
/// Update the global system table pointer.
22
34
///
23
35
/// This is called automatically in the `main` entry point as part of
You can’t perform that action at this time.
0 commit comments