Add kernel support for having userland provide the signal trampoline:

* struct sigacts gets a new sigact_sigdesc structure, which has the
  sigaction and the trampoline/version.  Version 0 means "legacy kernel
  provided trampoline".  Other versions are coordinated with machine-
  dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
  the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
  trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions.  Instead,
  sendsig() looks up the handler by peeking in the sigacts for the
  process getting the signal (since it has to look in there for the
  trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
  its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later.  Kernel
version not bumped; we will ride the 1.6C bump made recently.
This commit is contained in:
thorpej 2002-07-04 23:32:02 +00:00
parent 44f496c00a
commit 011d4d5f44
66 changed files with 552 additions and 247 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.255 2002/07/01 03:10:01 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.256 2002/07/04 23:32:02 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@ -75,7 +75,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.255 2002/07/01 03:10:01 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.256 2002/07/04 23:32:02 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1497,16 +1497,17 @@ regdump(framep)
* Send an interrupt to process.
*/
void
sendsig(catcher, sig, mask, code)
sig_t catcher;
sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct sigcontext *scp, ksc;
struct trapframe *frame;
int onstack, fsize, rndfsize;
sig_t catcher = SIGACTION(p, sig).sa_handler;
frame = p->p_md.md_tf;
@ -1598,13 +1599,33 @@ sendsig(catcher, sig, mask, code)
scp, code);
#endif
/* Set up the registers to return to sigcode. */
/*
* Set up the registers to directly invoke the signal handler. The
* signal trampoline is then used to return from the signal. Note
* the trampoline version numbers are coordinated with machine-
* dependent code in libc.
*/
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0: /* legacy on-stack sigtramp */
frame->tf_regs[FRAME_RA] = (u_int64_t)p->p_sigctx.ps_sigcode;
break;
#endif /* COMPAT_16 */
case 1:
frame->tf_regs[FRAME_RA] =
(u_int64_t)ps->sa_sigdesc[sig].sd_tramp;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
frame->tf_regs[FRAME_PC] = (u_int64_t)catcher;
frame->tf_regs[FRAME_A0] = sig;
frame->tf_regs[FRAME_A1] = code;
frame->tf_regs[FRAME_A2] = (u_int64_t)scp;
frame->tf_regs[FRAME_T12] = (u_int64_t)catcher; /* t12 is pv */
frame->tf_regs[FRAME_RA] = (u_int64_t)p->p_sigctx.ps_sigcode;
frame->tf_regs[FRAME_T12] = (u_int64_t)catcher;
alpha_pal_wrusp((unsigned long)scp);
/* Remember that we're now on the signal stack. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sig_machdep.c,v 1.13 2002/06/23 19:16:43 thorpej Exp $ */
/* $NetBSD: sig_machdep.c,v 1.14 2002/07/04 23:32:03 thorpej Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@ -44,7 +44,7 @@
#include <sys/param.h>
__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.13 2002/06/23 19:16:43 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.14 2002/07/04 23:32:03 thorpej Exp $");
#include <sys/mount.h> /* XXX only needed by syscallargs.h */
#include <sys/proc.h>
@ -79,12 +79,14 @@ process_frame(struct proc *p)
* frame pointer, it returns to the user specified pc.
*/
void
sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
sendsig(int sig, sigset_t *mask, u_long code)
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct trapframe *tf;
struct sigframe *fp, frame;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = process_frame(p);
@ -149,18 +151,39 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
/*
* Build context to run handler in. We invoke the handler
* directly, only returning via the trampoline.
* dorectly, only returning via the trampoline. Note the
* trampoline version numbers are coordinated with machine-
* depdent code in libc.
*/
tf->tf_r0 = sig;
tf->tf_r1 = code;
tf->tf_r2 = (int)&fp->sf_sc;
tf->tf_pc = (int)catcher;
tf->tf_usr_sp = (int)fp;
tf->tf_usr_lr = (int)p->p_sigctx.ps_sigcode;
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0: /* legacy on-stack sigtramp */
tf->tf_r0 = sig;
tf->tf_r1 = code;
tf->tf_r2 = (int)&fp->sf_sc;
tf->tf_pc = (int)catcher;
tf->tf_usr_sp = (int)fp;
tf->tf_usr_lr = (int)p->p_sigctx.ps_sigcode;
#ifndef acorn26
/* XXX This should not be needed. */
cpu_icache_sync_all();
/* XXX This should not be needed. */
cpu_icache_sync_all();
#endif
break;
#endif /* COMPAT_16 */
case 1:
tf->tf_r0 = sig;
tf->tf_r1 = code;
tf->tf_r2 = (int)&fp->sf_sc;
tf->tf_pc = (int)catcher;
tf->tf_usr_sp = (int)fp;
tf->tf_usr_lr = (int)ps->sa_sigdesc[sig].sd_tramp;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
/* Remember that we're now on the signal stack. */
if (onstack)

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpux_machdep.c,v 1.28 2002/03/15 05:55:37 gmcgarry Exp $ */
/* $NetBSD: hpux_machdep.c,v 1.29 2002/07/04 23:32:03 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hpux_machdep.c,v 1.28 2002/03/15 05:55:37 gmcgarry Exp $");
__KERNEL_RCSID(0, "$NetBSD: hpux_machdep.c,v 1.29 2002/07/04 23:32:03 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -418,8 +418,7 @@ int hpuxsigpid = 0;
* Send an interrupt to process.
*/
void
hpux_sendsig(catcher, sig, mask, code)
sig_t catcher;
hpux_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -429,6 +428,7 @@ hpux_sendsig(catcher, sig, mask, code)
struct frame *frame;
short ft;
int onstack, fsize;
sig_t catcher = SIGACTION(p, sig).sa_handler;
frame = (struct frame *)p->p_md.md_regs;
ft = frame->f_format;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpux_machdep.h,v 1.11 1998/10/01 08:28:30 thorpej Exp $ */
/* $NetBSD: hpux_machdep.h,v 1.12 2002/07/04 23:32:03 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -74,7 +74,7 @@ int hpux_cpu_vmcmd __P((struct proc *, struct exec_vmcmd *));
int hpux_cpu_sysconf_arch __P((void));
int hpux_to_bsd_uoff __P((int *, int *, struct proc *));
void hpux_sendsig __P((sig_t, int, sigset_t *, u_long));
void hpux_sendsig __P((int, sigset_t *, u_long));
void hpux_setregs __P((struct proc *, struct exec_package *,
u_long));
#endif /* _KERNEL */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sig_machdep.c,v 1.1 2002/06/05 01:04:20 fredette Exp $ */
/* $NetBSD: sig_machdep.c,v 1.2 2002/07/04 23:32:04 thorpej Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -107,17 +107,18 @@ int sigpid = 0;
* Send an interrupt to process.
*/
void
sendsig(catcher, sig, mask, code)
sig_t catcher;
sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct sigframe *fp, kf;
caddr_t sp;
struct trapframe *tf;
int onstack, fsize;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = (struct trapframe *)p->p_md.md_regs;
@ -198,15 +199,33 @@ sendsig(catcher, sig, mask, code)
#endif
/* Set up the registers to return to sigcode. */
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0: /* legacy on-stack sigtramp */
tf->tf_iioq_head =
(int)p->p_sigctx.ps_sigcode | HPPA_PC_PRIV_USER;
tf->tf_iioq_tail = tf->tf_iioq_head + 4;
break;
#endif
case 1:
tf->tf_iioq_head =
(int)ps->sa_sigdesc[sig].sd_tramp | HPPA_PC_PRIV_USER;
tf->tf_iioq_tail = tf->tf_iioq_head + 4;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
tf->tf_sp = (int)sp;
tf->tf_r3 = (int)&fp->sf_sc;
tf->tf_iioq_head = (int)p->p_sigctx.ps_sigcode | HPPA_PC_PRIV_USER;
tf->tf_iioq_tail = tf->tf_iioq_head + 4;
tf->tf_arg0 = sig;
tf->tf_arg1 = code;
tf->tf_arg2 = (int)&fp->sf_sc;
tf->tf_arg3 = (int)catcher;
/* Remember that we're now on the signal stack. */
if (onstack)
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;

View File

