mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
relocate top of kernel memory to save two pages for suspend/resume
This commit is contained in:
parent
d62f936454
commit
36429de62f
2 changed files with 7 additions and 0 deletions
|
|
@ -10,6 +10,10 @@ _start:
|
||||||
lw t0, 16(a0) // SRAM start
|
lw t0, 16(a0) // SRAM start
|
||||||
lw t1, 20(a0) // SRAM length
|
lw t1, 20(a0) // SRAM length
|
||||||
add sp, t0, t1
|
add sp, t0, t1
|
||||||
|
// kernel RAM is two pages lower than the absolute end.
|
||||||
|
// add two pages to the sp so we are at the loader's private stack area
|
||||||
|
li t0, 0x2000
|
||||||
|
add sp, sp, t0
|
||||||
|
|
||||||
// Install a machine mode trap handler
|
// Install a machine mode trap handler
|
||||||
la t0, abort
|
la t0, abort
|
||||||
|
|
|
||||||
|
|
@ -207,6 +207,9 @@ fn main() {
|
||||||
csr_to_config(tools::utils::CsrConfig { regions: map }, &mut ram_config);
|
csr_to_config(tools::utils::CsrConfig { regions: map }, &mut ram_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reserve top two pages for bootloader stack, and for the "clean suspend" page
|
||||||
|
ram_config.size -= 4096 * 2;
|
||||||
|
|
||||||
let mut args = XousArguments::new(ram_config.offset, ram_config.size, ram_config.name);
|
let mut args = XousArguments::new(ram_config.offset, ram_config.size, ram_config.name);
|
||||||
|
|
||||||
if !ram_config.regions.is_empty() {
|
if !ram_config.regions.is_empty() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue