feature: spawn for closures
This commit is contained in:
@@ -6,6 +6,7 @@ pub const SYS_EX_SIGRETURN: usize = 131;
|
||||
pub const SYS_EX_KILL: usize = 132;
|
||||
pub const SYS_EX_CLONE: usize = 133;
|
||||
pub const SYS_EX_YIELD: usize = 134;
|
||||
pub const SYS_EX_THREAD_EXIT: usize = 135;
|
||||
|
||||
pub const SYS_EXIT: usize = 1;
|
||||
pub const SYS_READ: usize = 2;
|
||||
|
||||
@@ -283,6 +283,14 @@ pub fn sys_ex_clone(entry: usize, stack: usize, arg: usize) -> Result<usize, Err
|
||||
})
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn sys_ex_thread_exit(status: ExitCode) -> ! {
|
||||
unsafe {
|
||||
syscall!(abi::SYS_EX_THREAD_EXIT, argn!(i32::from(status)));
|
||||
}
|
||||
unreachable!();
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn sys_ex_yield() {
|
||||
unsafe {
|
||||
|
||||
Reference in New Issue
Block a user