diff options
Diffstat (limited to 'sys/kern/kern_kse.c')
-rw-r--r-- | sys/kern/kern_kse.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index 985fce2..f47beec 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -382,6 +382,30 @@ proc_linkup(struct proc *p, struct ksegrp *kg, thread_link(td, kg); } +#ifndef _SYS_SYSPROTO_H_ +struct kse_switchin_args { + const struct __mcontext *mcp; + long val; + long *loc; +}; +#endif + +int +kse_switchin(struct thread *td, struct kse_switchin_args *uap) +{ + mcontext_t mc; + int error; + + error = (uap->mcp == NULL) ? EINVAL : 0; + if (!error) + error = copyin(uap->mcp, &mc, sizeof(mc)); + if (!error) + error = set_mcontext(td, &mc); + if (!error && uap->loc != NULL) + suword(uap->loc, uap->val); + return ((error == 0) ? EJUSTRETURN : error); +} + /* struct kse_thr_interrupt_args { struct kse_thr_mailbox * tmbx; |