@ -1,4 +1,4 @@
/* $NetBSD: freebsd_machdep.c,v 1.32 2002/04/02 22:33:19 christos Exp $ */
/* $NetBSD: freebsd_machdep.c,v 1.33 2002/07/04 23:32:04 thorpej Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: freebsd_machdep.c,v 1.32 2002/04/02 22:33:19 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: freebsd_machdep.c,v 1.33 2002/07/04 23:32:04 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@ -92,8 +92,7 @@ freebsd_setregs(p, epp, stack)
* specified pc, psl.
*/
void
freebsd_sendsig(catcher, sig, mask, code)
sig_t catcher;
freebsd_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -102,6 +101,7 @@ freebsd_sendsig(catcher, sig, mask, code)
register struct trapframe *tf;
struct freebsd_sigframe *fp, frame;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = p->p_md.md_regs;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_machdep.c,v 1.19 2002/06/23 22:18:49 thorpej Exp $ */
/* $NetBSD: ibcs2_machdep.c,v 1.20 2002/07/04 23:32:04 thorpej Exp $ */
/*-
* Copyright (c) 1997, 2000 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ibcs2_machdep.c,v 1.19 2002/06/23 22:18:49 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibcs2_machdep.c,v 1.20 2002/07/04 23:32:04 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@ -97,8 +97,7 @@ ibcs2_setregs(p, epp, stack)
* specified pc, psl.
*/
void
ibcs2_sendsig(catcher, sig, mask, code)
sig_t catcher;
ibcs2_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -108,6 +107,7 @@ ibcs2_sendsig(catcher, sig, mask, code)
struct trapframe *tf;
struct sigframe *fp, frame;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = p->p_md.md_regs;

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.476 2002/07/04 10:22:20 fvdl Exp $ */
/* $NetBSD: machdep.c,v 1.477 2002/07/04 23:32:04 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.476 2002/07/04 10:22:20 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.477 2002/07/04 23:32:04 thorpej Exp $");
#include "opt_cputype.h"
#include "opt_ddb.h"
@ -1964,16 +1964,17 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
* specified pc, psl.
*/
void
sendsig(catcher, sig, mask, code)
sig_t catcher;
sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct trapframe *tf;
struct sigframe *fp, frame;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = p->p_md.md_regs;
@ -1991,7 +1992,22 @@ sendsig(catcher, sig, mask, code)
fp--;
/* Build stack frame for signal trampoline. */
frame.sf_ra = (int)p->p_sigctx.ps_sigcode;
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0: /* legacy on-stack sigtramp */
frame.sf_ra = (int)p->p_sigctx.ps_sigcode;
break;
#endif /* COMPAT_16 */
case 1:
frame.sf_ra = (int)ps->sa_sigdesc[sig].sd_tramp;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
frame.sf_signum = sig;
frame.sf_code = code;
frame.sf_scp = &fp->sf_sc;
@ -2055,7 +2071,9 @@ sendsig(catcher, sig, mask, code)
/*
* Build context to run handler in. We invoke the handler
* directly, only returning via the trampoline.
* directly, only returning via the trampoline. Note the
* trampoline version numbers are coordinated with machine-
* dependent code in libc.
*/
tf->tf_gs = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_fs = GSEL(GUDATA_SEL, SEL_UPL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_machdep.c,v 1.62 2002/04/02 22:33:19 christos Exp $ */
/* $NetBSD: svr4_machdep.c,v 1.63 2002/07/04 23:32:04 thorpej Exp $ */
/*-
* Copyright (c) 1994, 2000 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_machdep.c,v 1.62 2002/04/02 22:33:19 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_machdep.c,v 1.63 2002/07/04 23:32:04 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@ -365,8 +365,7 @@ svr4_getsiginfo(si, sig, code, addr)
* will return to the user pc, psl.
*/
void
svr4_sendsig(catcher, sig, mask, code)
sig_t catcher;
svr4_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -375,6 +374,7 @@ svr4_sendsig(catcher, sig, mask, code)
register struct trapframe *tf;
struct svr4_sigframe *fp, frame;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = p->p_md.md_regs;

View File

@ -1,4 +1,4 @@
/* $NetBSD: freebsd_machdep.h,v 1.4 2001/10/27 12:26:29 jdolecek Exp $ */
/* $NetBSD: freebsd_machdep.h,v 1.5 2002/07/04 23:32:05 thorpej Exp $ */
/*
* Copyright (c) 1986, 1989, 1991, 1993
@ -192,7 +192,7 @@ struct freebsd_ptrace_reg {
/* sys/i386/include/exec.h */
#define FREEBSD___LDPGSZ 4096
void freebsd_sendsig __P((sig_t, int, sigset_t *, u_long));
void freebsd_sendsig __P((int, sigset_t *, u_long));
void freebsd_syscall_intern __P((struct proc *));
#endif /* _FREEBSD_MACHDEP_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_machdep.h,v 1.10 2000/12/11 05:29:00 mycroft Exp $ */
/* $NetBSD: ibcs2_machdep.h,v 1.11 2002/07/04 23:32:05 thorpej Exp $ */
/*-
* Copyright (c) 1997, 2000 The NetBSD Foundation, Inc.
@ -48,7 +48,7 @@ struct exec_package;
struct exec_vmcmd;
void ibcs2_setregs __P((struct proc *, struct exec_package *, u_long));
void ibcs2_sendsig __P((sig_t, int, sigset_t *, u_long));
void ibcs2_sendsig __P((int, sigset_t *, u_long));
int ibcs2_sys_sysmachine __P((struct proc *, void *, register_t *retval));
void ibcs2_syscall_intern __P((struct proc *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: sig_machdep.c,v 1.16 2002/07/04 01:50:40 thorpej Exp $ */
/* $NetBSD: sig_machdep.c,v 1.17 2002/07/04 23:32:05 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -76,17 +76,18 @@ int sigpid = 0;
* Send an interrupt to process.
*/
void
sendsig(catcher, sig, mask, code)
sig_t catcher;
sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct sigframe *fp, kf;
struct frame *frame;
short ft;
int onstack, fsize;
sig_t catcher = SIGACTION(p, sig).sa_handler;
frame = (struct frame *)p->p_md.md_regs;
ft = frame->f_format;
@ -112,7 +113,22 @@ sendsig(catcher, sig, mask, code)
#endif
/* Build stack frame for signal trampoline. */
kf.sf_ra = (int)p->p_sigctx.ps_sigcode;
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0: /* legacy on-stack sigtramp */
kf.sf_ra = (int)p->p_sigctx.ps_sigcode;
break;
#endif /* COMPAT_16 */
case 1:
kf.sf_ra = (int)ps->sa_sigdesc[sig].sd_tramp;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
kf.sf_signum = sig;
kf.sf_code = code;
kf.sf_scp = &fp->sf_sc;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos_machdep.c,v 1.20 2000/12/22 22:58:54 jdolecek Exp $ */
/* $NetBSD: sunos_machdep.c,v 1.21 2002/07/04 23:32:05 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -94,8 +94,7 @@ struct sunos_sigframe {
* SIG_DFL for "dangerous" signals.
*/
void
sunos_sendsig(catcher, sig, mask, code)
sig_t catcher;
sunos_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -105,6 +104,7 @@ sunos_sendsig(catcher, sig, mask, code)
struct frame *frame;
short ft;
int onstack, fsize;
sig_t catcher = SIGACTION(p, sig).sa_handler;
frame = (struct frame *)p->p_md.md_regs;
ft = frame->f_format;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_machdep.c,v 1.7 2002/03/31 22:21:03 christos Exp $ */
/* $NetBSD: svr4_machdep.c,v 1.8 2002/07/04 23:32:05 thorpej Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -244,8 +244,7 @@ svr4_getsiginfo(sip, sig, code, addr)
}
void
svr4_sendsig(catcher, sig, mask, code)
sig_t catcher;
svr4_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
unsigned long code;
@ -254,6 +253,7 @@ svr4_sendsig(catcher, sig, mask, code)
struct frame *frame;
struct svr4_sigframe *sfp, sf;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
frame = (struct frame *)p->p_md.md_regs;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mips_machdep.c,v 1.134 2002/07/04 19:20:02 thorpej Exp $ */
/* $NetBSD: mips_machdep.c,v 1.135 2002/07/04 23:32:05 thorpej Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@ -120,7 +120,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.134 2002/07/04 19:20:02 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.135 2002/07/04 23:32:05 thorpej Exp $");
#include "opt_cputype.h"
#include "opt_compat_netbsd.h"
@ -1085,17 +1085,18 @@ int sigpid = 0;
* Send an interrupt to process.
*/
void
sendsig(catcher, sig, mask, code)
sig_t catcher;
sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct sigframe *fp;
struct frame *f;
int onstack;
struct sigcontext ksc;
sig_t catcher = SIGACTION(p, sig).sa_handler;
f = (struct frame *)p->p_md.md_regs;
@ -1174,18 +1175,35 @@ sendsig(catcher, sig, mask, code)
/* NOTREACHED */
}
/* Set up the registers to return to sigcode. */
/*
* Set up the registers to directly invoke the signal
* handler. The return address will be set up to point
* to the signal trampoline to bounce us back.
*/
f->f_regs[A0] = sig;
f->f_regs[A1] = code;
f->f_regs[A2] = (int)&fp->sf_sc;
f->f_regs[A3] = (int)catcher;
f->f_regs[A3] = (int)catcher; /* XXX ??? */
f->f_regs[PC] = (int)catcher;
f->f_regs[T9] = (int)catcher;
f->f_regs[SP] = (int)fp;
/* Signal trampoline code is at base of user stack. */
f->f_regs[RA] = (int)p->p_sigctx.ps_sigcode;
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0: /* legacy on-stack sigtramp */
f->f_regs[RA] = (int)p->p_sigctx.ps_sigcode;
break;
#endif /* COMPAT_16 */
case 1:
f->f_regs[RA] = (int)ps->sa_sigdesc[sig].sd_tramp;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
/* Remember that we're now on the signal stack. */
if (onstack)

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.127 2002/03/20 17:59:25 christos Exp $ */
/* $NetBSD: machdep.c,v 1.128 2002/07/04 23:32:06 thorpej Exp $ */
/*-
* Copyright (c) 1996 Matthias Pfaller.
@ -320,16 +320,17 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
* specified pc, psl.
*/
void
sendsig(catcher, sig, mask, code)
sig_t catcher;
sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct reg *regs;
struct sigframe *fp, frame;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
regs = p->p_md.md_regs;
@ -393,10 +394,26 @@ sendsig(catcher, sig, mask, code)
}
/*
* Build context to run handler in.
* Build context to run handler in. Note the trampoline version
* numbers are coordinated with machine-dependent code in libc.
*/
regs->r_sp = (int)fp;
regs->r_pc = (int)p->p_sigctx.ps_sigcode;
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0:
regs->r_sp = (int)fp;
regs->r_pc = (int)p->p_sigctx.ps_sigcode;
break;
#endif /* COMPAT_16 */
case 1:
regs->r_sp = (int)fp;
regs->r_pc = (int)ps->sa_sigdesc[sig].sd_tramp;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
/* Remember that we're now on the signal stack. */
if (onstack)

