Fix restarted syscalls. When we rewind %rip, we also need to restore

all the argument registers etc since we have almost certainly have trashed
them by now.  Take particular car of %r10 since it held the original value
of %rcx (which we saved in tf_rcx on entry and doreti doesn't know this).
This commit is contained in:
Peter Wemm 2003-06-02 21:56:08 +00:00
parent c35518b4ed
commit babc58fd74
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115736

View File

@ -751,10 +751,14 @@ syscall(frame)
case ERESTART:
/*
* Reconstruct pc, assuming lcall $X,y is 7 bytes,
* int 0x80 is 2 bytes. We saved this in tf_err.
* Reconstruct pc, we know that 'syscall' is 2 bytes.
* We have to do a full context restore so that %r10
* (which was holding the value of %rcx) is restored for
* the next iteration.
*/
frame.tf_rip -= frame.tf_err;
frame.tf_r10 = frame.tf_rcx;
td->td_pcb->pcb_flags |= PCB_FULLCTX;
break;
case EJUSTRETURN: