-/* $OpenBSD: locore.S,v 1.63 2015/03/22 05:55:39 guenther Exp $ */
+/* $OpenBSD: locore.S,v 1.64 2015/04/18 05:14:05 guenther Exp $ */
/* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */
/*
movq %r11, TF_RFLAGS(%rsp) /* old rflags from syscall insn */
movq $(GSEL(GUCODE_SEL, SEL_UPL)), TF_CS(%rsp)
movq %rcx,TF_RIP(%rsp)
- movq $2,TF_ERR(%rsp)
+ movq $2,TF_ERR(%rsp) /* ignored */
movq $T_ASTFLT, TF_TRAPNO(%rsp)
movq CPUVAR(CURPROC),%r14
-/* $OpenBSD: trap.c,v 1.44 2015/03/14 03:38:46 jsg Exp $ */
+/* $OpenBSD: trap.c,v 1.45 2015/04/18 05:14:05 guenther Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
frame->tf_rflags &= ~PSL_C; /* carry bit */
break;
case ERESTART:
- /*
- * 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_rip -= frame->tf_err;
+ /* Back up over the syscall instruction (2 bytes) */
+ frame->tf_rip -= 2;
break;
case EJUSTRETURN:
/* nothing to do */
-/* $OpenBSD: locore.s,v 1.152 2015/04/12 18:37:53 mlarkin Exp $ */
+/* $OpenBSD: locore.s,v 1.153 2015/04/18 05:14:05 guenther Exp $ */
/* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */
/*-
* Trap gate entry for syscall
*/
IDTVEC(syscall)
- pushl $2 # size of instruction for restart
+ pushl $2 # ignored
pushl $T_ASTFLT # trap # for doing ASTs
INTRENTRY
pushl %esp
-/* $OpenBSD: trap.c,v 1.120 2015/01/11 19:34:52 guenther Exp $ */
+/* $OpenBSD: trap.c,v 1.121 2015/04/18 05:14:05 guenther Exp $ */
/* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */
/*-
caddr_t params;
struct sysent *callp;
struct proc *p;
- int error, opc, nsys;
+ int error, nsys;
register_t code, args[8], rval[2];
#ifdef DIAGNOSTIC
int ocpl = lapic_tpr;
#endif
p = curproc;
p->p_md.md_regs = frame;
- opc = frame->tf_eip;
code = frame->tf_eax;
nsys = p->p_p->ps_emul->e_nsysent;
frame->tf_eflags &= ~PSL_C; /* carry bit */
break;
case ERESTART:
- /*
- * 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 - frame->tf_err;
+ /* Back up over the int$80 (2 bytes) that made the syscall */
+ frame->tf_eip -= 2;
break;
case EJUSTRETURN:
/* nothing to do */