diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/alpha/alpha/machdep.c | 12 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 23 | ||||
-rw-r--r-- | sys/arch/arm/arm/sig_machdep.c | 18 | ||||
-rw-r--r-- | sys/arch/arm64/arm64/sig_machdep.c | 18 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/machdep.c | 9 | ||||
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 7 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/sig_machdep.c | 7 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/machdep.c | 7 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/sendsig.c | 10 | ||||
-rw-r--r-- | sys/arch/sh/sh/sh_machdep.c | 7 | ||||
-rw-r--r-- | sys/arch/socppc/socppc/machdep.c | 7 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/machdep.c | 7 |
12 files changed, 54 insertions, 78 deletions
diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index 8b5646c50cb..c35aadda31d 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.185 2018/05/22 02:13:42 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.186 2018/07/10 04:19:59 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.210 2000/06/01 17:12:38 thorpej Exp $ */ /*- @@ -1380,8 +1380,7 @@ regdump(framep) * Send an interrupt to process. */ void -sendsig(sig_t catcher, int sig, int mask, u_long code, int type, - union sigval val) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct proc *p = curproc; struct sigcontext ksc, *scp; @@ -1390,7 +1389,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, struct sigacts *psp = p->p_p->ps_sigacts; unsigned long oldsp; int fsize, rndfsize, kscsize; - siginfo_t *sip, ksi; + siginfo_t *sip; oldsp = alpha_pal_rdusp(); frame = p->p_md.md_tf; @@ -1398,7 +1397,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, rndfsize = ((fsize + 15) / 16) * 16; kscsize = rndfsize; if (psp->ps_siginfo & sigmask(sig)) { - fsize += sizeof ksi; + fsize += sizeof *ksip; rndfsize = ((fsize + 15) / 16) * 16; } @@ -1440,9 +1439,8 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, memset(ksc.sc_xxx, 0, sizeof ksc.sc_xxx); /* XXX */ if (psp->ps_siginfo & sigmask(sig)) { - initsiginfo(&ksi, sig, code, type, val); sip = (void *)scp + kscsize; - if (copyout((caddr_t)&ksi, (caddr_t)sip, fsize - kscsize) != 0) + if (copyout(ksip, (caddr_t)sip, fsize - kscsize) != 0) goto trash; } else sip = NULL; diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index f97d467cfaa..4453cbe45f5 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.246 2018/06/16 03:30:11 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.247 2018/07/10 04:19:59 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -546,23 +546,19 @@ cpu_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, /* * Send an interrupt to process. * - * Stack is set up to allow sigcode stored - * in u. to call routine, followed by kcall - * to sigreturn routine below. After sigreturn - * resets the signal mask, the stack, and the - * frame pointer, it returns to the user - * specified pc, psl. + * Stack is set up to allow sigcode to call routine, followed by + * syscall to sigreturn routine below. After sigreturn resets the + * signal mask, the stack, and the frame pointer, it returns to the + * user specified pc. */ void -sendsig(sig_t catcher, int sig, int mask, u_long code, int type, - union sigval val) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct proc *p = curproc; struct trapframe *tf = p->p_md.md_regs; struct sigacts *psp = p->p_p->ps_sigacts; struct sigcontext ksc; struct savefpu *sfp = &p->p_addr->u_pcb.pcb_savefpu; - siginfo_t ksi; register_t sp, scp, sip; u_long sss; @@ -615,11 +611,10 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, sip = 0; if (psp->ps_siginfo & sigmask(sig)) { - sip = sp - ((sizeof(ksi) + 15) & ~15); - sss += (sizeof(ksi) + 15) & ~15; + sip = sp - ((sizeof(*ksip) + 15) & ~15); + sss += (sizeof(*ksip) + 15) & ~15; - initsiginfo(&ksi, sig, code, type, val); - if (copyout(&ksi, (void *)sip, sizeof(ksi))) + if (copyout(ksip, (void *)sip, sizeof(*ksip))) sigexit(p, SIGILL); } scp = sp - sss; diff --git a/sys/arch/arm/arm/sig_machdep.c b/sys/arch/arm/arm/sig_machdep.c index 4c7b9789b0e..43e9eabc20f 100644 --- a/sys/arch/arm/arm/sig_machdep.c +++ b/sys/arch/arm/arm/sig_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sig_machdep.c,v 1.17 2018/06/23 22:15:14 kettenis Exp $ */ +/* $OpenBSD: sig_machdep.c,v 1.18 2018/07/10 04:19:59 guenther Exp $ */ /* $NetBSD: sig_machdep.c,v 1.22 2003/10/08 00:28:41 thorpej Exp $ */ /* @@ -69,15 +69,13 @@ process_frame(struct proc *p) /* * Send an interrupt to process. * - * Stack is set up to allow sigcode stored - * in u. to call routine, followed by kcall - * to sigreturn routine below. After sigreturn - * resets the signal mask, the stack, and the - * frame pointer, it returns to the user specified pc. + * Stack is set up to allow sigcode to call routine, followed by + * syscall to sigreturn routine below. After sigreturn resets the + * signal mask, the stack, and the frame pointer, it returns to the + * user specified pc. */ void -sendsig(sig_t catcher, int sig, int returnmask, u_long code, int type, - union sigval val) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct proc *p = curproc; struct pcb *pcb = &p->p_addr->u_pcb; @@ -129,7 +127,7 @@ sendsig(sig_t catcher, int sig, int returnmask, u_long code, int type, frame.sf_sc.sc_spsr = tf->tf_spsr; /* Save signal mask. */ - frame.sf_sc.sc_mask = returnmask; + frame.sf_sc.sc_mask = mask; /* Save FPU registers. */ frame.sf_sc.sc_fpused = pcb->pcb_flags & PCB_FPU; @@ -143,7 +141,7 @@ sendsig(sig_t catcher, int sig, int returnmask, u_long code, int type, if (psp->ps_siginfo & sigmask(sig)) { frame.sf_sip = &fp->sf_si; - initsiginfo(&frame.sf_si, sig, code, type, val); + frame.sf_si = *ksip; } frame.sf_sc.sc_cookie = (long)&fp->sf_sc ^ p->p_p->ps_sigcookie; diff --git a/sys/arch/arm64/arm64/sig_machdep.c b/sys/arch/arm64/arm64/sig_machdep.c index dcd0e38c0d6..016afc06832 100644 --- a/sys/arch/arm64/arm64/sig_machdep.c +++ b/sys/arch/arm64/arm64/sig_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sig_machdep.c,v 1.5 2018/04/12 17:13:43 deraadt Exp $ */ +/* $OpenBSD: sig_machdep.c,v 1.6 2018/07/10 04:19:59 guenther Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -89,15 +89,13 @@ process_frame(struct proc *p) /* * Send an interrupt to process. * - * Stack is set up to allow sigcode stored - * in u. to call routine, followed by kcall - * to sigreturn routine below. After sigreturn - * resets the signal mask, the stack, and the - * frame pointer, it returns to the user specified pc. + * Stack is set up to allow sigcode to call routine, followed by + * syscall to sigreturn routine below. After sigreturn resets the + * signal mask, the stack, and the frame pointer, it returns to the + * user specified pc. */ void -sendsig(sig_t catcher, int sig, int returnmask, u_long code, int type, - union sigval val) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct proc *p = curproc; struct trapframe *tf; @@ -135,13 +133,13 @@ sendsig(sig_t catcher, int sig, int returnmask, u_long code, int type, frame.sf_sc.sc_spsr = tf->tf_spsr; /* Save signal mask. */ - frame.sf_sc.sc_mask = returnmask; + frame.sf_sc.sc_mask = mask; /* XXX Save floating point context */ if (psp->ps_siginfo & sigmask(sig)) { sip = &fp->sf_si; - initsiginfo(&frame.sf_si, sig, code, type, val); + frame.sf_si = *ksip; } frame.sf_sc.sc_cookie = (long)&fp->sf_sc ^ p->p_p->ps_sigcookie; diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index d8ba7b65f8b..1a3b3bd35d2 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.252 2018/05/22 02:13:42 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.253 2018/07/10 04:19:59 guenther Exp $ */ /* * Copyright (c) 1999-2003 Michael Shalayeff @@ -1198,15 +1198,13 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, * Send an interrupt to process. */ void -sendsig(sig_t catcher, int sig, int mask, u_long code, int type, - union sigval val) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct proc *p = curproc; struct trapframe *tf = p->p_md.md_regs; struct pcb *pcb = &p->p_addr->u_pcb; struct sigacts *psp = p->p_p->ps_sigacts; struct sigcontext ksc; - siginfo_t ksi; register_t scp, sip; int sss; @@ -1288,8 +1286,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, sigexit(p, SIGILL); if (sip) { - initsiginfo(&ksi, sig, code, type, val); - if (copyout(&ksi, (void *)sip, sizeof(ksi))) + if (copyout(ksip, (void *)sip, sizeof *ksip)) sigexit(p, SIGILL); } } diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 36693bc45d3..350c7d65ed6 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.619 2018/07/09 19:20:29 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.620 2018/07/10 04:19:59 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -2381,8 +2381,7 @@ pentium_cpuspeed(int *freq) * specified pc, psl. */ void -sendsig(sig_t catcher, int sig, int mask, u_long code, int type, - union sigval val) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct proc *p = curproc; struct trapframe *tf = p->p_md.md_regs; @@ -2449,7 +2448,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, if (psp->ps_siginfo & sigmask(sig)) { frame.sf_sip = &fp->sf_si; - initsiginfo(&frame.sf_si, sig, code, type, val); + frame.sf_si = *ksip; } /* XXX don't copyout siginfo if not needed? */ diff --git a/sys/arch/m88k/m88k/sig_machdep.c b/sys/arch/m88k/m88k/sig_machdep.c index 7b9766ab7b5..579ac281b31 100644 --- a/sys/arch/m88k/m88k/sig_machdep.c +++ b/sys/arch/m88k/m88k/sig_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sig_machdep.c,v 1.28 2018/04/12 17:13:43 deraadt Exp $ */ +/* $OpenBSD: sig_machdep.c,v 1.29 2018/07/10 04:19:59 guenther Exp $ */ /* * Copyright (c) 2014 Miodrag Vallat. * @@ -104,8 +104,7 @@ pid_t sigpid = 0; * Send an interrupt to process. */ void -sendsig(sig_t catcher, int sig, int mask, unsigned long code, int type, - union sigval val) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct proc *p = curproc; struct trapframe *tf; @@ -144,7 +143,7 @@ sendsig(sig_t catcher, int sig, int mask, unsigned long code, int type, sf.sf_sc.sc_cookie = (long)sf.sf_scp ^ p->p_p->ps_sigcookie; if (psp->ps_siginfo & sigmask(sig)) - initsiginfo(&sf.sf_si, sig, code, type, val); + sf.sf_si = *ksip; /* * Copy the whole user context into signal context that we diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index 1470b2a78df..796fab837ef 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.183 2018/04/12 17:13:43 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.184 2018/07/10 04:19:59 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -442,8 +442,7 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, * Send a signal to process. */ void -sendsig(sig_t catcher, int sig, int mask, u_long code, int type, - union sigval val) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct proc *p = curproc; struct trapframe *tf; @@ -476,7 +475,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, bcopy(tf, &frame.sf_sc.sc_frame, sizeof *tf); if (psp->ps_siginfo & sigmask(sig)) { frame.sf_sip = &fp->sf_si; - initsiginfo(&frame.sf_si, sig, code, type, val); + frame.sf_si = *ksip; } frame.sf_sc.sc_cookie = (long)&fp->sf_sc ^ p->p_p->ps_sigcookie; if (copyout(&frame, fp, sizeof frame) != 0) diff --git a/sys/arch/mips64/mips64/sendsig.c b/sys/arch/mips64/mips64/sendsig.c index c05c6652134..45ae47d4825 100644 --- a/sys/arch/mips64/mips64/sendsig.c +++ b/sys/arch/mips64/mips64/sendsig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sendsig.c,v 1.29 2018/05/22 02:13:42 guenther Exp $ */ +/* $OpenBSD: sendsig.c,v 1.30 2018/07/10 04:19:59 guenther Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -92,8 +92,7 @@ struct sigframe { * Send an interrupt to process. */ void -sendsig(sig_t catcher, int sig, int mask, u_long code, int type, - union sigval val) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct cpu_info *ci = curcpu(); struct proc *p = curproc; @@ -139,10 +138,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, } if (psp->ps_siginfo & sigmask(sig)) { - siginfo_t si; - - initsiginfo(&si, sig, code, type, val); - if (copyout((caddr_t)&si, (caddr_t)&fp->sf_si, sizeof si)) + if (copyout(ksip, (caddr_t)&fp->sf_si, sizeof *ksip)) goto bail; } diff --git a/sys/arch/sh/sh/sh_machdep.c b/sys/arch/sh/sh/sh_machdep.c index 218db7f2e75..56f32389dac 100644 --- a/sys/arch/sh/sh/sh_machdep.c +++ b/sys/arch/sh/sh/sh_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sh_machdep.c,v 1.47 2018/04/12 17:13:44 deraadt Exp $ */ +/* $OpenBSD: sh_machdep.c,v 1.48 2018/07/10 04:19:59 guenther Exp $ */ /* $NetBSD: sh3_machdep.c,v 1.59 2006/03/04 01:13:36 uwe Exp $ */ /* @@ -448,8 +448,7 @@ struct sigframe { * Send an interrupt to process. */ void -sendsig(sig_t catcher, int sig, int mask, u_long code, int type, - union sigval val) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct proc *p = curproc; struct sigframe *fp, frame; @@ -470,7 +469,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, bzero(&frame, sizeof(frame)); if (psp->ps_siginfo & sigmask(sig)) { - initsiginfo(&frame.sf_si, sig, code, type, val); + frame.sf_si = *ksip; sip = &fp->sf_si; } else sip = NULL; diff --git a/sys/arch/socppc/socppc/machdep.c b/sys/arch/socppc/socppc/machdep.c index 830a2e24307..ef6cd748e55 100644 --- a/sys/arch/socppc/socppc/machdep.c +++ b/sys/arch/socppc/socppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.74 2018/04/12 17:13:44 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.75 2018/07/10 04:19:59 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -468,8 +468,7 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, * Send a signal to process. */ void -sendsig(sig_t catcher, int sig, int mask, u_long code, int type, - union sigval val) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct proc *p = curproc; struct trapframe *tf; @@ -502,7 +501,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, bcopy(tf, &frame.sf_sc.sc_frame, sizeof *tf); if (psp->ps_siginfo & sigmask(sig)) { frame.sf_sip = &fp->sf_si; - initsiginfo(&frame.sf_si, sig, code, type, val); + frame.sf_si = *ksip; } frame.sf_sc.sc_cookie = (long)&fp->sf_sc ^ p->p_p->ps_sigcookie; if (copyout(&frame, fp, sizeof frame) != 0) diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 872b2896fcf..9deec63d527 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.189 2018/05/22 02:13:42 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.190 2018/07/10 04:19:59 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -404,8 +404,7 @@ cpu_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, * Send an interrupt to process. */ void -sendsig(sig_t catcher, int sig, int mask, u_long code, int type, - union sigval val) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct proc *p = curproc; struct sigacts *psp = p->p_p->ps_sigacts; @@ -453,7 +452,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, if (psp->ps_siginfo & sigmask(sig)) { sf.sf_sip = &fp->sf_si; - initsiginfo(&sf.sf_si, sig, code, type, val); + sf.sf_si = *ksip; } /* |