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
This commit is contained in:
Peter Grehan 2006-01-07 01:55:12 +00:00
parent 6d85ea7820
commit 162138c989
2 changed files with 8 additions and 2 deletions

View File

@ -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);

View File

@ -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);