summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2004-02-09 19:14:28 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2004-02-09 19:14:28 +0000
commita74bedbb5d40c1d0a254fc6be50db0aeff3cc7f2 (patch)
treef7933369389da8c0988691ee1dfb63d4dc004d64
parent24a6f7395f26aac06620b97099af6cd9ef3abbec (diff)
duh. there are two syscall entry points and both have to preserve rdx. also make sure child process gets 1 in rdx as libc expects
-rw-r--r--sys/arch/amd64/amd64/syscall.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/syscall.c b/sys/arch/amd64/amd64/syscall.c
index 05f2b61479c..b8fc478e06b 100644
--- a/sys/arch/amd64/amd64/syscall.c
+++ b/sys/arch/amd64/amd64/syscall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscall.c,v 1.3 2004/02/09 14:11:09 mickey Exp $ */
+/* $OpenBSD: syscall.c,v 1.4 2004/02/09 19:14:27 mickey Exp $ */
/* $NetBSD: syscall.c,v 1.1 2003/04/26 18:39:32 fvdl Exp $ */
/*-
@@ -273,7 +273,7 @@ syscall_fancy(frame)
#endif
rval[0] = 0;
- rval[1] = 0;
+ rval[1] = frame.tf_rdx;
#if NSYSTRACE > 0
if (ISSET(p->p_flag, P_SYSTRACE))
error = systrace_redirect(code, p, args, rval);
@@ -326,6 +326,7 @@ child_return(void *arg)
struct trapframe *tf = p->p_md.md_regs;
tf->tf_rax = 0;
+ tf->tf_rdx = 1;
tf->tf_rflags &= ~PSL_C;
KERNEL_PROC_UNLOCK(l);