mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-13 07:48:30 +00:00
xous: wire up wait_thread for baremetal
Now that we have a `JoinThread`, connect the `wait_thread` syscall. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
714aff830c
commit
ca53abbd25
1 changed files with 12 additions and 5 deletions
|
|
@ -70,7 +70,10 @@ pub struct ProcessInit {
|
|||
pub key: ProcessKey,
|
||||
}
|
||||
|
||||
pub struct WaitHandle<T>(core::marker::PhantomData<T>);
|
||||
pub struct WaitHandle<T> {
|
||||
tid: TID,
|
||||
data: core::marker::PhantomData<T>,
|
||||
}
|
||||
pub struct ProcessHandle(());
|
||||
|
||||
pub fn thread_to_args(syscall: usize, init: &ThreadInit) -> [usize; 8] {
|
||||
|
|
@ -130,8 +133,9 @@ where
|
|||
todo!()
|
||||
}
|
||||
|
||||
pub fn wait_thread<T>(_joiner: WaitHandle<T>) -> crate::SysCallResult {
|
||||
todo!()
|
||||
pub fn wait_thread<T>(joiner: WaitHandle<T>) -> crate::SysCallResult {
|
||||
let call = crate::SysCall::JoinThread(joiner.tid);
|
||||
crate::syscall::rsyscall(call)
|
||||
}
|
||||
|
||||
pub fn process_to_args(call: usize, init: &ProcessInit) -> [usize; 8] {
|
||||
|
|
@ -359,12 +363,15 @@ pub fn create_thread_n_post<U>(
|
|||
_arg2: usize,
|
||||
_arg3: usize,
|
||||
_arg4: usize,
|
||||
_thread_id: TID,
|
||||
thread_id: TID,
|
||||
) -> core::result::Result<WaitHandle<U>, crate::Error>
|
||||
where
|
||||
U: Send + 'static,
|
||||
{
|
||||
Ok(WaitHandle(core::marker::PhantomData))
|
||||
Ok(WaitHandle {
|
||||
tid: thread_id,
|
||||
data: core::marker::PhantomData,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn wait_process(_joiner: ProcessHandle) -> crate::SysCallResult {
|
||||
|
|
|
|||
Loading…
Reference in a new issue