View File

@ -1,4 +1,4 @@
/* $NetBSD: sig_machdep.c,v 1.6 2002/07/04 20:22:50 thorpej Exp $ */
/* $NetBSD: sig_machdep.c,v 1.7 2002/07/04 23:32:06 thorpej Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -44,16 +44,17 @@
* Send a signal to process.
*/
void
sendsig(catcher, sig, mask, code)
sig_t catcher;
sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct trapframe *tf;
struct sigframe *fp, frame;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = trapframe(p);
@ -99,14 +100,34 @@ sendsig(catcher, sig, mask, code)
}
/*
* Build context to run handler in.
* Build context to run handler in. Note the trampoline version
* numbers are coordinated with machine-dependent code in libc.
*/
tf->fixreg[1] = (int)fp;
tf->lr = (int)catcher;
tf->fixreg[3] = (int)sig;
tf->fixreg[4] = (int)code;
tf->fixreg[5] = (int)&fp->sf_sc;
tf->srr0 = (int)p->p_sigctx.ps_sigcode;
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0: /* legacy on-stack sigtramp */
tf->fixreg[1] = (int)fp;
tf->lr = (int)catcher;
tf->fixreg[3] = (int)sig;
tf->fixreg[4] = (int)code;
tf->fixreg[5] = (int)&fp->sf_sc;
tf->srr0 = (int)p->p_sigctx.ps_sigcode;
break;
#endif /* COMPAT_16 */
case 1:
tf->fixreg[1] = (int)fp;
tf->lr = (int)catcher;
tf->fixreg[3] = (int)sig;
tf->fixreg[4] = (int)code;
tf->fixreg[5] = (int)&fp->sf_sc;
tf->srr0 = (int)ps->sa_sigdesc[sig].sd_tramp;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
/* Remember that we're now on the signal stack. */
if (onstack)

View File

@ -1,4 +1,4 @@
/* $NetBSD: sh3_machdep.c,v 1.43 2002/06/23 18:49:33 thorpej Exp $ */
/* $NetBSD: sh3_machdep.c,v 1.44 2002/07/04 23:32:06 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2002 The NetBSD Foundation, Inc.
@ -372,12 +372,14 @@ dumpsys()
* specified pc, psl.
*/
void
sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
sendsig(int sig, sigset_t *mask, u_long code)
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct trapframe *tf;
struct sigframe *fp, frame;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = p->p_md.md_regs;
@ -435,11 +437,26 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
* Build context to run handler in. We invoke the handler
* directly, only returning via the trampoline.
*/
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0: /* legacy on-stack sigtramp */
tf->tf_pr = (int)p->p_sigctx.ps_sigcode;
break;
#endif /* COMPAT_16 */
case 1:
tf->tf_pr = (int)ps->sa_sigdesc[sig].sd_tramp;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
tf->tf_r4 = sig;
tf->tf_r5 = code;
tf->tf_r6 = (int)&fp->sf_sc;
tf->tf_spc = (int)catcher;
tf->tf_pr = (int)p->p_sigctx.ps_sigcode;
tf->tf_r15 = (int)fp;
/* Remember that we're now on the signal stack. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.194 2002/06/02 14:44:39 drochner Exp $ */
/* $NetBSD: machdep.c,v 1.195 2002/07/04 23:32:06 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -501,17 +501,18 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
* Send an interrupt to process.
*/
void
sendsig(catcher, sig, mask, code)
sig_t catcher;
sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct sigframe *fp;
struct trapframe *tf;
int addr, onstack, oldsp, newsp;
struct sigframe sf;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = p->p_md.md_tf;
oldsp = tf->tf_out[6];
@ -601,7 +602,22 @@ sendsig(catcher, sig, mask, code)
* Arrange to continue execution at the code copied out in exec().
* It needs the function to call in %g1, and a new stack pointer.
*/
addr = (int)p->p_sigctx.ps_sigcode;
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0: /* legacy on-stack sigtramp */
addr = (int)p->p_sigctx.ps_sigcode;
break;
#endif /* COMPAT_16 */
case 1:
addr = (int)ps->sa_sigdesc[sig].sd_tramp;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
tf->tf_global[1] = (int)catcher;
tf->tf_pc = addr;
tf->tf_npc = addr + 4;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos_machdep.c,v 1.9 2001/06/07 17:49:51 mrg Exp $ */
/* $NetBSD: sunos_machdep.c,v 1.10 2002/07/04 23:32:07 thorpej Exp $ */
/*
* Copyright (c) 1995 Matthew R. Green
@ -65,8 +65,7 @@ struct sunos_sigframe {
};
void
sunos_sendsig(catcher, sig, mask, code)
sig_t catcher;
sunos_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -75,6 +74,7 @@ sunos_sendsig(catcher, sig, mask, code)
struct sunos_sigframe *fp;
struct trapframe *tf;
int addr, onstack, oldsp, newsp;
sig_t catcher = SIGACTION(p, sig).sa_handler;
struct sunos_sigframe sf;
tf = p->p_md.md_tf;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_machdep.c,v 1.45 2002/05/31 19:49:42 thorpej Exp $ */
/* $NetBSD: svr4_machdep.c,v 1.46 2002/07/04 23:32:07 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -450,8 +450,7 @@ svr4_getsiginfo(si, sig, code, addr)
* will return to the user pc, psl.
*/
void
svr4_sendsig(catcher, sig, mask, code)
sig_t catcher;
svr4_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -460,6 +459,7 @@ svr4_sendsig(catcher, sig, mask, code)
register struct trapframe *tf;
struct svr4_sigframe *fp, frame;
int onstack, oldsp, newsp, addr;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = (struct trapframe *)p->p_md.md_tf;
oldsp = tf->tf_out[6];

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.h,v 1.8 2002/01/03 06:43:24 mrg Exp $ */
/* $NetBSD: netbsd32_machdep.h,v 1.9 2002/07/04 23:32:07 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -66,7 +66,7 @@ struct netbsd32_sigcontext13 {
struct exec_package;
void netbsd32_setregs (struct proc *p, struct exec_package *pack, u_long stack);
int netbsd32_sigreturn (struct proc *p, void *v, register_t *retval);
void netbsd32_sendsig (sig_t catcher, int sig, sigset_t *mask, u_long code);
void netbsd32_sendsig (int sig, sigset_t *mask, u_long code);
extern char netbsd32_esigcode[], netbsd32_sigcode[];

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.122 2002/06/12 17:06:16 eeh Exp $ */
/* $NetBSD: machdep.c,v 1.123 2002/07/04 23:32:07 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -456,13 +456,13 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
* Send an interrupt to process.
*/
void
sendsig(catcher, sig, mask, code)
sig_t catcher;
sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct sigframe *fp;
struct trapframe64 *tf;
vaddr_t addr;
@ -472,6 +472,7 @@ sendsig(catcher, sig, mask, code)
#endif
struct sigframe sf;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = p->p_md.md_tf;
oldsp = (struct rwindow *)(u_long)(tf->tf_out[6] + STACK_OFFSET);
@ -590,7 +591,22 @@ sendsig(catcher, sig, mask, code)
* Arrange to continue execution at the code copied out in exec().
* It needs the function to call in %g1, and a new stack pointer.
*/
addr = (vaddr_t)p->p_sigctx.ps_sigcode;
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0: /* legacy on-stack sigtramp */
addr = (vaddr_t)p->p_sigctx.ps_sigcode;
break;
#endif /* COMPAT_16 */
case 1:
addr = (vaddr_t)ps->sa_sigdesc[sig].sd_tramp;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
tf->tf_global[1] = (vaddr_t)catcher;
tf->tf_pc = addr;
tf->tf_npc = addr + 4;

