-/* $OpenBSD: freebsd_machdep.c,v 1.7 1996/08/27 10:46:51 downsj Exp $ */
+/* $OpenBSD: freebsd_machdep.c,v 1.8 1997/01/27 22:47:57 deraadt Exp $ */
/* $NetBSD: freebsd_machdep.c,v 1.10 1996/05/03 19:42:05 christos Exp $ */
/*-
* specified pc, psl.
*/
void
-freebsd_sendsig(catcher, sig, mask, code)
+freebsd_sendsig(catcher, sig, mask, code, addr)
sig_t catcher;
int sig, mask;
u_long code;
+ caddr_t addr;
{
register struct proc *p = curproc;
register struct trapframe *tf;
-/* $OpenBSD: linux_machdep.c,v 1.8 1996/05/07 07:21:42 deraadt Exp $ */
+/* $OpenBSD: linux_machdep.c,v 1.9 1997/01/27 22:47:58 deraadt Exp $ */
/* $NetBSD: linux_machdep.c,v 1.29 1996/05/03 19:42:11 christos Exp $ */
/*
*/
void
-linux_sendsig(catcher, sig, mask, code)
+linux_sendsig(catcher, sig, mask, code, addr)
sig_t catcher;
int sig, mask;
u_long code;
+ caddr_t addr;
{
register struct proc *p = curproc;
register struct trapframe *tf;
-/* $OpenBSD: machdep.c,v 1.35 1997/01/27 01:16:12 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.36 1997/01/27 22:47:59 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.202 1996/05/18 15:54:59 christos Exp $ */
/*-
}
#ifdef COMPAT_IBCS2
-void ibcs2_sendsig __P((sig_t, int, int, u_long));
+void ibcs2_sendsig __P((sig_t, int, int, u_long, caddr_t));
void
-ibcs2_sendsig(catcher, sig, mask, code)
+ibcs2_sendsig(catcher, sig, mask, code, addr)
sig_t catcher;
int sig, mask;
u_long code;
+ caddr_t addr;
{
extern int bsd_to_ibcs2_sig[];
- sendsig(catcher, bsd_to_ibcs2_sig[sig], mask, code);
+ sendsig(catcher, bsd_to_ibcs2_sig[sig], mask, code, addr);
}
#endif
* specified pc, psl.
*/
void
-sendsig(catcher, sig, mask, code)
+sendsig(catcher, sig, mask, code, addr)
sig_t catcher;
int sig, mask;
u_long code;
+ caddr_t addr;
{
register struct proc *p = curproc;
register struct trapframe *tf;
if (psp->ps_siginfo & sigmask(sig)) {
frame.sf_sip = &fp->sf_si;
initsiginfo(frame.sf_sip, sig);
- fixsiginfo(frame.sf_sip, sig, code, (caddr_t)rcr2());
+ fixsiginfo(frame.sf_sip, sig, code, addr);
if (sig == SIGSEGV) {
/* try to be more specific about read or write */
if (tf->tf_err & PGEX_W)
-/* $OpenBSD: svr4_machdep.c,v 1.8 1997/01/27 01:17:08 deraadt Exp $ */
+/* $OpenBSD: svr4_machdep.c,v 1.9 1997/01/27 22:48:00 deraadt Exp $ */
/* $NetBSD: svr4_machdep.c,v 1.24 1996/05/03 19:42:26 christos Exp $ */
/*
* will return to the user pc, psl.
*/
void
-svr4_sendsig(catcher, sig, mask, code)
+svr4_sendsig(catcher, sig, mask, code, addr)
sig_t catcher;
int sig, mask;
u_long code;
+ caddr_t addr;
{
register struct proc *p = curproc;
register struct trapframe *tf;
*/
svr4_getcontext(p, &frame.sf_uc, mask, oonstack);
- svr4_getsiginfo(&frame.sf_si, sig, code, (caddr_t) tf->tf_eip);
+ svr4_getsiginfo(&frame.sf_si, sig, code, addr);
frame.sf_signum = frame.sf_si.svr4_si_signo;
frame.sf_sip = &fp->sf_si;
-/* $OpenBSD: trap.c,v 1.13 1997/01/18 15:17:38 niklas Exp $ */
+/* $OpenBSD: trap.c,v 1.14 1997/01/27 22:48:01 deraadt Exp $ */
/* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */
#undef DEBUG
#endif
case T_SEGNPFLT|T_USER:
case T_STKFLT|T_USER:
- trapsignal(p, SIGSEGV, type &~ T_USER);
+ trapsignal(p, SIGSEGV, type &~ T_USER, (caddr_t)rcr2());
goto out;
case T_ALIGNFLT|T_USER:
- trapsignal(p, SIGBUS, type &~ T_USER);
+ trapsignal(p, SIGBUS, type &~ T_USER, (caddr_t)rcr2());
goto out;
case T_PRIVINFLT|T_USER: /* privileged instruction fault */
case T_FPOPFLT|T_USER: /* coprocessor operand fault */
- trapsignal(p, SIGILL, type &~ T_USER);
+ trapsignal(p, SIGILL, type &~ T_USER, (caddr_t)rcr2());
goto out;
case T_ASTFLT|T_USER: /* Allow process switch */
goto trace;
return;
}
- trapsignal(p, rv, type &~ T_USER);
+ trapsignal(p, rv, type &~ T_USER, (caddr_t)rcr2());
goto out;
#else
printf("pid %d killed due to lack of floating point\n",
p->p_pid);
- trapsignal(p, SIGKILL, type &~ T_USER);
+ trapsignal(p, SIGKILL, type &~ T_USER, (caddr_t)rcr2());
goto out;
#endif
}
case T_BOUND|T_USER:
case T_OFLOW|T_USER:
case T_DIVIDE|T_USER:
- trapsignal(p, SIGFPE, type &~ T_USER);
+ trapsignal(p, SIGFPE, type &~ T_USER, (caddr_t)rcr2());
goto out;
case T_ARITHTRAP|T_USER:
- trapsignal(p, SIGFPE, frame.tf_err);
+ trapsignal(p, SIGFPE, frame.tf_err, (caddr_t)rcr2());
goto out;
case T_PAGEFLT: /* allow page faults in kernel mode */
vm_prot_t ftype;
extern vm_map_t kernel_map;
unsigned nss, v;
+ caddr_t vv = (caddr_t)rcr2();
- va = trunc_page((vm_offset_t)rcr2());
+ va = trunc_page((vm_offset_t)vv);
/*
* It is only a kernel address space fault iff:
* 1. (type & T_USER) == 0 and
map, va, ftype, rv);
goto we_re_toast;
}
- trapsignal(p, SIGSEGV, T_PAGEFLT);
+ trapsignal(p, SIGSEGV, T_PAGEFLT, vv);
break;
}
#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE)
trace:
#endif
- trapsignal(p, SIGTRAP, type &~ T_USER);
+ trapsignal(p, SIGTRAP, type &~ T_USER, (caddr_t)rcr2());
break;
#include "isa.h"
sigexit(p, SIGILL);
/* NOTREACHED */
}
- trapsignal(p, SIGURG, retval);
+ trapsignal(p, SIGURG, retval, 0);
}
#define CLI 0xFA
}
if (trace && tf->tf_eflags & PSL_VM)
- trapsignal(p, SIGTRAP, T_TRCTRAP);
+ trapsignal(p, SIGTRAP, T_TRCTRAP, 0);
return;
bad:
/* sys/i386/include/exec.h */
#define FREEBSD___LDPGSZ 4096
-void freebsd_sendsig __P((sig_t, int, int, u_long));
+void freebsd_sendsig __P((sig_t, int, int, u_long, caddr_t));
#endif /* _FREEBSD_MACHDEP_H */
sig_t sf_handler;
};
-void linux_sendsig __P((sig_t, int, int, u_long));
+void linux_sendsig __P((sig_t, int, int, u_long, caddr_t));
dev_t linux_fakedev __P((dev_t));
/*
void svr4_getcontext __P((struct proc *, struct svr4_ucontext *,
int, int));
int svr4_setcontext __P((struct proc *p, struct svr4_ucontext *));
-void svr4_sendsig __P((sig_t, int, int, u_long));
+void svr4_sendsig __P((sig_t, int, int, u_long, caddr_t));
typedef struct {
svr4_gregset_t greg;
#else
code = 0; /* XXX */
#endif
- trapsignal(p, SIGFPE, code);
+ trapsignal(p, SIGFPE, code, 0);
} else {
/*
* Nested interrupt. These losers occur when:
-/* $OpenBSD: sunos_machdep.c,v 1.8 1997/01/13 11:51:14 niklas Exp $ */
+/* $OpenBSD: sunos_machdep.c,v 1.9 1997/01/27 22:48:13 deraadt Exp $ */
/* $NetBSD: sunos_machdep.c,v 1.12 1996/10/13 03:19:22 christos Exp $ */
/*
* SIG_DFL for "dangerous" signals.
*/
void
-sunos_sendsig(catcher, sig, mask, code)
+sunos_sendsig(catcher, sig, mask, code, addr)
sig_t catcher;
int sig, mask;
u_long code;
+ caddr_t addr;
{
register struct proc *p = curproc;
register struct sunos_sigframe *fp;
kfp.sf_signum = sig;
kfp.sf_code = code;
kfp.sf_scp = &fp->sf_sc;
- kfp.sf_addr = ~0; /* means: not computable */
+ kfp.sf_addr = (u_int)addr;
/*
* Build the signal context to be used by sigreturn.
-/* $OpenBSD: machdep.c,v 1.13 1997/01/16 20:43:38 kstailey Exp $ */
+/* $OpenBSD: machdep.c,v 1.14 1997/01/27 22:48:16 deraadt Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
int sf_signum; /* signo for handler */
int sf_code; /* additional info for handler */
struct sigcontext *sf_scp; /* context ptr for handler */
+ siginfo_t *sf_sip;
sig_t sf_handler; /* handler addr for u_sigc */
struct sigstate sf_state; /* state of the hardware */
struct sigcontext sf_sc; /* actual context */
+ siginfo_t sf_si;
};
#ifdef COMPAT_HPUX
* Send an interrupt to process.
*/
void
-sendsig(catcher, sig, mask, code)
+sendsig(catcher, sig, mask, code, addr)
sig_t catcher;
int sig, mask;
u_long code;
+ caddr_t addr;
{
register struct proc *p = curproc;
register struct sigframe *fp, *kfp;
kfp->sf_code = code;
kfp->sf_scp = &fp->sf_sc;
kfp->sf_handler = catcher;
+ kfp->sf_sip = NULL;
+
/*
* Save necessary hardware state. Currently this includes:
* - general registers
kfp->sf_sc.sc_ap = (int)&fp->sf_state;
kfp->sf_sc.sc_pc = frame->f_pc;
kfp->sf_sc.sc_ps = frame->f_sr;
+
+ if (psp->ps_siginfo & sigmask(sig)) {
+ kfp->sf_sip = &kfp->sf_si;
+ initsiginfo(kfp->sf_sip, sig);
+ fixsiginfo(kfp->sf_sip, sig, code, addr);
+ if (sig == SIGSEGV) {
+ /* try to be more specific about read or write */
+#if 0
+ if (WRFAULT(frame->f_pad))
+ kfp->sf_si.si_code |= SEGV_ACCERR;
+ else
+ kfp->sf_si.si_code |= SEGV_MAPERR;
+#endif
+ }
+ }
+
#ifdef COMPAT_HPUX
/*
* Create an HP-UX style sigcontext structure and associated goo
return (EJUSTRETURN);
}
+void
+fixsiginfo(si, sig, code, addr)
+ siginfo_t *si;
+ int sig;
+ u_long code;
+ caddr_t addr;
+{
+ si->si_addr = addr;
+
+ switch (code) {
+#if 0
+ case T_PRIVINFLT:
+ si->si_code = ILL_PRVOPC;
+ si->si_trapno = T_PRIVINFLT;
+ break;
+ case T_BREAKPOINT:
+ si->si_code = TRAP_BRKPT;
+ si->si_trapno = T_BREAKPOINT;
+ break;
+ case T_ARITHTRAP:
+ si->si_code = FPE_INTOVF;
+ si->si_trapno = T_DIVIDE;
+ break;
+ case T_PROTFLT:
+ si->si_code = SEGV_ACCERR;
+ si->si_trapno = T_PROTFLT;
+ break;
+ case T_TRCTRAP:
+ si->si_code = TRAP_TRACE;
+ si->si_trapno = T_TRCTRAP;
+ break;
+ case T_PAGEFLT:
+ si->si_code = SEGV_ACCERR;
+ si->si_trapno = T_PAGEFLT;
+ break;
+ case T_ALIGNFLT:
+ si->si_code = BUS_ADRALN;
+ si->si_trapno = T_ALIGNFLT;
+ break;
+ case T_DIVIDE:
+ si->si_code = FPE_FLTDIV;
+ si->si_trapno = T_DIVIDE;
+ break;
+ case T_OFLOW:
+ si->si_code = FPE_FLTOVF;
+ si->si_trapno = T_DIVIDE;
+ break;
+ case T_BOUND:
+ si->si_code = FPE_FLTSUB;
+ si->si_trapno = T_BOUND;
+ break;
+ case T_DNA:
+ si->si_code = FPE_FLTINV;
+ si->si_trapno = T_DNA;
+ break;
+ case T_FPOPFLT:
+ si->si_code = FPE_FLTINV;
+ si->si_trapno = T_FPOPFLT;
+ break;
+ case T_SEGNPFLT:
+ si->si_code = SEGV_MAPERR;
+ si->si_trapno = T_SEGNPFLT;
+ break;
+ case T_STKFLT:
+ si->si_code = ILL_BADSTK;
+ si->si_trapno = T_STKFLT;
+ break;
+#endif
+ }
+}
+
int waittime = -1;
static struct haltvec *halts;
-/* $OpenBSD: trap.c,v 1.8 1996/12/24 20:29:02 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.9 1997/01/27 22:48:17 deraadt Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
} else if (sig = writeback(fp, fromtrap)) {
beenhere = 1;
oticks = p->p_sticks;
- trapsignal(p, sig, faultaddr);
+ trapsignal(p, sig, T_MMUFLT, (caddr_t)faultaddr);
goto again;
}
}
case T_BUSERR|T_USER: /* bus error */
case T_ADDRERR|T_USER: /* address error */
- ucode = v;
+ ucode = code & ~T_USER;
i = SIGBUS;
break;
type, code);
goto dopanic;
}
- ucode = v;
+ frame.f_pad = code & 0xffff;
+ ucode = T_MMUFLT;
i = SIGSEGV;
break;
}
}
- trapsignal(p, i, ucode);
+ trapsignal(p, i, ucode, (caddr_t)v);
if ((type & T_USER) == 0)
return;
out:
/* XXX missing trap address! */
if ((i = fsr & FSR_CX) == 0)
panic("fpu ieee trap, but no exception");
- trapsignal(p, SIGFPE, fpu_codes[i - 1]);
+ trapsignal(p, SIGFPE, fpu_codes[i - 1], 0);
break; /* XXX should return, but queue remains */
case FSR_TT_UNFIN:
log(LOG_ERR, "fpu hardware error (%s[%d])\n",
p->p_comm, p->p_pid);
uprintf("%s[%d]: fpu hardware error\n", p->p_comm, p->p_pid);
- trapsignal(p, SIGFPE, -1); /* ??? */
+ trapsignal(p, SIGFPE, -1, 0); /* ??? */
goto out;
default:
case FPE:
trapsignal(p, SIGFPE,
- fpu_codes[(fs->fs_fsr & FSR_CX) - 1]);
+ fpu_codes[(fs->fs_fsr & FSR_CX) - 1], 0);
break;
case NOTFPU:
- trapsignal(p, SIGILL, 0); /* ??? code? */
+ trapsignal(p, SIGILL, 0, 0); /* ??? code? */
break;
default:
void svr4_getcontext __P((struct proc *, struct svr4_ucontext *,
int, int));
int svr4_setcontext __P((struct proc *p, struct svr4_ucontext *));
-void svr4_sendsig __P((sig_t, int, int, u_long));
+void svr4_sendsig __P((sig_t, int, int, u_long, caddr_t));
int svr4_trap __P((int, struct proc *));
#endif /* !_SPARC_SVR4_MACHDEP_H_ */
#else
int sf_xxx; /* placeholder */
#endif
- int sf_addr; /* SunOS compat, always 0 for now */
+ union {
+ int sfu_addr; /* SunOS compat */
+ siginfo_t *sfu_sip; /* native */
+ } sf_u;
struct sigcontext sf_sc; /* actual sigcontext */
+ siginfo_t sf_si;
};
/*
* Send an interrupt to process.
*/
void
-sendsig(catcher, sig, mask, code)
+sendsig(catcher, sig, mask, code, addr)
sig_t catcher;
int sig, mask;
u_long code;
+ caddr_t addr;
{
register struct proc *p = curproc;
register struct sigacts *psp = p->p_sigacts;
register struct sigframe *fp;
register struct trapframe *tf;
- register int addr, oonstack, oldsp, newsp;
+ register int caddr, oonstack, oldsp, newsp;
struct sigframe sf;
extern char sigcode[], esigcode[];
#define szsigcode (esigcode - sigcode)
+#ifdef COMPAT_SUNOS
+ extern struct emul emul_sunos;
+#endif
tf = p->p_md.md_tf;
oldsp = tf->tf_out[6];
*/
sf.sf_signo = sig;
sf.sf_code = code;
+ sf.sf_u.sfu_sip = NULL;
#ifdef COMPAT_SUNOS
- sf.sf_scp = &fp->sf_sc;
+ if (p->p_emul == &emul_sunos) {
+ sf.sf_scp = &fp->sf_sc;
+ sf.sf_u.sfu_addr = (u_int)addr;
+ }
#endif
- sf.sf_addr = 0; /* XXX */
/*
* Build the signal context to be used by sigreturn.
sf.sf_sc.sc_g1 = tf->tf_global[1];
sf.sf_sc.sc_o0 = tf->tf_out[0];
+ if (psp->ps_siginfo & sigmask(sig)) {
+ sf.sf_u.sfu_sip = &fp->sf_si;
+ initsiginfo(sf.sf_u.sfu_sip, sig);
+ fixsiginfo(sf.sf_u.sfu_sip, sig, code, addr);
+#if 0
+ if (sig == SIGSEGV) {
+ /* try to be more specific about read or write */
+ if (tf->tf_err & PGEX_W)
+ sf.sf_si.si_code = SEGV_ACCERR;
+ else
+ sf.sf_si.si_code = SEGV_MAPERR;
+ }
+#endif
+ }
+
/*
* Put the stack in a consistent state before we whack away
* at it. Note that write_user_windows may just dump the
*/
#ifdef COMPAT_SUNOS
if (psp->ps_usertramp & sigmask(sig)) {
- addr = (int)catcher; /* user does his own trampolining */
+ caddr = (int)catcher; /* user does his own trampolining */
} else
#endif
{
- addr = (int)PS_STRINGS - szsigcode;
+ caddr = (int)PS_STRINGS - szsigcode;
tf->tf_global[1] = (int)catcher;
}
- tf->tf_pc = addr;
- tf->tf_npc = addr + 4;
+ tf->tf_pc = caddr;
+ tf->tf_npc = caddr + 4;
tf->tf_out[6] = newsp;
#ifdef DEBUG
if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
return (EJUSTRETURN);
}
+void
+fixsiginfo(si, sig, code, addr)
+ siginfo_t *si;
+ int sig;
+ u_long code;
+ caddr_t addr;
+{
+ si->si_addr = addr;
+
+#if 0
+ switch (code) {
+ case T_PRIVINFLT:
+ si->si_code = ILL_PRVOPC;
+ si->si_trapno = T_PRIVINFLT;
+ break;
+ case T_BPTFLT:
+ si->si_code = TRAP_BRKPT;
+ si->si_trapno = T_BPTFLT;
+ break;
+ case T_ARITHTRAP:
+ si->si_code = FPE_INTOVF;
+ si->si_trapno = T_DIVIDE;
+ break;
+ case T_PROTFLT:
+ si->si_code = SEGV_ACCERR;
+ si->si_trapno = T_PROTFLT;
+ break;
+ case T_TRCTRAP:
+ si->si_code = TRAP_TRACE;
+ si->si_trapno = T_TRCTRAP;
+ break;
+ case T_PAGEFLT:
+ si->si_code = SEGV_ACCERR;
+ si->si_trapno = T_PAGEFLT;
+ break;
+ case T_ALIGNFLT:
+ si->si_code = BUS_ADRALN;
+ si->si_trapno = T_ALIGNFLT;
+ break;
+ case T_DIVIDE:
+ si->si_code = FPE_FLTDIV;
+ si->si_trapno = T_DIVIDE;
+ break;
+ case T_OFLOW:
+ si->si_code = FPE_FLTOVF;
+ si->si_trapno = T_DIVIDE;
+ break;
+ case T_BOUND:
+ si->si_code = FPE_FLTSUB;
+ si->si_trapno = T_BOUND;
+ break;
+ case T_DNA:
+ si->si_code = FPE_FLTINV;
+ si->si_trapno = T_DNA;
+ break;
+ case T_FPOPFLT:
+ si->si_code = FPE_FLTINV;
+ si->si_trapno = T_FPOPFLT;
+ break;
+ case T_SEGNPFLT:
+ si->si_code = SEGV_MAPERR;
+ si->si_trapno = T_SEGNPFLT;
+ break;
+ case T_STKFLT:
+ si->si_code = ILL_BADSTK;
+ si->si_trapno = T_STKFLT;
+ break;
+ }
+#endif
+}
+
int waittime = -1;
void
* will return to the user pc, psl.
*/
void
-svr4_sendsig(catcher, sig, mask, code)
+svr4_sendsig(catcher, sig, mask, code, addr)
sig_t catcher;
int sig, mask;
u_long code;
+ caddr_t addr;
{
register struct proc *p = curproc;
register struct trapframe *tf;
struct svr4_sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
- int oonstack, oldsp, newsp, addr;
+ int oonstack, oldsp, newsp, caddr;
extern char svr4_sigcode[], svr4_esigcode[];
/*
* Build the argument list for the signal handler.
*/
- svr4_getsiginfo(&frame.sf_si, sig, code, (caddr_t) tf->tf_pc);
+ svr4_getsiginfo(&frame.sf_si, sig, code, addr);
svr4_getcontext(p, &frame.sf_uc, mask, oonstack);
frame.sf_signum = frame.sf_si.svr4_si_signo;
frame.sf_sip = &fp->sf_si;
/*
* Build context to run handler in.
*/
- addr = (int)PS_STRINGS - (svr4_esigcode - svr4_sigcode);
+ caddr = (int)PS_STRINGS - (svr4_esigcode - svr4_sigcode);
tf->tf_global[1] = (int)catcher;
- tf->tf_pc = addr;
- tf->tf_npc = addr + 4;
+ tf->tf_pc = caddr;
+ tf->tf_npc = caddr + 4;
tf->tf_out[6] = newsp;
}
/* ... but leave it in until we find anything */
printf("%s[%d]: unimplemented software trap 0x%x\n",
p->p_comm, p->p_pid, type);
- trapsignal(p, SIGILL, type);
+ trapsignal(p, SIGILL, type, (caddr_t)pc);
break;
#ifdef COMPAT_SVR4
break; /* the work is all in userret() */
case T_ILLINST:
- trapsignal(p, SIGILL, 0); /* XXX code?? */
+ trapsignal(p, SIGILL, 0, (caddr_t)pc); /* XXX code?? */
break;
case T_PRIVINST:
- trapsignal(p, SIGILL, 0); /* XXX code?? */
+ trapsignal(p, SIGILL, 0, (caddr_t)pc); /* XXX code?? */
break;
case T_FPDISABLED: {
fpu_emulate(p, tf, fs);
break;
#else
- trapsignal(p, SIGFPE, 0); /* XXX code?? */
+ trapsignal(p, SIGFPE, 0, (caddr_t)pc); /* XXX code?? */
break;
#endif
}
break;
case T_ALIGN:
- trapsignal(p, SIGBUS, 0); /* XXX code?? */
+ trapsignal(p, SIGBUS, 0, (caddr_t)pc); /* XXX code?? */
break;
case T_FPE:
break;
case T_TAGOF:
- trapsignal(p, SIGEMT, 0); /* XXX code?? */
+ trapsignal(p, SIGEMT, 0, (caddr_t)pc); /* XXX code?? */
break;
case T_CPDISABLED:
uprintf("coprocessor instruction\n"); /* XXX */
- trapsignal(p, SIGILL, 0); /* XXX code?? */
+ trapsignal(p, SIGILL, 0, (caddr_t)pc); /* XXX code?? */
break;
case T_BREAKPOINT:
- trapsignal(p, SIGTRAP, 0);
+ trapsignal(p, SIGTRAP, 0, (caddr_t)pc);
break;
case T_DIV0:
ADVANCE;
- trapsignal(p, SIGFPE, FPE_INTDIV_TRAP);
+ trapsignal(p, SIGFPE, FPE_INTDIV_TRAP, (caddr_t)pc);
break;
case T_FLUSHWIN:
case T_RANGECHECK:
uprintf("T_RANGECHECK\n"); /* XXX */
ADVANCE;
- trapsignal(p, SIGILL, 0); /* XXX code?? */
+ trapsignal(p, SIGILL, 0, (caddr_t)pc); /* XXX code?? */
break;
case T_FIXALIGN:
case T_INTOF:
uprintf("T_INTOF\n"); /* XXX */
ADVANCE;
- trapsignal(p, SIGFPE, FPE_INTOVF_TRAP);
+ trapsignal(p, SIGFPE, FPE_INTOVF_TRAP, (caddr_t)pc);
break;
}
userret(p, pc, sticks);
tf->tf_npc = onfault + 4;
return;
}
- trapsignal(p, SIGSEGV, (u_int)v);
+ trapsignal(p, SIGSEGV, (u_int)v, (caddr_t)v);
}
out:
if ((psr & PSR_PS) == 0) {
tf->tf_npc = onfault + 4;
return;
}
- trapsignal(p, SIGSEGV, (u_int)sfva);
+ trapsignal(p, SIGSEGV, (u_int)sfva, (caddr_t)sfva);
}
out:
if ((psr & PSR_PS) == 0) {
-/* $OpenBSD: ibcs2_exec.c,v 1.5 1997/01/23 16:12:16 niklas Exp $ */
+/* $OpenBSD: ibcs2_exec.c,v 1.6 1997/01/27 22:48:30 deraadt Exp $ */
/* $NetBSD: ibcs2_exec.c,v 1.12 1996/10/12 02:13:52 thorpej Exp $ */
/*
extern int bsd2ibcs_errno[];
extern struct sysent ibcs2_sysent[];
extern char *ibcs2_syscallnames[];
-extern void ibcs2_sendsig __P((sig_t, int, int, u_long));
+extern void ibcs2_sendsig __P((sig_t, int, int, u_long, caddr_t));
extern char sigcode[], esigcode[];
const char ibcs2_emul_path[] = "/emul/ibcs2";
-/* $OpenBSD: sunos.h,v 1.4 1996/08/02 20:20:30 niklas Exp $ */
+/* $OpenBSD: sunos.h,v 1.5 1997/01/27 22:48:33 deraadt Exp $ */
/* $NetBSD: sunos.h,v 1.8 1996/05/05 16:07:43 veego Exp $ */
#define SUNM_RDONLY 0x01 /* mount fs read-only */
__BEGIN_DECLS
/* Defined in arch/m68k/m68k/sunos_machdep.c -- sparc uses regular sendsig() */
#ifndef sparc
-void sunos_sendsig __P((sig_t, int, int, u_long));
+void sunos_sendsig __P((sig_t, int, int, u_long, caddr_t));
#endif
__END_DECLS
-/* $OpenBSD: kern_sig.c,v 1.14 1997/01/27 01:15:32 deraadt Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.15 1997/01/27 22:48:36 deraadt Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
* Otherwise, post it normally.
*/
void
-trapsignal(p, signum, code)
+trapsignal(p, signum, code, addr)
struct proc *p;
register int signum;
u_long code;
+ caddr_t addr;
{
register struct sigacts *ps = p->p_sigacts;
int mask;
p->p_sigmask, code);
#endif
(*p->p_emul->e_sendsig)(ps->ps_sigact[signum], signum,
- p->p_sigmask, code);
+ p->p_sigmask, code, addr);
p->p_sigmask |= ps->ps_catchmask[signum];
if ((ps->ps_sigreset & mask) != 0) {
p->p_sigcatch &= ~mask;
code = ps->ps_code;
ps->ps_code = 0;
}
- (*p->p_emul->e_sendsig)(action, signum, returnmask, code);
+ (*p->p_emul->e_sendsig)(action, signum, returnmask, code, 0);
}
}
-/* $OpenBSD: proc.h,v 1.11 1996/11/24 01:39:23 kstailey Exp $ */
+/* $OpenBSD: proc.h,v 1.12 1997/01/27 22:48:41 deraadt Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
char e_name[8]; /* Symbolic name */
int *e_errno; /* Errno array */
/* Signal sending function */
- void (*e_sendsig) __P((sig_t, int, int, u_long));
+ void (*e_sendsig) __P((sig_t, int, int, u_long, caddr_t));
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.4 1997/01/27 01:15:30 deraadt Exp $ */
+/* $OpenBSD: signalvar.h,v 1.5 1997/01/27 22:48:42 deraadt Exp $ */
/* $NetBSD: signalvar.h,v 1.17 1996/04/22 01:23:31 christos Exp $ */
/*
void postsig __P((int sig));
void psignal __P((struct proc *p, int sig));
void siginit __P((struct proc *p));
-void trapsignal __P((struct proc *p, int sig, u_long code));
+void trapsignal __P((struct proc *p, int sig, u_long code, caddr_t addr));
void sigexit __P((struct proc *, int));
void setsigvec __P((struct proc *, int, struct sigaction *));
int killpg1 __P((struct proc *, int, int, int));
/*
* Machine-dependent functions:
*/
-void sendsig __P((sig_t action, int sig, int returnmask, u_long code));
+void sendsig __P((sig_t action, int sig, int returnmask, u_long code,
+ caddr_t addr));
struct core;
struct vnode;
struct ucred;