kernel: implement GetThreadID and GetProcessID

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2021-03-11 11:20:35 +08:00
parent 530e105fe4
commit cf1e2435bc
2 changed files with 7 additions and 1 deletions

2
kernel/Cargo.lock generated
View file

@ -574,7 +574,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "xous"
version = "0.1.0"
version = "0.1.2"
dependencies = [
"bitflags",
"hex",

View file

@ -792,6 +792,12 @@ pub fn handle_inner(pid: PID, tid: TID, in_irq: bool, call: SysCall) -> SysCallR
SysCall::Shutdown => {
SystemServices::with_mut(|ss| ss.shutdown().map(|_| xous_kernel::Result::Ok))
}
SysCall::GetProcessId => {
Ok(xous_kernel::Result::ProcessID(pid))
}
SysCall::GetThreadId => {
Ok(xous_kernel::Result::ThreadID(tid))
}
SysCall::Connect(sid) => {
let result = SystemServices::with_mut(|ss| {