make swap resume-compatible

This commit is contained in:
bunnie 2024-05-12 21:51:14 +08:00
parent 6bef111bf2
commit 9101abf2c4
2 changed files with 4 additions and 5 deletions

View file

@ -16,6 +16,7 @@ log-server = { package = "xous-api-log", version = "0.1.56" }
xous = "0.9.60"
xous-ipc = "0.9.60"
log = "0.4.14"
loader = { path = "../../loader", default-features = false }
num-derive = { version = "0.3.3", default-features = false }
num-traits = { version = "0.2.14", default-features = false }
@ -30,7 +31,7 @@ utralib = { version = "0.1.24", optional = true, default-features = false }
precursor = ["utralib/precursor"]
hosted = ["utralib/hosted"]
renode = ["utralib/renode"]
swap = []
swap = ["loader/swap"]
sus_reboot = [
] # when selected, suspend triggers an immediate reboot instead of suspend. For testing only.
debugprint = []

View file

@ -146,9 +146,7 @@ mod implementation {
// note that mapping a page zeroes it out. Plus, this should have been zero'd by the bootloader.
#[cfg(not(feature = "swap"))]
let marker = xous::syscall::map_memory(
xous::MemoryAddress::new(0x4100_0000 - 0x3000), /* this is a special, hard-coded location;
* 0x2000 is the size of the bootloader's
* stack area */
xous::MemoryAddress::new(0x4100_0000 - loader::GUARD_MEMORY_BYTES), // TODO: fix hard-coding of top of RAM
None,
4096,
xous::MemoryFlags::R | xous::MemoryFlags::W,
@ -156,7 +154,7 @@ mod implementation {
.expect("couldn't map clean suspend page");
#[cfg(feature = "swap")]
let marker = xous::syscall::map_memory(
None, // map a dummy page -- we need this process for the preemption timer
xous::MemoryAddress::new(0x4080_0000 - loader::GUARD_MEMORY_BYTES), // TODO: fix hard-coding of top of RAM
None,
4096,
xous::MemoryFlags::R | xous::MemoryFlags::W,