mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
make the swapper register immediately
this means we miss fewer advisories at boot
This commit is contained in:
parent
ed5dd7e538
commit
10c4ab80c8
1 changed files with 7 additions and 7 deletions
|
|
@ -158,21 +158,14 @@ fn swap_handler(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// init the log, but this is mostly unused.
|
|
||||||
log_server::init_wait().unwrap();
|
|
||||||
log::set_max_level(log::LevelFilter::Info);
|
|
||||||
log::info!("my PID is {}", xous::process::id());
|
|
||||||
|
|
||||||
// swapper is not allowed to use `log` for debugging under most circumstances, because
|
// swapper is not allowed to use `log` for debugging under most circumstances, because
|
||||||
// the swapper can't send messages when handling a swap call. Instead, we use a local
|
// the swapper can't send messages when handling a swap call. Instead, we use a local
|
||||||
// debug UART to handle this. This needs to be enabled with the "debug-print" feature
|
// debug UART to handle this. This needs to be enabled with the "debug-print" feature
|
||||||
// and is mutually exclusive with the "gdb-stub" feature in the kernel since it uses
|
// and is mutually exclusive with the "gdb-stub" feature in the kernel since it uses
|
||||||
// the same physical hardware.
|
// the same physical hardware.
|
||||||
let mut ss = SwapperSharedState::new();
|
let mut ss = SwapperSharedState::new();
|
||||||
write!(ss.duart, "Swapper started.\n\r").ok();
|
|
||||||
|
|
||||||
let sid = xous::create_server().unwrap();
|
let sid = xous::create_server().unwrap();
|
||||||
|
|
||||||
// Register the swapper with the kernel. Written as a raw syscall, since this is
|
// Register the swapper with the kernel. Written as a raw syscall, since this is
|
||||||
// the only instance of its use (no point in use-once code to wrap it).
|
// the only instance of its use (no point in use-once code to wrap it).
|
||||||
let (s0, s1, s2, s3) = sid.to_u32();
|
let (s0, s1, s2, s3) = sid.to_u32();
|
||||||
|
|
@ -208,6 +201,13 @@ fn main() {
|
||||||
// correctly
|
// correctly
|
||||||
let rpt = unsafe { &mut *(rpt_init as *mut RuntimePageTracker) };
|
let rpt = unsafe { &mut *(rpt_init as *mut RuntimePageTracker) };
|
||||||
|
|
||||||
|
// init the log, but this is mostly unused.
|
||||||
|
log_server::init_wait().unwrap();
|
||||||
|
log::set_max_level(log::LevelFilter::Info);
|
||||||
|
log::info!("my PID is {}", xous::process::id());
|
||||||
|
// test the debug serial port
|
||||||
|
write!(ss.duart, "Swapper started.\n\r").ok();
|
||||||
|
|
||||||
let mut msg_opt = None;
|
let mut msg_opt = None;
|
||||||
loop {
|
loop {
|
||||||
xous::reply_and_receive_next(sid, &mut msg_opt).unwrap();
|
xous::reply_and_receive_next(sid, &mut msg_opt).unwrap();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue