Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert statics clearing routine #590

Merged
merged 1 commit into from
Oct 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions loader/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@ pub extern "C" fn _start(_kernel_args: usize, loader_sig: usize) {
unsafe {
#[rustfmt::skip]
asm! (
"mv t0, {ram_base}",
"li t1, 0x10000",
"add t2, t0, t1",

"900:", // clear 64k base data for statics
"sw x0, 0(t0)",
"addi t0, t0, 4",
"bltu t0, t2, 900b",
"li t0, 0xffffffff",
"csrw mideleg, t0",
"csrw medeleg, t0",

// decorate our stack area with a canary pattern
"li t1, 0xACE0BACE",
Expand All @@ -38,10 +33,6 @@ pub extern "C" fn _start(_kernel_args: usize, loader_sig: usize) {
// subtract four from sp to make room for a DMA "gutter"
"addi sp, sp, -4",

"li t0, 0xffffffff",
"csrw mideleg, t0",
"csrw medeleg, t0",

// Install a machine mode trap handler
"la t0, abort",
"csrw mtvec, t0",
Expand All @@ -57,7 +48,6 @@ pub extern "C" fn _start(_kernel_args: usize, loader_sig: usize) {
ram_top = in(reg) (platform::RAM_BASE + platform::RAM_SIZE),
// On Precursor - 0x40FFE01C: currently allowed stack extent - 8k - (7 words). 7 words are for kernel backup args - see bootloader in betrusted-soc
stack_limit = in(reg) (platform::RAM_BASE + platform::RAM_SIZE - 8192 + 7 * core::mem::size_of::<usize>()),
ram_base = in(reg) (platform::RAM_BASE),
options(noreturn)
);
}
Expand Down