mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
Merge pull request #590 from betrusted-io/fix-test
revert statics clearing routine
This commit is contained in:
commit
df44d62b1f
1 changed files with 3 additions and 13 deletions
|
|
@ -15,14 +15,9 @@ pub extern "C" fn _start(_kernel_args: usize, loader_sig: usize) {
|
||||||
unsafe {
|
unsafe {
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
asm! (
|
asm! (
|
||||||
"mv t0, {ram_base}",
|
"li t0, 0xffffffff",
|
||||||
"li t1, 0x10000",
|
"csrw mideleg, t0",
|
||||||
"add t2, t0, t1",
|
"csrw medeleg, t0",
|
||||||
|
|
||||||
"900:", // clear 64k base data for statics
|
|
||||||
"sw x0, 0(t0)",
|
|
||||||
"addi t0, t0, 4",
|
|
||||||
"bltu t0, t2, 900b",
|
|
||||||
|
|
||||||
// decorate our stack area with a canary pattern
|
// decorate our stack area with a canary pattern
|
||||||
"li t1, 0xACE0BACE",
|
"li t1, 0xACE0BACE",
|
||||||
|
|
@ -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"
|
// subtract four from sp to make room for a DMA "gutter"
|
||||||
"addi sp, sp, -4",
|
"addi sp, sp, -4",
|
||||||
|
|
||||||
"li t0, 0xffffffff",
|
|
||||||
"csrw mideleg, t0",
|
|
||||||
"csrw medeleg, t0",
|
|
||||||
|
|
||||||
// Install a machine mode trap handler
|
// Install a machine mode trap handler
|
||||||
"la t0, abort",
|
"la t0, abort",
|
||||||
"csrw mtvec, t0",
|
"csrw mtvec, t0",
|
||||||
|
|
@ -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),
|
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
|
// 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>()),
|
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)
|
options(noreturn)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue