mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-24 09:40:52 +00:00
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>
26 lines
425 B
Rust
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() };
|
|
}
|