diff options
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/hppa/trap.c | 13 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/vm_machdep.c | 9 |
2 files changed, 12 insertions, 10 deletions
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index 9bf38f0d20c..9ca89e323c8 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.72 2004/04/07 18:24:19 mickey Exp $ */ +/* $OpenBSD: trap.c,v 1.73 2004/04/21 23:09:30 mickey Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -476,7 +476,16 @@ child_return(arg) void *arg; { struct proc *p = (struct proc *)arg; - userret(p, p->p_md.md_regs->tf_iioq_head, 0); + struct trapframe *tf = p->p_md.md_regs; + + /* + * Set up return value registers as libc:fork() expects + */ + tf->tf_ret0 = 0; + tf->tf_ret1 = 1; /* ischild */ + tf->tf_t1 = 0; /* errno */ + + userret(p, tf->tf_iioq_head, 0); #ifdef KTRACE if (KTRPOINT(p, KTR_SYSRET)) ktrsysret(p, SYS_fork, 0, 0); diff --git a/sys/arch/hppa/hppa/vm_machdep.c b/sys/arch/hppa/hppa/vm_machdep.c index 654a8e6b178..90259aacc68 100644 --- a/sys/arch/hppa/hppa/vm_machdep.c +++ b/sys/arch/hppa/hppa/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.52 2004/04/07 18:24:19 mickey Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.53 2004/04/21 23:09:30 mickey Exp $ */ /* * Copyright (c) 1999-2004 Michael Shalayeff @@ -200,13 +200,6 @@ cpu_fork(p1, p2, stack, stacksize, func, arg) tf->tf_ipsw = PSL_C | PSL_Q | PSL_P | PSL_D | PSL_I /* | PSL_L */; /* - * Set up return value registers as libc:fork() expects - */ - tf->tf_ret0 = p1->p_pid; - tf->tf_ret1 = 1; /* ischild */ - tf->tf_t1 = 0; /* errno */ - - /* * If specified, give the child a different stack. */ if (stack != NULL) |