Fix two bugs in the fault handler for copy{in,out} and friends.

First, it was failing to reset the PCB's pcb_onfault member to NULL.
Under some really obscure circumstances this might cause a wild jump
within the kernel when a panic would otherwise occur.  Second, the
handler was loading the GP register needlessly and with an incorrect
value.

Reviewed by:	Doug Rabson <dfr>
Approved by:	Jordan Hubbard <jkh>
This commit is contained in:
John Polstra 2000-02-25 03:26:10 +00:00
parent a95c122521
commit 7e4977c94e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=57466

View File

@ -555,7 +555,9 @@ NESTED(copyout, 3, 16, ra, 0, 0)
END(copyout)
LEAF(copyerr, 0)
LDGP(pv)
ldq t0, curproc
ldq t0, P_ADDR(t0)
stq zero, U_PCB_ONFAULT(t0) /* reset fault handler. */
ldq ra, (16-8)(sp) /* restore ra. */
lda sp, 16(sp) /* kill stack frame. */
ldiq v0, EFAULT /* return EFAULT. */