View File

@ -151,8 +151,7 @@ extern int sigdebug;
#endif
void
netbsd32_sendsig(catcher, sig, mask, code)
sig_t catcher;
netbsd32_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -162,6 +161,7 @@ netbsd32_sendsig(catcher, sig, mask, code)
register struct trapframe64 *tf;
register int addr, onstack;
struct rwindow32 *kwin, *oldsp, *newsp;
sig_t catcher = SIGACTION(p, sig).sa_handler;
struct sparc32_sigframe sf;
extern char netbsd32_sigcode[], netbsd32_esigcode[];
#define szsigcode (netbsd32_esigcode - netbsd32_sigcode)

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos32_machdep.c,v 1.7 2002/03/20 17:59:26 christos Exp $ */
/* $NetBSD: sunos32_machdep.c,v 1.8 2002/07/04 23:32:07 thorpej Exp $ */
/* from: NetBSD: sunos_machdep.c,v 1.14 2001/01/29 01:37:56 mrg Exp */
/*
@ -149,8 +149,7 @@ sunos32_setregs(p, pack, stack)
}
void
sunos32_sendsig(catcher, sig, mask, code)
sig_t catcher;
sunos32_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -163,6 +162,7 @@ sunos32_sendsig(catcher, sig, mask, code)
struct sunos32_sigcontext *scp;
u_int32_t addr, oldsp32;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = p->p_md.md_tf;
/* Need to attempt to zero extend this 32-bit pointer */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos_machdep.c,v 1.15 2002/03/02 12:28:16 mrg Exp $ */
/* $NetBSD: sunos_machdep.c,v 1.16 2002/07/04 23:32:07 thorpej Exp $ */
/*
* Copyright (c) 1995 Matthew R. Green
@ -77,8 +77,7 @@ struct sunos_sigframe {
};
void
sunos_sendsig(catcher, sig, mask, code)
sig_t catcher;
sunos_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -88,6 +87,7 @@ sunos_sendsig(catcher, sig, mask, code)
register struct trapframe64 *tf;
register int addr, onstack;
struct rwindow32 *kwin, *oldsp, *newsp;
sig_t catcher = SIGACTION(p, sig).sa_handler;
struct sunos_sigframe sf;
tf = p->p_md.md_tf;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_machdep.c,v 1.7 2002/04/02 10:25:21 jmc Exp $ */
/* $NetBSD: svr4_32_machdep.c,v 1.8 2002/07/04 23:32:08 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -463,8 +463,7 @@ svr4_32_getsiginfo(si, sig, code, addr)
* will return to the user pc, psl.
*/
void
svr4_32_sendsig(catcher, sig, mask, code)
sig_t catcher;
svr4_32_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -474,6 +473,7 @@ svr4_32_sendsig(catcher, sig, mask, code)
struct svr4_32_sigframe *fp, frame;
int onstack;
vaddr_t oldsp, newsp, addr;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = (struct trapframe64 *)p->p_md.md_tf;
oldsp = tf->tf_out[6];

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_machdep.c,v 1.25 2002/03/31 22:21:04 christos Exp $ */
/* $NetBSD: svr4_machdep.c,v 1.26 2002/07/04 23:32:08 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -498,8 +498,7 @@ svr4_getsiginfo(si, sig, code, addr)
#endif
void
svr4_sendsig(catcher, sig, mask, code)
sig_t catcher;
svr4_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -509,6 +508,7 @@ svr4_sendsig(catcher, sig, mask, code)
struct svr4_sigframe *fp, frame;
int onstack;
vaddr_t oldsp, newsp, addr;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = (struct trapframe64 *)p->p_md.md_tf;
oldsp = tf->tf_out[6] + STACK_OFFSET;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_machdep.h,v 1.3 2000/06/21 05:45:17 matt Exp $ */
/* $NetBSD: ibcs2_machdep.h,v 1.4 2002/07/04 23:32:08 thorpej Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -48,7 +48,7 @@ struct exec_package;
struct exec_vmcmd;
void ibcs2_setregs __P((struct proc *, struct exec_package *, u_long));
void ibcs2_sendsig __P((sig_t, int, sigset_t *, u_long));
void ibcs2_sendsig __P((int, sigset_t *, u_long));
int ibcs2_sys_sysmachine __P((struct proc *, void *, register_t *));
#endif /* _KERNEL */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_machdep.c,v 1.2 2002/03/31 22:21:04 christos Exp $ */
/* $NetBSD: ibcs2_machdep.c,v 1.3 2002/07/04 23:32:08 thorpej Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -74,13 +74,12 @@ ibcs2_setregs(p, epp, stack)
* specified pc, psl.
*/
void
ibcs2_sendsig(catcher, sig, mask, code)
sig_t catcher;
ibcs2_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
sendsig(catcher, native_to_ibcs2_signo[sig], mask, code);
sendsig(native_to_ibcs2_signo[sig], mask, code);
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.123 2002/03/31 00:11:13 matt Exp $ */
/* $NetBSD: machdep.c,v 1.124 2002/07/04 23:32:08 thorpej Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
@ -409,18 +409,19 @@ struct trampframe {
};
void
sendsig(catcher, sig, mask, code)
sig_t catcher;
sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct trapframe *syscf;
struct sigcontext *sigctx, gsigctx;
struct trampframe *trampf, gtrampf;
unsigned cursp;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
syscf = p->p_addr->u_pcb.framep;
@ -465,7 +466,25 @@ sendsig(catcher, sig, mask, code)
copyout(&gsigctx, sigctx, sizeof(gsigctx)))
sigexit(p, SIGILL);
syscf->pc = (int)p->p_sigctx.ps_sigcode;
/*
* Note the trampoline version numbers are coordinated with
* machine-dependent code in libc.
*/
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0:
syscf->pc = (int)p->p_sigctx.ps_sigcode;
break;
#endif /* COMPAT_16 */
case 1:
syscf->pc = (int)ps->sa_sigdesc[sig].sd_tramp;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
syscf->psl = PSL_U | PSL_PREVU;
syscf->ap = cursp;
syscf->sp = cursp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.h,v 1.2 2002/06/25 01:24:49 thorpej Exp $ */
/* $NetBSD: netbsd32_machdep.h,v 1.3 2002/07/04 23:32:08 thorpej Exp $ */
#ifndef _MACHINE_NETBSD32_H_
#define _MACHINE_NETBSD32_H_
@ -99,7 +99,7 @@ struct fpreg32 {
struct exec_package;
void netbsd32_setregs(struct proc *p, struct exec_package *pack, u_long stack);
int netbsd32_sigreturn(struct proc *p, void *v, register_t *retval);
void netbsd32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code);
void netbsd32_sendsig(int sig, sigset_t *mask, u_long code);
extern char netbsd32_sigcode[], netbsd32_esigcode[];

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.13 2002/07/04 10:46:21 fvdl Exp $ */
/* $NetBSD: machdep.c,v 1.14 2002/07/04 23:32:09 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -475,18 +475,19 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
* specified pc, psl.
*/
void
sendsig(catcher, sig, mask, code)
sig_t catcher;
sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct sigacts *ps = p->p_sigacts;
struct trapframe *tf;
char *sp;
struct sigframe *fp, frame;
int onstack;
size_t tocopy;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = p->p_md.md_regs;
@ -519,7 +520,21 @@ sendsig(catcher, sig, mask, code)
}
/* Build stack frame for signal trampoline. */
frame.sf_ra = (uint64_t) p->p_sigctx.ps_sigcode;
switch (ps->sa_sigdesc[sig].sd_vers) {
#if 1 /* COMPAT_16 */
case 0: /* legacy on-stack sigtramp */
frame.sf_ra = (uint64_t) p->p_sigctx.ps_sigcode;
break;
#endif /* COMPAT_16 */
case 1:
frame.sf_ra = (uint64_t) ps->sa_sigdesc[sig].sd_tramp;
break;
default:
/* Don't know what trampoline version; kill it. */
sigexit(p, SIGILL);
}
/* Save register context. */
__asm("movl %%gs,%0" : "=r" (frame.sf_sc.sc_gs));

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.8 2002/06/25 01:24:50 thorpej Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.9 2002/07/04 23:32:09 thorpej Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -128,10 +128,11 @@ netbsd32_setregs(struct proc *p, struct exec_package *pack, u_long stack)
}
void
netbsd32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
netbsd32_sendsig(int sig, sigset_t *mask, u_long code)
{
struct proc *p = curproc;
struct trapframe *tf;
sig_t catcher = SIGACTION(p, sig).sa_handler;
struct netbsd32_sigframe *fp, frame;
int onstack;

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sig_13.c,v 1.6 2001/11/13 02:08:01 lukem Exp $ */
/* $NetBSD: kern_sig_13.c,v 1.7 2002/07/04 23:32:09 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_sig_13.c,v 1.6 2001/11/13 02:08:01 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_sig_13.c,v 1.7 2002/07/04 23:32:09 thorpej Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -172,7 +172,8 @@ compat_13_sys_sigaction(p, v, retval)
native_sigaction13_to_sigaction(&nesa, &nbsa);
}
error = sigaction1(p, SCARG(uap, signum),
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0);
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0,
NULL, 0);
if (error)
return (error);
if (SCARG(uap, osa)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sig_43.c,v 1.16 2001/11/13 02:08:01 lukem Exp $ */
/* $NetBSD: kern_sig_43.c,v 1.17 2002/07/04 23:32:09 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.16 2001/11/13 02:08:01 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.17 2002/07/04 23:32:09 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -247,7 +247,8 @@ compat_43_sys_sigvec(p, v, retval)
compat_43_sigvec_to_sigaction(&nsv, &nsa);
}
error = sigaction1(p, SCARG(uap, signum),
SCARG(uap, nsv) ? &nsa : 0, SCARG(uap, osv) ? &osa : 0);
SCARG(uap, nsv) ? &nsa : 0, SCARG(uap, osv) ? &osa : 0,
NULL, 0);
if (error)
return (error);
if (SCARG(uap, osv)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: freebsd_misc.c,v 1.14 2001/11/13 02:08:09 lukem Exp $ */
/* $NetBSD: freebsd_misc.c,v 1.15 2002/07/04 23:32:09 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: freebsd_misc.c,v 1.14 2001/11/13 02:08:09 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: freebsd_misc.c,v 1.15 2002/07/04 23:32:09 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ntp.h"
@ -146,7 +146,8 @@ freebsd_sys_sigaction4(p, v, retval)
nbsa.sa_flags = nesa.sa_flags;
}
error = sigaction1(p, SCARG(uap, signum),
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0);
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0,
NULL, 0);
if (error)
return (error);
if (SCARG(uap, osa)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpux_sig.c,v 1.22 2002/03/31 22:22:43 christos Exp $ */
/* $NetBSD: hpux_sig.c,v 1.23 2002/07/04 23:32:09 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hpux_sig.c,v 1.22 2002/03/31 22:22:43 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: hpux_sig.c,v 1.23 2002/07/04 23:32:09 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -108,7 +108,8 @@ hpux_sys_sigvec(p, v, retval)
error = sigaction1(p, sig,
SCARG(uap, nsv) ? &nsa : NULL,
SCARG(uap, osv) ? &osa : NULL);
SCARG(uap, osv) ? &osa : NULL,
NULL, 0);
if (error)
return (error);
@ -341,7 +342,7 @@ hpux_sys_sigaction(p, v, retval)
if (sa->sa_flags & HPUXSA_NOCLDSTOP)
act.sa_flags |= SA_NOCLDSTOP;
error = sigaction1(p, sig, &act, NULL);
error = sigaction1(p, sig, &act, NULL, NULL, 0);
if (error)
return (error);
}
@ -381,7 +382,7 @@ hpux_sys_ssig_6x(p, v, retval)
sigemptyset(&sa->sa_mask);
sa->sa_flags = 0;
*retval = (register_t)SIGACTION(p, a).sa_handler;
sigaction1(p, a, sa, NULL);
sigaction1(p, a, sa, NULL, NULL, 0);
#if 0
p->p_flag |= SOUSIG; /* mark as simulating old stuff */
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_signal.c,v 1.15 2002/03/31 22:22:44 christos Exp $ */
/* $NetBSD: ibcs2_signal.c,v 1.16 2002/07/04 23:32:09 thorpej Exp $ */
/*
* Copyright (c) 1995 Scott Bartram
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ibcs2_signal.c,v 1.15 2002/03/31 22:22:44 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibcs2_signal.c,v 1.16 2002/07/04 23:32:09 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -198,7 +198,8 @@ ibcs2_sys_sigaction(p, v, retval)
ibcs2_to_native_sigaction(&nisa, &nbsa);
}
error = sigaction1(p, ibcs2_to_native_signo[SCARG(uap, signum)],
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0);
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0,
NULL, 0);
if (error)
return (error);
if (SCARG(uap, osa)) {
@ -271,7 +272,7 @@ ibcs2_sys_sigsys(p, v, retval)
nbsa.sa_handler = (sig_t)SCARG(uap, fp);
sigemptyset(&nbsa.sa_mask);
nbsa.sa_flags = 0;
error = sigaction1(p, signum, &nbsa, &obsa);
error = sigaction1(p, signum, &nbsa, &obsa, NULL, 0);
if (error)
return (error);
*retval = (int)obsa.sa_handler;
@ -292,7 +293,7 @@ ibcs2_sys_sigsys(p, v, retval)
nbsa.sa_handler = SIG_IGN;
sigemptyset(&nbsa.sa_mask);
nbsa.sa_flags = 0;
return (sigaction1(p, signum, &nbsa, 0));
return (sigaction1(p, signum, &nbsa, 0, NULL, 0));
case IBCS2_SIGPAUSE_MASK:
ss = p->p_sigctx.ps_sigmask;

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_signal.c,v 1.17 2002/06/22 13:02:39 manu Exp $ */
/* $NetBSD: irix_signal.c,v 1.18 2002/07/04 23:32:10 thorpej Exp $ */
/*-
* Copyright (c) 1994, 2001-2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_signal.c,v 1.17 2002/06/22 13:02:39 manu Exp $");
__KERNEL_RCSID(0, "$NetBSD: irix_signal.c,v 1.18 2002/07/04 23:32:10 thorpej Exp $");
#include <sys/types.h>
#include <sys/signal.h>
@ -175,8 +175,7 @@ irix_to_native_sigset(sss, bss)
}
void
irix_sendsig(catcher, sig, mask, code)
sig_t catcher;
irix_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -186,6 +185,7 @@ irix_sendsig(catcher, sig, mask, code)
struct frame *f;
int onstack;
int error;
sig_t catcher = SIGACTION(p, sig).sa_handler;
struct irix_sigframe sf;
f = (struct frame *)p->p_md.md_regs;

View File

@ -1,4 +1,4 @@
/* $NetBSD: irix_signal.h,v 1.10 2002/04/14 21:50:50 manu Exp $ */
/* $NetBSD: irix_signal.h,v 1.11 2002/07/04 23:32:10 thorpej Exp $ */
/*-
* Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@ -183,7 +183,7 @@ void native_to_irix_sigset __P((const sigset_t *, irix_sigset_t *));
void irix_to_native_sigset __P((const irix_sigset_t *, sigset_t *));
void irix_sendsig __P((sig_t, int, sigset_t *, u_long));
void irix_sendsig __P((int, sigset_t *, u_long));
__END_DECLS
#endif /* _KERNEL */

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.23 2002/03/31 22:22:45 christos Exp $ */
/* $NetBSD: linux_machdep.c,v 1.24 2002/07/04 23:32:10 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.23 2002/03/31 22:22:45 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.24 2002/07/04 23:32:10 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -316,14 +316,14 @@ void setup_linux_sigframe(tf, sig, mask)
* specified pc, psl.
*/
void
linux_sendsig(catcher, sig, mask, code)
sig_t catcher;
linux_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct trapframe *tf = p->p_md.md_tf;
sig_t catcher = SIGACTION(p, sig).sa_handler;
#ifdef notyet
struct linux_emuldata *edp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.8 2002/05/20 06:26:46 jdolecek Exp $ */
/* $NetBSD: linux_machdep.c,v 1.9 2002/07/04 23:32:10 thorpej Exp $ */
/*-
* Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/param.h>
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.8 2002/05/20 06:26:46 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.9 2002/07/04 23:32:10 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -95,8 +95,7 @@ process_frame(struct proc *p)
}
void
linux_sendsig(catcher, sig, mask, code)
sig_t catcher;
linux_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -105,6 +104,7 @@ linux_sendsig(catcher, sig, mask, code)
struct trapframe *tf;
struct linux_sigframe *fp, frame;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = process_frame(p);

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.77 2002/05/20 06:22:43 jdolecek Exp $ */
/* $NetBSD: linux_machdep.c,v 1.78 2002/07/04 23:32:10 thorpej Exp $ */
/*-
* Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.77 2002/05/20 06:22:43 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.78 2002/07/04 23:32:10 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@ -185,8 +185,7 @@ linux_setregs(p, epp, stack)
*/
void
linux_sendsig(catcher, sig, mask, code)
sig_t catcher;
linux_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -195,6 +194,7 @@ linux_sendsig(catcher, sig, mask, code)
struct trapframe *tf;
struct linux_sigframe *fp, frame;
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
tf = p->p_md.md_regs;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.h,v 1.21 2002/02/15 16:48:00 christos Exp $ */
/* $NetBSD: linux_machdep.h,v 1.22 2002/07/04 23:32:10 thorpej Exp $ */
/*-
* Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
@ -86,7 +86,7 @@ struct linux_sigframe {
#ifdef _KERNEL
__BEGIN_DECLS
void linux_sendsig __P((sig_t, int, sigset_t *, u_long));
void linux_sendsig __P((int, sigset_t *, u_long));
__END_DECLS
#endif /* _KERNEL */

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.13 2002/04/08 13:27:37 christos Exp $ */
/* $NetBSD: linux_machdep.c,v 1.14 2002/07/04 23:32:11 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.13 2002/04/08 13:27:37 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.14 2002/07/04 23:32:11 thorpej Exp $");
#define COMPAT_LINUX 1
@ -448,8 +448,7 @@ setup_linux_rt_sigframe(frame, sig, mask, usp, p)
* Send an interrupt to Linux process.
*/
void
linux_sendsig(catcher, sig, mask, code)
sig_t catcher;
linux_sendsig(sig, mask, code)
int sig;
sigset_t *mask;
u_long code;
@ -458,6 +457,7 @@ linux_sendsig(catcher, sig, mask, code)
struct frame *frame;
caddr_t usp; /* user stack for signal context */
int onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
frame = (struct frame *)p->p_md.md_regs;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.14 2002/05/20 06:26:47 jdolecek Exp $ */
/* $NetBSD: linux_machdep.c,v 1.15 2002/07/04 23:32:11 thorpej Exp $ */
/*-
* Copyright (c) 1995, 2000, 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.14 2002/05/20 06:26:47 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.15 2002/07/04 23:32:11 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -121,8 +121,7 @@ linux_setregs(p, pack, stack)
*/
void
linux_sendsig(catcher, sig, mask, code) /* XXX Check me */
sig_t catcher;
linux_sendsig(sig, mask, code) /* XXX Check me */
int sig;
sigset_t *mask;
u_long code;
@ -131,6 +130,7 @@ linux_sendsig(catcher, sig, mask, code) /* XXX Check me */
struct linux_sigframe *fp;
struct frame *f;
int i,onstack;
sig_t catcher = SIGACTION(p, sig).sa_handler;
struct linux_sigframe sf;
#ifdef DEBUG_LINUX

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.15 2002/05/20 06:26:47 jdolecek Exp $ */
/* $NetBSD: linux_machdep.c,v 1.16 2002/07/04 23:32:11 thorpej Exp $ */
/*-
* Copyright (c) 1995, 2000, 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.15 2002/05/20 06:26:47 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.16 2002/07/04 23:32:11 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -117,14 +117,14 @@ linux_setregs(p, pack, stack)
*/
void
linux_sendsig(catcher, sig, mask, code) /* XXX Check me */
sig_t catcher;
linux_sendsig(sig, mask, code) /* XXX Check me */
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct trapframe *tf;
sig_t catcher = SIGACTION(p, sig).sa_handler;
struct linux_sigregs frame;
struct linux_pt_regs linux_regs;
struct linux_sigcontext sc;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.h,v 1.6 2002/02/15 16:48:02 christos Exp $ */
/* $NetBSD: linux_machdep.h,v 1.7 2002/07/04 23:32:11 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -57,7 +57,7 @@
#ifdef _KERNEL
__BEGIN_DECLS
void linux_sendsig __P((sig_t, int, sigset_t *, u_long));
void linux_sendsig __P((int, sigset_t *, u_long));
dev_t linux_fakedev __P((dev_t, int));
__END_DECLS
#endif /* !_KERNEL */

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_sig_notalpha.c,v 1.25 2002/03/31 22:22:47 christos Exp $ */
/* $NetBSD: linux_sig_notalpha.c,v 1.26 2002/07/04 23:32:11 thorpej Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_sig_notalpha.c,v 1.25 2002/03/31 22:22:47 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_sig_notalpha.c,v 1.26 2002/07/04 23:32:11 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -91,7 +91,7 @@ linux_sys_signal(p, v, retval)
sigemptyset(&nbsa.sa_mask);
nbsa.sa_flags = SA_RESETHAND | SA_NODEFER;
error = sigaction1(p, linux_to_native_signo[sig],
&nbsa, &obsa);
&nbsa, &obsa, NULL, 0);
if (error == 0)
*retval = (int)obsa.sa_handler;
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_sigaction.c,v 1.23 2002/03/31 22:22:47 christos Exp $ */
/* $NetBSD: linux_sigaction.c,v 1.24 2002/07/04 23:32:11 thorpej Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_sigaction.c,v 1.23 2002/03/31 22:22:47 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_sigaction.c,v 1.24 2002/07/04 23:32:11 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -101,7 +101,8 @@ linux_sys_sigaction(p, v, retval)
obsa.sa_flags = 0;
} else {
error = sigaction1(p, linux_to_native_signo[sig],
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0);
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0,
NULL, 0);
if (error)
return (error);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_signal.c,v 1.37 2002/03/31 22:22:47 christos Exp $ */
/* $NetBSD: linux_signal.c,v 1.38 2002/07/04 23:32:12 thorpej Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.37 2002/03/31 22:22:47 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.38 2002/07/04 23:32:12 thorpej Exp $");
#define COMPAT_LINUX 1
@ -321,7 +321,9 @@ linux_sys_rt_sigaction(p, v, retval)
obsa.sa_flags = 0;
} else {
error = sigaction1(p, linux_to_native_signo[sig],
SCARG(uap, nsa) ? &nbsa : NULL, SCARG(uap, osa) ? &obsa : NULL);
SCARG(uap, nsa) ? &nbsa : NULL,
SCARG(uap, osa) ? &obsa : NULL,
NULL, 0);
if (error)
return (error);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_signal.c,v 1.2 2001/11/13 02:09:07 lukem Exp $ */
/* $NetBSD: netbsd32_signal.c,v 1.3 2002/07/04 23:32:12 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.2 2001/11/13 02:09:07 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.3 2002/07/04 23:32:12 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -68,7 +68,8 @@ netbsd32_sigaction(p, v, retval)
}
error = sigaction1(p, SCARG(uap, signum),
SCARG(uap, nsa) ? &nsa : 0,
SCARG(uap, osa) ? &osa : 0);
SCARG(uap, osa) ? &osa : 0,
NULL, 0);
if (error)
return (error);
@ -148,7 +149,8 @@ netbsd32___sigaction14(p, v, retval)
nsa.sa_flags = sa32.sa_flags;
}
error = sigaction1(p, SCARG(uap, signum),
SCARG(uap, nsa) ? &nsa : 0, SCARG(uap, osa) ? &osa : 0);
SCARG(uap, nsa) ? &nsa : 0, SCARG(uap, osa) ? &osa : 0,
NULL, 0);
if (error)
return (error);
if (SCARG(uap, osa)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos.h,v 1.12 2001/02/02 07:11:09 mrg Exp $ */
/* $NetBSD: sunos.h,v 1.13 2002/07/04 23:32:12 thorpej Exp $ */
#ifndef _COMPAT_SUNOS_SUNOS_H_
#define _COMPAT_SUNOS_SUNOS_H_
@ -154,7 +154,7 @@ struct sunos_audio_info {
__BEGIN_DECLS
/* Defined in arch/<arch>/sunos_machdep.c */
void sunos_sendsig __P((sig_t, int, sigset_t *, u_long));
void sunos_sendsig __P((int, sigset_t *, u_long));
__END_DECLS
#endif /* _COMPAT_SUNOS_SUNOS_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos_misc.c,v 1.114 2002/03/16 20:43:56 christos Exp $ */
/* $NetBSD: sunos_misc.c,v 1.115 2002/07/04 23:32:12 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.114 2002/03/16 20:43:56 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.115 2002/07/04 23:32:12 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_nfsserver.h"
@ -1335,7 +1335,8 @@ sunos_sys_sigvec(p, v, retval)
}
error = sigaction1(p, SCARG(uap, signum),
SCARG(uap, nsv) ? &nsa : 0,
SCARG(uap, osv) ? &osa : 0);
SCARG(uap, osv) ? &osa : 0,
NULL, 0);
if (error != 0)
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos32.h,v 1.1 2001/02/02 07:28:54 mrg Exp $ */
/* $NetBSD: sunos32.h,v 1.2 2002/07/04 23:32:12 thorpej Exp $ */
/*
* Copyright (c) 2001 Matthew R. Green
@ -57,7 +57,7 @@ typedef u_int32_t sunos32_utsnamep_t;
*/
__BEGIN_DECLS
/* Defined in arch/<arch>/sunos_machdep.c */
void sunos32_sendsig __P((sig_t, int, sigset_t *, u_long));
void sunos32_sendsig __P((int, sigset_t *, u_long));
__END_DECLS
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos32_misc.c,v 1.12 2002/03/16 20:43:56 christos Exp $ */
/* $NetBSD: sunos32_misc.c,v 1.13 2002/07/04 23:32:12 thorpej Exp $ */
/* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp */
/*
@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.12 2002/03/16 20:43:56 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.13 2002/07/04 23:32:12 thorpej Exp $");
#define COMPAT_SUNOS 1
@ -1607,7 +1607,8 @@ sunos32_sys_sigvec(p, v, retval)
}
error = sigaction1(p, SCARG(uap, signum),
SCARG(uap, nsv) ? &nsa : 0,
SCARG(uap, osv) ? &osa : 0);
SCARG(uap, osv) ? &osa : 0,
NULL, 0);
if (error != 0)
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_signal.c,v 1.45 2002/04/12 17:37:30 manu Exp $ */
/* $NetBSD: svr4_signal.c,v 1.46 2002/07/04 23:32:13 thorpej Exp $ */
/*-
* Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.45 2002/04/12 17:37:30 manu Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.46 2002/07/04 23:32:13 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -231,7 +231,8 @@ svr4_sys_sigaction(p, v, retval)
svr4_to_native_sigaction(&nssa, &nbsa);
}
error = sigaction1(p, svr4_to_native_signo[SCARG(uap, signum)],
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0);
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0,
NULL, 0);
if (error)
return (error);
if (SCARG(uap, osa)) {
@ -307,7 +308,7 @@ svr4_sys_signal(p, v, retval)
nbsa.sa_handler = (sig_t)SCARG(uap, handler);
sigemptyset(&nbsa.sa_mask);
nbsa.sa_flags = 0;
error = sigaction1(p, signum, &nbsa, &obsa);
error = sigaction1(p, signum, &nbsa, &obsa, NULL, 0);
if (error)
return (error);
*retval = (u_int)(u_long)obsa.sa_handler;
@ -328,7 +329,7 @@ svr4_sys_signal(p, v, retval)
nbsa.sa_handler = SIG_IGN;
sigemptyset(&nbsa.sa_mask);
nbsa.sa_flags = 0;
return (sigaction1(p, signum, &nbsa, 0));
return (sigaction1(p, signum, &nbsa, 0, NULL, 0));
case SVR4_SIGPAUSE_MASK:
ss = p->p_sigctx.ps_sigmask;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_signal.h,v 1.21 2002/03/31 22:22:49 christos Exp $ */
/* $NetBSD: svr4_signal.h,v 1.22 2002/07/04 23:32:13 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -139,7 +139,7 @@ void native_to_svr4_sigset __P((const sigset_t *, svr4_sigset_t *));
void svr4_to_native_sigset __P((const svr4_sigset_t *, sigset_t *));
void native_to_svr4_sigaltstack __P((const struct sigaltstack *, struct svr4_sigaltstack *));
void svr4_to_native_sigaltstack __P((const struct svr4_sigaltstack *, struct sigaltstack *));
void svr4_sendsig __P((sig_t, int, sigset_t *, u_long));
void svr4_sendsig __P((int, sigset_t *, u_long));
/* sys_context() function codes */
#define SVR4_GETCONTEXT 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_signal.c,v 1.6 2002/03/31 22:22:50 christos Exp $ */
/* $NetBSD: svr4_32_signal.c,v 1.7 2002/07/04 23:32:13 thorpej Exp $ */
/*-
* Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.6 2002/03/31 22:22:50 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.7 2002/07/04 23:32:13 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_svr4.h"
@ -369,7 +369,8 @@ svr4_32_sys_sigaction(p, v, retval)
svr4_32_to_native_sigaction(&nssa, &nbsa);
}
error = sigaction1(p, svr4_to_native_signo[SCARG(uap, signum)],
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0);
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0,
NULL, 0);
if (error)
return (error);
if (SCARG(uap, osa)) {
@ -448,7 +449,7 @@ svr4_32_sys_signal(p, v, retval)
nbsa.sa_handler = (sig_t)SCARG(uap, handler);
sigemptyset(&nbsa.sa_mask);
nbsa.sa_flags = 0;
error = sigaction1(p, signum, &nbsa, &obsa);
error = sigaction1(p, signum, &nbsa, &obsa, NULL, 0);
if (error)
return (error);
*retval = (u_int)(u_long)obsa.sa_handler;
@ -469,7 +470,7 @@ svr4_32_sys_signal(p, v, retval)
nbsa.sa_handler = SIG_IGN;
sigemptyset(&nbsa.sa_mask);
nbsa.sa_flags = 0;
return (sigaction1(p, signum, &nbsa, 0));
return (sigaction1(p, signum, &nbsa, 0, NULL, 0));
case SVR4_SIGPAUSE_MASK:
ss = p->p_sigctx.ps_sigmask;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_signal.h,v 1.2 2001/02/28 15:58:35 eeh Exp $ */
/* $NetBSD: svr4_32_signal.h,v 1.3 2002/07/04 23:32:14 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -73,6 +73,6 @@ void native_to_svr4_32_sigset __P((const sigset_t *, svr4_32_sigset_t *));
void svr4_32_to_native_sigset __P((const svr4_32_sigset_t *, sigset_t *));
void native_to_svr4_32_sigaltstack __P((const struct sigaltstack *, struct svr4_32_sigaltstack *));
void svr4_32_to_native_sigaltstack __P((const struct svr4_32_sigaltstack *, struct sigaltstack *));
void svr4_32_sendsig __P((sig_t, int, sigset_t *, u_long));
void svr4_32_sendsig __P((int, sigset_t *, u_long));
#endif /* !_SVR4_32_SIGNAL_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ultrix_misc.c,v 1.76 2002/03/16 23:55:57 christos Exp $ */
/* $NetBSD: ultrix_misc.c,v 1.77 2002/07/04 23:32:14 thorpej Exp $ */
/*
* Copyright (c) 1995, 1997 Jonathan Stone (hereinafter referred to as the author)
@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.76 2002/03/16 23:55:57 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.77 2002/07/04 23:32:14 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_nfsserver.h"
@ -744,7 +744,8 @@ ultrix_sys_sigvec(p, v, retval)
native_sigset13_to_sigset(&nsv.sv_mask, &nsa.sa_mask);
}
error = sigaction1(p, SCARG(uap, signum),
SCARG(uap, nsv) ? &nsa : 0, SCARG(uap, osv) ? &osa : 0);
SCARG(uap, nsv) ? &nsa : 0, SCARG(uap, osv) ? &osa : 0,
NULL, 0);
if (error)
return (error);
if (SCARG(uap, osv)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sig.c,v 1.120 2002/03/08 20:48:40 thorpej Exp $ */
/* $NetBSD: kern_sig.c,v 1.121 2002/07/04 23:32:14 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.120 2002/03/08 20:48:40 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.121 2002/07/04 23:32:14 thorpej Exp $");
#include "opt_ktrace.h"
#include "opt_compat_sunos.h"
@ -169,7 +169,7 @@ sigactsfree(struct proc *p)
int
sigaction1(struct proc *p, int signum, const struct sigaction *nsa,
struct sigaction *osa)
struct sigaction *osa, void *tramp, int vers)
{
struct sigacts *ps;
int prop;
@ -178,6 +178,16 @@ sigaction1(struct proc *p, int signum, const struct sigaction *nsa,
if (signum <= 0 || signum >= NSIG)
return (EINVAL);
/*
* Trampoline ABI version 0 is reserved for the legacy
* kernel-provided on-stack trampoline. Conversely, if
* we are using a non-0 ABI version, we must have a
* trampoline.
*/
if ((vers != 0 && tramp == NULL) ||
(vers == 0 && tramp != NULL))
return (EINVAL);
if (osa)
*osa = SIGACTION_PS(ps, signum);
@ -191,6 +201,8 @@ sigaction1(struct proc *p, int signum, const struct sigaction *nsa,
(void) splsched(); /* XXXSMP */
SIGACTION_PS(ps, signum) = *nsa;
ps->sa_sigdesc[signum].sd_tramp = tramp;
ps->sa_sigdesc[signum].sd_vers = vers;
sigminusset(&sigcantmask, &SIGACTION_PS(ps, signum).sa_mask);
if ((prop & SA_NORESET) != 0)
SIGACTION_PS(ps, signum).sa_flags &= ~SA_RESETHAND;
@ -263,7 +275,40 @@ sys___sigaction14(struct proc *p, void *v, register_t *retval)
return (error);
}
error = sigaction1(p, SCARG(uap, signum),
SCARG(uap, nsa) ? &nsa : 0, SCARG(uap, osa) ? &osa : 0);
SCARG(uap, nsa) ? &nsa : 0, SCARG(uap, osa) ? &osa : 0,
NULL, 0);
if (error)
return (error);
if (SCARG(uap, osa)) {
error = copyout(&osa, SCARG(uap, osa), sizeof(osa));
if (error)
return (error);
}
return (0);
}
/* ARGSUSED */
int
sys___sigaction_sigtramp(struct proc *p, void *v, register_t *retval)
{
struct sys___sigaction_sigtramp_args /* {
syscallarg(int) signum;
syscallarg(const struct sigaction *) nsa;
syscallarg(struct sigaction *) osa;
syscallarg(void *) tramp;
syscallarg(int) vers;
} */ *uap = v;
struct sigaction nsa, osa;
int error;
if (SCARG(uap, nsa)) {
error = copyin(SCARG(uap, nsa), &nsa, sizeof(nsa));
if (error)
return (error);
}
error = sigaction1(p, SCARG(uap, signum),
SCARG(uap, nsa) ? &nsa : 0, SCARG(uap, osa) ? &osa : 0,
SCARG(uap, tramp), SCARG(uap, vers));
if (error)
return (error);
if (SCARG(uap, osa)) {
@ -689,8 +734,8 @@ trapsignal(struct proc *p, int signum, u_long code)
SIGACTION_PS(ps, signum).sa_handler,
&p->p_sigctx.ps_sigmask, code);
#endif
(*p->p_emul->e_sendsig)(SIGACTION_PS(ps, signum).sa_handler,
signum, &p->p_sigctx.ps_sigmask, code);
(*p->p_emul->e_sendsig)(signum, &p->p_sigctx.ps_sigmask,
code);
(void) splsched(); /* XXXSMP */
sigplusset(&SIGACTION_PS(ps, signum).sa_mask,
&p->p_sigctx.ps_sigmask);
@ -1242,7 +1287,7 @@ postsig(int signum)
p->p_sigctx.ps_code = 0;
p->p_sigctx.ps_sig = 0;
}
(*p->p_emul->e_sendsig)(action, signum, returnmask, code);
(*p->p_emul->e_sendsig)(signum, returnmask, code);
(void) splsched(); /* XXXSMP */
sigplusset(&SIGACTION_PS(ps, signum).sa_mask,
&p->p_sigctx.ps_sigmask);

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.111 2002/05/03 00:20:56 eeh Exp $
$NetBSD: syscalls.master,v 1.112 2002/07/04 23:32:14 thorpej Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@ -649,3 +649,7 @@
337 UNIMPL
338 UNIMPL
339 UNIMPL
340 STD { int sys___sigaction_sigtramp(int signum, \
const struct sigaction *nsa, \
struct sigaction *osa, \
void *tramp, int vers); }

View File

@ -1,4 +1,4 @@
/* $NetBSD: proc.h,v 1.139 2002/07/02 20:27:47 yamt Exp $ */
/* $NetBSD: proc.h,v 1.140 2002/07/04 23:32:15 thorpej Exp $ */
/*-
* Copyright (c) 1986, 1989, 1991, 1993
@ -102,7 +102,7 @@ struct emul {
const struct sysent *e_sysent; /* System call array */
const char * const *e_syscallnames; /* System call name array */
/* Signal sending function */
void (*e_sendsig) __P((sig_t, int, sigset_t *, u_long));
void (*e_sendsig) __P((int, sigset_t *, u_long));
void (*e_trapsignal) __P((struct proc *, int, u_long));
char *e_sigcode; /* Start of sigcode */
char *e_esigcode; /* End of sigcode */

View File

@ -1,4 +1,4 @@
/* $NetBSD: signalvar.h,v 1.32 2002/03/19 20:50:41 christos Exp $ */
/* $NetBSD: signalvar.h,v 1.33 2002/07/04 23:32:15 thorpej Exp $ */
/*
* Copyright (c) 1991, 1993
@ -47,7 +47,11 @@
* Process signal actions, possibly shared between threads.
*/
struct sigacts {
struct sigaction sa_sigact[NSIG]; /* disposition of signals */
struct sigact_sigdesc {
struct sigaction sd_sigact;
void *sd_tramp;
int sd_vers;
} sa_sigdesc[NSIG]; /* disposition of signals */
int sa_refcnt; /* reference count */
};
@ -83,8 +87,8 @@ struct sigctx {
/*
* get signal action for process and signal; currently only for current process
*/
#define SIGACTION(p, sig) (p->p_sigacts->sa_sigact[(sig)])
#define SIGACTION_PS(ps, sig) (ps->sa_sigact[(sig)])
#define SIGACTION(p, sig) (p->p_sigacts->sa_sigdesc[(sig)].sd_sigact)
#define SIGACTION_PS(ps, sig) (ps->sa_sigdesc[(sig)].sd_sigact)
/*
* Mark that signals for a process need to be checked.
@ -218,7 +222,8 @@ void setsigvec __P((struct proc *, int, struct sigaction *));
int killpg1 __P((struct proc *, int, int, int));
int sigaction1 __P((struct proc *p, int signum, \
const struct sigaction *nsa, struct sigaction *osa));
const struct sigaction *nsa, struct sigaction *osa,
void *, int));
int sigprocmask1 __P((struct proc *p, int how, \
const sigset_t *nss, sigset_t *oss));
void sigpending1 __P((struct proc *p, sigset_t *ss));
@ -236,7 +241,7 @@ void sigactsfree __P((struct proc *));
/*
* Machine-dependent functions:
*/
void sendsig __P((sig_t action, int sig, sigset_t *returnmask, u_long code));
void sendsig __P((int sig, sigset_t *returnmask, u_long code));
struct core;
struct core32;
int cpu_coredump __P((struct proc *, struct vnode *, struct ucred *,