diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-10-06 15:46:04 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-10-06 15:46:04 +0000 |
commit | 8be5040a6e8f33ead729a23c891aded656391565 (patch) | |
tree | 0370a7e22e0aad48f2d65220c475558cec02da2e /sys/arch/mips64 | |
parent | 790b950f10287934fe7b470dd399f607713d930e (diff) |
Change sendsig() interface so that the MD code does not need to access
data from struct process anymore. This changes how siginfo and onstack
are accessed and make sendsig() more MP friendly.
With and OK semarie@ OK kettenis@
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r-- | sys/arch/mips64/mips64/sendsig.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/arch/mips64/mips64/sendsig.c b/sys/arch/mips64/mips64/sendsig.c index 8d4de5df441..0f07636594f 100644 --- a/sys/arch/mips64/mips64/sendsig.c +++ b/sys/arch/mips64/mips64/sendsig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sendsig.c,v 1.34 2020/11/08 20:37:23 mpi Exp $ */ +/* $OpenBSD: sendsig.c,v 1.35 2021/10/06 15:46:03 claudio Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -92,13 +92,13 @@ struct sigframe { * Send an interrupt to process. */ int -sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) +sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip, + int info, int onstack) { struct cpu_info *ci = curcpu(); struct proc *p = ci->ci_curproc; struct sigframe *fp; struct trapframe *regs; - struct sigacts *psp = p->p_p->ps_sigacts; int fsize; struct sigcontext ksc; @@ -108,10 +108,10 @@ sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) * Allocate space for the signal handler context. */ fsize = sizeof(struct sigframe); - if (!(psp->ps_siginfo & sigmask(sig))) + if (!info) fsize -= sizeof(siginfo_t); if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && - !sigonstack(regs->sp) && (psp->ps_sigonstack & sigmask(sig))) + !sigonstack(regs->sp) && onstack) fp = (struct sigframe *) (trunc_page((vaddr_t)p->p_sigstk.ss_sp + p->p_sigstk.ss_size) - fsize); @@ -137,7 +137,7 @@ sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) sizeof(ksc.sc_fpregs)); } - if (psp->ps_siginfo & sigmask(sig)) { + if (info) { if (copyout(ksip, (caddr_t)&fp->sf_si, sizeof *ksip)) return 1; } @@ -150,7 +150,7 @@ sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) * Build the argument list for the signal handler. */ regs->a0 = sig; - regs->a1 = (psp->ps_siginfo & sigmask(sig)) ? (register_t)&fp->sf_si : 0; + regs->a1 = info ? (register_t)&fp->sf_si : 0; regs->a2 = (register_t)&fp->sf_sc; regs->a3 = (register_t)catcher; |