diff options
author | grehan <grehan@FreeBSD.org> | 2006-01-07 01:55:12 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2006-01-07 01:55:12 +0000 |
commit | 713f710c8d1e758715ed95449a6fe66be69904c8 (patch) | |
tree | a4e8ca691e62990f6abb87222c85ec6b3624bf34 /sys/powerpc/aim/machdep.c | |
parent | 691f012913351f4b70e5cada5223ee00906b4baa (diff) | |
download | FreeBSD-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/powerpc/aim/machdep.c')
-rw-r--r-- | sys/powerpc/aim/machdep.c | 5 |
1 files changed, 4 insertions, 1 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); |