summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2006-01-07 01:55:12 +0000
committergrehan <grehan@FreeBSD.org>2006-01-07 01:55:12 +0000
commit713f710c8d1e758715ed95449a6fe66be69904c8 (patch)
treea4e8ca691e62990f6abb87222c85ec6b3624bf34 /sys
parent691f012913351f4b70e5cada5223ee00906b4baa (diff)
downloadFreeBSD-src-713f710c8d1e758715ed95449a6fe66be69904c8.zip
FreeBSD-src-713f710c8d1e758715ed95449a6fe66be69904c8.tar.gz
Set the siginfo si_addr field, and also the mysterious 3rd parameter
to old-style signals, to be the DAR register for DSI miss exceptions. This gives the address of the access rather than the instruction address. The behaviour is now the same as on i386. Found by: libsigsegv tests
Diffstat (limited to 'sys')
-rw-r--r--sys/powerpc/aim/machdep.c5
-rw-r--r--sys/powerpc/powerpc/machdep.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c
index 4d337b0..839e5b5 100644
--- a/sys/powerpc/aim/machdep.c
+++ b/sys/powerpc/aim/machdep.c
@@ -530,10 +530,13 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
*/
sf.sf_si = ksi->ksi_info;
sf.sf_si.si_signo = sig;
- sf.sf_si.si_addr = (void *)tf->srr0; /* XXX */
+ sf.sf_si.si_addr = (void *) ((tf->exc == EXC_DSI) ?
+ tf->dar : tf->srr0);
} else {
/* Old FreeBSD-style arguments. */
tf->fixreg[FIRSTARG+1] = code;
+ tf->fixreg[FIRSTARG+3] = (tf->exc == EXC_DSI) ?
+ tf->dar : tf->srr0;
}
mtx_unlock(&psp->ps_mtx);
PROC_UNLOCK(p);
diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c
index 4d337b0..839e5b5 100644
--- a/sys/powerpc/powerpc/machdep.c
+++ b/sys/powerpc/powerpc/machdep.c
@@ -530,10 +530,13 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
*/
sf.sf_si = ksi->ksi_info;
sf.sf_si.si_signo = sig;
- sf.sf_si.si_addr = (void *)tf->srr0; /* XXX */
+ sf.sf_si.si_addr = (void *) ((tf->exc == EXC_DSI) ?
+ tf->dar : tf->srr0);
} else {
/* Old FreeBSD-style arguments. */
tf->fixreg[FIRSTARG+1] = code;
+ tf->fixreg[FIRSTARG+3] = (tf->exc == EXC_DSI) ?
+ tf->dar : tf->srr0;
}
mtx_unlock(&psp->ps_mtx);
PROC_UNLOCK(p);
OpenPOWER on IntegriCloud