summaryrefslogtreecommitdiff
path: root/sys/arch/m88k
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2016-05-21 00:56:45 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2016-05-21 00:56:45 +0000
commit1fbc8c228fe0fb56e2182ad5a2e0de8e8680741d (patch)
treeffe3fd23c29744463f434d9eed1b663384113fb9 /sys/arch/m88k
parent4450afa6a6d9aec03fedaef2f2e2e5e73e9f2531 (diff)
hand-massage sendsig() and sys_sigreturn() to be much more similar.
ok guenther kettenis
Diffstat (limited to 'sys/arch/m88k')
-rw-r--r--sys/arch/m88k/m88k/sig_machdep.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/sys/arch/m88k/m88k/sig_machdep.c b/sys/arch/m88k/m88k/sig_machdep.c
index b1fef7fc38f..cd282df35f5 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.24 2016/05/10 18:39:46 deraadt Exp $ */
+/* $OpenBSD: sig_machdep.c,v 1.25 2016/05/21 00:56:43 deraadt Exp $ */
/*
* Copyright (c) 2014 Miodrag Vallat.
*
@@ -134,13 +134,6 @@ sendsig(sig_t catcher, int sig, int mask, unsigned long code, int type,
fp = (struct sigframe *)addr;
-#ifdef DEBUG
- if ((sigdebug & SDB_FOLLOW) ||
- ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid))
- printf("sendsig(%d): sig %d ssp %p usp %p scp %p\n",
- p->p_pid, sig, &sf, fp, &fp->sf_sc);
-#endif
-
/*
* Build the signal context to be used by sigreturn.
*/
@@ -207,26 +200,21 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval)
struct sys_sigreturn_args /* {
syscallarg(struct sigcontext *) sigcntxp;
} */ *uap = v;
- struct sigcontext *scp = SCARG(uap, sigcntxp);
+ struct sigcontext ksc, *scp = SCARG(uap, sigcntxp);
struct trapframe *tf;
- struct sigcontext ksc;
if (PROC_PC(p) != p->p_p->ps_sigcoderet) {
- printf("%s(%d): sigreturn not from tramp [pc 0x%llx %llx]\n",
- p->p_comm, p->p_pid, PROC_PC(p), p->p_p->ps_sigcoderet);
sigexit(p, SIGILL);
return (EPERM);
}
if (((vaddr_t)scp & 3) != 0)
- return (EINVAL);
+ return (EFAULT);
+
if ((error = copyin((caddr_t)scp, (caddr_t)&ksc, sizeof(*scp))))
return (error);
if (ksc.sc_cookie != ((long)scp ^ p->p_p->ps_sigcookie)) {
- printf("%s(%d): cookie %lx should have been %lx\n",
- p->p_comm, p->p_pid, ksc.sc_cookie,
- (long)scp ^ p->p_p->ps_sigcookie);
sigexit(p, SIGILL);
return (EFAULT);
}
@@ -234,23 +222,21 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval)
/* Prevent reuse of the sigcontext cookie */
ksc.sc_cookie = 0;
(void)copyout(&ksc.sc_cookie, (caddr_t)scp +
- offsetof(struct sigcontext, sc_cookie),
- sizeof (ksc.sc_cookie));
+ offsetof(struct sigcontext, sc_cookie), sizeof (ksc.sc_cookie));
tf = p->p_md.md_tf;
- scp = &ksc;
- if ((((struct reg *)&scp->sc_regs)->epsr ^ tf->tf_regs.epsr) &
+ if ((((struct reg *)&ksc.sc_regs)->epsr ^ tf->tf_regs.epsr) &
PSR_USERSTATIC)
return (EINVAL);
- bcopy((const void *)&scp->sc_regs, (caddr_t)&tf->tf_regs,
- sizeof(scp->sc_regs));
+ bcopy((const void *)&ksc.sc_regs, (caddr_t)&tf->tf_regs,
+ sizeof(ksc.sc_regs));
/*
* Restore the user supplied information
*/
- p->p_sigmask = scp->sc_mask & ~sigcantmask;
+ p->p_sigmask = ksc.sc_mask & ~sigcantmask;
#ifdef M88100
if (CPU_IS88100) {