Skip to content

Commit 4bac750

Browse files
committed
fix: static var
1 parent 9a826e2 commit 4bac750

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

platforms/axplat-aarch64-dyn/src/init.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ impl InitIf for InitIfImpl {
3232
/// * Current monotonic time and wall time can be obtained.
3333
fn init_early(cpu_id: usize, arg: usize) {
3434
axcpu::init::init_trap();
35+
crate::mem::setup();
3536
console::setup_early();
3637
}
3738

platforms/axplat-aarch64-dyn/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ mod config {
1818
axconfig_macros::include_configs!(path_env = "AX_CONFIG_PATH", fallback = "axconfig.toml");
1919
}
2020

21+
// Use `.data` section to prevent being cleaned by `clean_bss`.
22+
#[unsafe(link_section = ".data")]
2123
static BOOT_INFO: Once<BootInfo> = Once::new();
2224

2325
#[pie_boot::entry]
2426
fn main(args: &BootInfo) -> ! {
2527
BOOT_INFO.call_once(move || args.clone());
2628

27-
mem::setup();
28-
2929
axplat::call_main(
3030
args.cpu_id,
3131
args.fdt.map(|p| p.as_ptr() as usize).unwrap_or_default(),

0 commit comments

Comments
 (0)