xous-core/kernel/src/arch/riscv.rs
Sean Cross 2786ad697b kernel: get scalar message passing working again
This gets basic scalar message passing working again. With this, the
following operations may be performed:

    * Starting a server
    * Connecting to a server
    * Sending a scalar message

Care must be taken to not overflow a server's queue, particularly if
writers are faster than readers.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-16 16:34:49 +08:00

26 lines
425 B
Rust

use riscv::register::{satp, sie, sstatus};
use xous::PID;
pub mod exception;
pub mod irq;
pub mod mem;
pub mod process;
pub mod syscall;
pub use process::Context;
pub fn current_pid() -> PID {
satp::read().asid() as PID
}
pub fn init() {
unsafe {
sstatus::set_sie();
sie::set_ssoft();
sie::set_sext();
}
}
pub fn idle() {
unsafe { riscv::asm::wfi() };
}