-/* $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 $ */
/*-
* 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;
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;
rndfsize = ((fsize + 15) / 16) * 16;
kscsize = rndfsize;
if (psp->ps_siginfo & sigmask(sig)) {
- fsize += sizeof ksi;
+ fsize += sizeof *ksip;
rndfsize = ((fsize + 15) / 16) * 16;
}
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;
-/* $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 $ */
/*-
/*
* 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;
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;
-/* $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 $ */
/*
/*
* 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;
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;
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;
-/* $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.
/*
* 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;
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;
-/* $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
* 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;
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);
}
}
-/* $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 $ */
/*-
* 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;
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? */
-/* $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.
*
* 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;
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
-/* $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 $ */
/*
* 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;
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)
-/* $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.
* 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;
}
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;
}
-/* $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 $ */
/*
* 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;
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;
-/* $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 $ */
/*
* 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;
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)
-/* $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 $ */
/*-
* 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;
if (psp->ps_siginfo & sigmask(sig)) {
sf.sf_sip = &fp->sf_si;
- initsiginfo(&sf.sf_si, sig, code, type, val);
+ sf.sf_si = *ksip;
}
/*
-/* $OpenBSD: exec_elf.c,v 1.142 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.143 2018/07/10 04:19:59 guenther Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
struct emul emul_elf = {
"native",
NULL,
- sendsig,
SYS_syscall,
SYS_MAXSYSCALL,
sysent,
-/* $OpenBSD: init_main.c,v 1.277 2018/04/28 03:13:04 visa Exp $ */
+/* $OpenBSD: init_main.c,v 1.278 2018/07/10 04:19:59 guenther Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
struct emul emul_native = {
"native",
NULL,
- sendsig,
SYS_syscall,
SYS_MAXSYSCALL,
sysent,
-/* $OpenBSD: kern_sig.c,v 1.220 2018/04/28 03:13:04 visa Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.221 2018/07/10 04:19:59 guenther Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
if ((pr->ps_flags & PS_TRACED) == 0 &&
(ps->ps_sigcatch & mask) != 0 &&
(p->p_sigmask & mask) == 0) {
+ siginfo_t si;
+ initsiginfo(&si, signum, trapno, code, sigval);
#ifdef KTRACE
if (KTRPOINT(p, KTR_PSIG)) {
- siginfo_t si;
-
- initsiginfo(&si, signum, trapno, code, sigval);
ktrpsig(p, signum, ps->ps_sigact[signum],
p->p_sigmask, code, &si);
}
#endif
- (*pr->ps_emul->e_sendsig)(ps->ps_sigact[signum], signum,
- p->p_sigmask, trapno, code, sigval);
+ sendsig(ps->ps_sigact[signum], signum, p->p_sigmask, &si);
postsig_done(p, signum, ps);
} else {
p->p_sisig = signum;
sig_t action;
u_long trapno;
int mask, returnmask;
+ siginfo_t si;
union sigval sigval;
int s, code;
code = p->p_sicode;
sigval = p->p_sigval;
}
+ initsiginfo(&si, signum, trapno, code, sigval);
#ifdef KTRACE
if (KTRPOINT(p, KTR_PSIG)) {
- siginfo_t si;
-
- initsiginfo(&si, signum, trapno, code, sigval);
ktrpsig(p, signum, action, p->p_flag & P_SIGSUSPEND ?
p->p_oldmask : p->p_sigmask, code, &si);
}
p->p_sigval.sival_ptr = NULL;
}
- (*pr->ps_emul->e_sendsig)(action, signum, returnmask, trapno,
- code, sigval);
+ sendsig(action, signum, returnmask, &si);
postsig_done(p, signum, ps);
splx(s);
}
-/* $OpenBSD: proc.h,v 1.249 2018/06/17 08:22:02 anton Exp $ */
+/* $OpenBSD: proc.h,v 1.250 2018/07/10 04:19:59 guenther Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
struct emul {
char e_name[8]; /* Symbolic name */
int *e_errno; /* Errno array */
- /* Signal sending function */
- void (*e_sendsig)(void (*)(int), int, int, u_long, int, union sigval);
int e_nosys; /* Offset of the nosys() syscall */
int e_nsysent; /* Number of system call entries */
struct sysent *e_sysent; /* System call array */
-/* $OpenBSD: signalvar.h,v 1.30 2018/03/24 04:13:59 visa Exp $ */
+/* $OpenBSD: signalvar.h,v 1.31 2018/07/10 04:19:59 guenther Exp $ */
/* $NetBSD: signalvar.h,v 1.17 1996/04/22 01:23:31 christos Exp $ */
/*
/*
* Machine-dependent functions:
*/
-void sendsig(sig_t action, int sig, int returnmask, u_long code,
- int type, union sigval val);
+void sendsig(sig_t _catcher, int _sig, sigset_t _mask, const siginfo_t *_si);
#endif /* _KERNEL */
#endif /* !_SYS_SIGNALVAR_H_ */