When restarting syscalls, make sure we adjust the PC by the correct amount
depending on what instruction we used to enter the kernel. Push the instruction length into tf_err on entry.
This commit is contained in:
parent
ed993b3930
commit
86a2079aef
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: locore.s,v 1.95 1994/11/07 05:09:04 mycroft Exp $ */
|
||||
/* $NetBSD: locore.s,v 1.96 1994/11/07 05:26:08 mycroft Exp $ */
|
||||
|
||||
#undef DIAGNOSTIC
|
||||
#define DIAGNOSTIC
|
||||
@ -1989,13 +1989,15 @@ IDTVEC(osyscall)
|
||||
pushfl
|
||||
andb $~(PSL_T>>8),1(%esp)
|
||||
popfl
|
||||
/* FALLTHROUGH */
|
||||
pushl $7
|
||||
jmp syscall1
|
||||
|
||||
/*
|
||||
* Trap gate entry for syscall
|
||||
*/
|
||||
IDTVEC(syscall)
|
||||
pushl $0 # dummy error code
|
||||
pushl $2 # dummy error code
|
||||
syscall1:
|
||||
pushl $T_ASTFLT # trap # for doing ASTs
|
||||
INTRENTRY
|
||||
#ifdef DIAGNOSTIC
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: trap.c,v 1.60 1994/11/06 20:30:09 mycroft Exp $ */
|
||||
/* $NetBSD: trap.c,v 1.61 1994/11/07 05:26:17 mycroft Exp $ */
|
||||
|
||||
#undef DEBUG
|
||||
#define DEBUG
|
||||
@ -563,10 +563,11 @@ syscall(frame)
|
||||
|
||||
case ERESTART:
|
||||
/*
|
||||
* Reconstruct pc, assuming lcall $X,y is 7 bytes, as it is
|
||||
* always.
|
||||
* The offset to adjust the PC by depends on whether we entered
|
||||
* the kernel through the trap or call gate. We pushed the
|
||||
* size of the instruction into tf_err on entry.
|
||||
*/
|
||||
frame.tf_eip = opc - 7;
|
||||
frame.tf_eip = opc - frame.tf_err;
|
||||
break;
|
||||
|
||||
case EJUSTRETURN:
|
||||
|
Loading…
x
Reference in New Issue
Block a user