mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
reserve ifram locs for swap and/or app uart
This commit is contained in:
parent
a6a3d29836
commit
f85f1a07f3
2 changed files with 12 additions and 4 deletions
|
|
@ -32,6 +32,7 @@ rkyv = { version = "0.4.3", default-features = false, features = [
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
app-uart = []
|
app-uart = []
|
||||||
|
swap = []
|
||||||
# add this feature to enable pre-emption
|
# add this feature to enable pre-emption
|
||||||
quantum-timer = ["utralib"]
|
quantum-timer = ["utralib"]
|
||||||
default = ["quantum-timer", "app-uart"]
|
default = ["quantum-timer", "app-uart"]
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,9 @@ use cramium_hal::{
|
||||||
use utralib::utra;
|
use utralib::utra;
|
||||||
#[cfg(feature = "quantum-timer")]
|
#[cfg(feature = "quantum-timer")]
|
||||||
use utralib::*;
|
use utralib::*;
|
||||||
use xous::{sender::Sender, SWAPPER_PID};
|
use xous::sender::Sender;
|
||||||
|
#[cfg(feature = "swap")]
|
||||||
|
use xous::SWAPPER_PID;
|
||||||
use xous_pio::*;
|
use xous_pio::*;
|
||||||
|
|
||||||
struct PreemptionHw {
|
struct PreemptionHw {
|
||||||
|
|
@ -104,9 +106,14 @@ fn main() {
|
||||||
ifram_allocs[0][31] = Some(Sender::from_usize(usize::MAX));
|
ifram_allocs[0][31] = Some(Sender::from_usize(usize::MAX));
|
||||||
// Second page from top of IFRAM0 is occupied by the swap handler. This was allocated
|
// Second page from top of IFRAM0 is occupied by the swap handler. This was allocated
|
||||||
// by the loader, before the kernel even started.
|
// by the loader, before the kernel even started.
|
||||||
ifram_allocs[0][30] = Some(Sender::from_usize(SWAPPER_PID as usize));
|
#[cfg(feature = "swap")]
|
||||||
#[cfg(feature="app-uart")]
|
{
|
||||||
ifram_allocs[0][29] = Some(Sender::from_usize(SWAPPER_PID as usize)); // currently allocated to swapper for debug
|
ifram_allocs[0][30] = Some(Sender::from_usize(SWAPPER_PID as usize));
|
||||||
|
}
|
||||||
|
#[cfg(feature = "app-uart")]
|
||||||
|
{
|
||||||
|
ifram_allocs[0][29] = Some(Sender::from_usize(usize::MAX));
|
||||||
|
}
|
||||||
|
|
||||||
let iox_page = xous::syscall::map_memory(
|
let iox_page = xous::syscall::map_memory(
|
||||||
xous::MemoryAddress::new(utralib::generated::HW_IOX_BASE),
|
xous::MemoryAddress::new(utralib::generated::HW_IOX_BASE),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue