27 #include <sys/cdefs.h>
30 #include <sys/param.h>
31 #include <sys/kernel.h>
33 #include <sys/mutex.h>
35 #include <sys/syscallsubr.h>
36 #include <sys/sysent.h>
37 #include <sys/systm.h>
38 #include <sys/sysproto.h>
39 #include <sys/signalvar.h>
40 #include <sys/ucontext.h>
47 #define UC_COPY_SIZE offsetof(ucontext_t, uc_link)
49 #ifndef _SYS_SYSPROTO_H_
51 struct __ucontext *
ucp;
53 struct setcontext_args {
54 const struct __ucontext_t *
ucp;
58 const struct __ucontext_t *
ucp;
71 get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
72 PROC_LOCK(td->td_proc);
73 uc.uc_sigmask = td->td_sigmask;
74 PROC_UNLOCK(td->td_proc);
75 bzero(uc.__spare__,
sizeof(uc.__spare__));
92 ret = set_mcontext(td, &uc.uc_mcontext);
99 return (ret == 0 ? EJUSTRETURN : ret);
108 if (uap->
oucp == NULL || uap->
ucp == NULL)
111 get_mcontext(td, &uc.uc_mcontext, GET_MC_CLEAR_RET);
112 bzero(uc.__spare__,
sizeof(uc.__spare__));
113 PROC_LOCK(td->td_proc);
114 uc.uc_sigmask = td->td_sigmask;
115 PROC_UNLOCK(td->td_proc);
120 ret = set_mcontext(td, &uc.uc_mcontext);
123 &uc.uc_sigmask, NULL, 0);
128 return (ret == 0 ? EJUSTRETURN : ret);
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)
struct swapcontext_args sys_getcontext(struct thread *td, struct getcontext_args *uap)
int sys_setcontext(struct thread *td, struct setcontext_args *uap)
struct getcontext_args * ucp
const struct __ucontext_t * ucp