mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
allow xous-susres to function with swap enabled
the reason we're doing this is because the pre-emption timer lives in this crate too. We don't (can't!) suspend/resume with swap (yet!) but the pre-emption timer got stuck in susres so it can be directly turned off without message passing/context switching during the suspend and resume ops.
This commit is contained in:
parent
978dd1bf38
commit
87e32687f1
2 changed files with 10 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ utralib = { version = "0.1.24", optional = true, default-features = false }
|
||||||
precursor = ["utralib/precursor"]
|
precursor = ["utralib/precursor"]
|
||||||
hosted = ["utralib/hosted"]
|
hosted = ["utralib/hosted"]
|
||||||
renode = ["utralib/renode"]
|
renode = ["utralib/renode"]
|
||||||
|
swap = []
|
||||||
sus_reboot = [
|
sus_reboot = [
|
||||||
] # when selected, suspend triggers an immediate reboot instead of suspend. For testing only.
|
] # when selected, suspend triggers an immediate reboot instead of suspend. For testing only.
|
||||||
debugprint = []
|
debugprint = []
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,7 @@ mod implementation {
|
||||||
.expect("couldn't map SusRes CSR range");
|
.expect("couldn't map SusRes CSR range");
|
||||||
|
|
||||||
// note that mapping a page zeroes it out. Plus, this should have been zero'd by the bootloader.
|
// 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(
|
let marker = xous::syscall::map_memory(
|
||||||
xous::MemoryAddress::new(0x4100_0000 - 0x3000), /* this is a special, hard-coded location;
|
xous::MemoryAddress::new(0x4100_0000 - 0x3000), /* this is a special, hard-coded location;
|
||||||
* 0x2000 is the size of the bootloader's
|
* 0x2000 is the size of the bootloader's
|
||||||
|
|
@ -153,6 +154,14 @@ mod implementation {
|
||||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||||
)
|
)
|
||||||
.expect("couldn't map clean suspend page");
|
.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
|
||||||
|
None,
|
||||||
|
4096,
|
||||||
|
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||||
|
)
|
||||||
|
.expect("couldn't map clean suspend page");
|
||||||
|
|
||||||
let seed_csr = xous::syscall::map_memory(
|
let seed_csr = xous::syscall::map_memory(
|
||||||
xous::MemoryAddress::new(utra::seed::HW_SEED_BASE),
|
xous::MemoryAddress::new(utra::seed::HW_SEED_BASE),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue