summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/freebsd_machdep.c5
-rw-r--r--sys/arch/i386/i386/linux_machdep.c5
-rw-r--r--sys/arch/i386/i386/machdep.c14
-rw-r--r--sys/arch/i386/i386/svr4_machdep.c7
-rw-r--r--sys/arch/i386/i386/trap.c23
-rw-r--r--sys/arch/i386/i386/vm86.c4
-rw-r--r--sys/arch/i386/include/freebsd_machdep.h2
-rw-r--r--sys/arch/i386/include/linux_machdep.h2
-rw-r--r--sys/arch/i386/include/svr4_machdep.h2
-rw-r--r--sys/arch/i386/isa/npx.c2
10 files changed, 36 insertions, 30 deletions
diff --git a/sys/arch/i386/i386/freebsd_machdep.c b/sys/arch/i386/i386/freebsd_machdep.c
index 40439f62b9e..a27a24630ef 100644
--- a/sys/arch/i386/i386/freebsd_machdep.c
+++ b/sys/arch/i386/i386/freebsd_machdep.c
@@ -1,4 +1,4 @@
-/* $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 $ */
/*-
@@ -76,10 +76,11 @@
* 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;
diff --git a/sys/arch/i386/i386/linux_machdep.c b/sys/arch/i386/i386/linux_machdep.c
index 163dc0d4710..52d9bcd578a 100644
--- a/sys/arch/i386/i386/linux_machdep.c
+++ b/sys/arch/i386/i386/linux_machdep.c
@@ -1,4 +1,4 @@
-/* $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 $ */
/*
@@ -104,10 +104,11 @@ int linux_write_ldt __P((struct proc *, struct linux_sys_modify_ldt_args *,
*/
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;
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index a114f1715bb..ee7a6538052 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $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 $ */
/*-
@@ -565,17 +565,18 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
}
#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
@@ -590,10 +591,11 @@ ibcs2_sendsig(catcher, sig, mask, code)
* 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;
@@ -665,7 +667,7 @@ sendsig(catcher, sig, mask, code)
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)
diff --git a/sys/arch/i386/i386/svr4_machdep.c b/sys/arch/i386/i386/svr4_machdep.c
index 68b9cf259d7..1d3a1c241bd 100644
--- a/sys/arch/i386/i386/svr4_machdep.c
+++ b/sys/arch/i386/i386/svr4_machdep.c
@@ -1,4 +1,4 @@
-/* $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 $ */
/*
@@ -315,10 +315,11 @@ svr4_getsiginfo(si, sig, code, addr)
* 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;
@@ -353,7 +354,7 @@ svr4_sendsig(catcher, sig, mask, code)
*/
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;
diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c
index f29f4aa7759..2d90e9b7911 100644
--- a/sys/arch/i386/i386/trap.c
+++ b/sys/arch/i386/i386/trap.c
@@ -1,4 +1,4 @@
-/* $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
@@ -282,16 +282,16 @@ trap(frame)
#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 */
@@ -310,12 +310,12 @@ trap(frame)
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
}
@@ -323,11 +323,11 @@ trap(frame)
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 */
@@ -355,8 +355,9 @@ trap(frame)
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
@@ -426,7 +427,7 @@ trap(frame)
map, va, ftype, rv);
goto we_re_toast;
}
- trapsignal(p, SIGSEGV, T_PAGEFLT);
+ trapsignal(p, SIGSEGV, T_PAGEFLT, vv);
break;
}
@@ -442,7 +443,7 @@ trap(frame)
#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"
diff --git a/sys/arch/i386/i386/vm86.c b/sys/arch/i386/i386/vm86.c
index a968c811bc9..ba61d16555b 100644
--- a/sys/arch/i386/i386/vm86.c
+++ b/sys/arch/i386/i386/vm86.c
@@ -253,7 +253,7 @@ vm86_return(p, retval)
sigexit(p, SIGILL);
/* NOTREACHED */
}
- trapsignal(p, SIGURG, retval);
+ trapsignal(p, SIGURG, retval, 0);
}
#define CLI 0xFA
@@ -369,7 +369,7 @@ vm86_gpfault(p, type)
}
if (trace && tf->tf_eflags & PSL_VM)
- trapsignal(p, SIGTRAP, T_TRCTRAP);
+ trapsignal(p, SIGTRAP, T_TRCTRAP, 0);
return;
bad:
diff --git a/sys/arch/i386/include/freebsd_machdep.h b/sys/arch/i386/include/freebsd_machdep.h
index 4001bd410db..7ee92189afd 100644
--- a/sys/arch/i386/include/freebsd_machdep.h
+++ b/sys/arch/i386/include/freebsd_machdep.h
@@ -157,6 +157,6 @@ struct freebsd_ptrace_reg {
/* 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 */
diff --git a/sys/arch/i386/include/linux_machdep.h b/sys/arch/i386/include/linux_machdep.h
index 1c26026594f..c5a09d1cc93 100644
--- a/sys/arch/i386/include/linux_machdep.h
+++ b/sys/arch/i386/include/linux_machdep.h
@@ -76,7 +76,7 @@ struct linux_sigframe {
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));
/*
diff --git a/sys/arch/i386/include/svr4_machdep.h b/sys/arch/i386/include/svr4_machdep.h
index 0a5f5c8a8ee..fd39dd6c121 100644
--- a/sys/arch/i386/include/svr4_machdep.h
+++ b/sys/arch/i386/include/svr4_machdep.h
@@ -71,7 +71,7 @@ struct svr4_ucontext;
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;
diff --git a/sys/arch/i386/isa/npx.c b/sys/arch/i386/isa/npx.c
index 309ee672032..6774126fd5b 100644
--- a/sys/arch/i386/isa/npx.c
+++ b/sys/arch/i386/isa/npx.c
@@ -448,7 +448,7 @@ npxintr(arg)
#else
code = 0; /* XXX */
#endif
- trapsignal(p, SIGFPE, code);
+ trapsignal(p, SIGFPE, code, 0);
} else {
/*
* Nested interrupt. These losers occur when: