33#include <sys/kernel.h>
37#include <sys/syscallsubr.h>
38#include <sys/sysent.h>
40#include <sys/sysproto.h>
41#include <sys/signalvar.h>
42#include <sys/ucontext.h>
49#define UC_COPY_SIZE offsetof(ucontext_t, uc_link)
51#ifndef _SYS_SYSPROTO_H_
53 struct __ucontext *
ucp;
55struct setcontext_args {
56 const struct __ucontext_t *
ucp;
60 const struct __ucontext_t *
ucp;
73 bzero(&uc,
sizeof(ucontext_t));
74 get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
75 PROC_LOCK(td->td_proc);
76 uc.uc_sigmask = td->td_sigmask;
77 PROC_UNLOCK(td->td_proc);
94 ret = set_mcontext(td, &uc.uc_mcontext);
101 return (ret == 0 ? EJUSTRETURN : ret);
110 if (uap->
oucp == NULL || uap->
ucp == NULL)
113 bzero(&uc,
sizeof(ucontext_t));
114 get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
115 PROC_LOCK(td->td_proc);
116 uc.uc_sigmask = td->td_sigmask;
117 PROC_UNLOCK(td->td_proc);
122 ret = set_mcontext(td, &uc.uc_mcontext);
125 &uc.uc_sigmask, NULL, 0);
130 return (ret == 0 ? EJUSTRETURN : ret);
int sys_setcontext(struct thread *td, struct setcontext_args *uap)
struct swapcontext_args sys_getcontext(struct thread *td, struct getcontext_args *uap)
struct getcontext_args * ucp
int sys_swapcontext(struct thread *td, struct swapcontext_args *uap)
int kern_sigprocmask(struct thread *td, int how, sigset_t *set, sigset_t *oset, int flags)
const struct __ucontext_t * ucp