File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ pub mod context {
103103}
104104
105105pub use axcpu:: asm;
106- pub use axplat:: init:: { init_early , init_later} ;
106+ pub use axplat:: init:: init_later;
107107
108108#[ cfg( feature = "smp" ) ]
109109pub use axplat:: init:: { init_early_secondary, init_later_secondary} ;
@@ -124,3 +124,20 @@ pub fn init_percpu(cpu_id: usize) {
124124pub fn init_percpu_secondary ( cpu_id : usize ) {
125125 self :: percpu:: init_secondary ( cpu_id) ;
126126}
127+
128+ use lazyinit:: LazyInit ;
129+
130+ static BOOT_ARG : LazyInit < usize > = LazyInit :: new ( ) ;
131+
132+ /// Initializes the platform and boot argument.
133+ /// This function should be called as early as possible.
134+ pub fn init_early ( cpu_id : usize , arg : usize ) {
135+ BOOT_ARG . init_once ( arg) ;
136+ axplat:: init:: init_early ( cpu_id, arg) ;
137+ }
138+
139+ /// Returns the boot argument.
140+ /// This is typically the device tree blob address passed from the bootloader.
141+ pub fn get_bootarg ( ) -> usize {
142+ * BOOT_ARG
143+ }
You can’t perform that action at this time.
0 commit comments