File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,24 @@ 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
+ pub ( crate ) fn system_table_raw ( ) -> NonNull < uefi_raw:: table:: system:: SystemTable > {
28
+ let ptr = SYSTEM_TABLE . load ( Ordering :: Acquire ) ;
29
+ NonNull :: new ( ptr) . expect ( "global system table pointer is not set" )
30
+ }
31
+
21
32
/// Update the global system table pointer.
22
33
///
23
34
/// This is called automatically in the `main` entry point as part of
You can’t perform that action at this time.
0 commit comments