fork/vfork/__tfork haven't cared about the second return register.
So, stop setting retval[1] in kern_fork.c and stop setting the
second return register in the MD child_return() routines.
With the above, we have no multi-register return values on LP64,
so stop touching that register in the trapframe on those archs.
testing miod@ and aoyama@
ok miod@
-/* $OpenBSD: trap.c,v 1.103 2022/08/29 06:08:03 jsg Exp $ */
+/* $OpenBSD: trap.c,v 1.104 2022/11/02 07:20:07 guenther Exp $ */
/* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */
/*-
switch (error) {
case 0:
framep->tf_regs[FRAME_V0] = rval[0];
- framep->tf_regs[FRAME_A4] = rval[1];
framep->tf_regs[FRAME_A3] = 0;
break;
case ERESTART:
* Return values in the frame set by cpu_fork().
*/
framep->tf_regs[FRAME_V0] = 0;
- framep->tf_regs[FRAME_A4] = 0;
framep->tf_regs[FRAME_A3] = 0;
KERNEL_UNLOCK();
-/* $OpenBSD: trap.c,v 1.90 2021/12/09 00:26:11 guenther Exp $ */
+/* $OpenBSD: trap.c,v 1.91 2022/11/02 07:20:07 guenther Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
}
rval[0] = 0;
- rval[1] = frame->tf_rdx;
+ rval[1] = 0;
error = mi_syscall(p, code, callp, argp, rval);
switch (error) {
case 0:
frame->tf_rax = rval[0];
- frame->tf_rdx = rval[1];
frame->tf_rflags &= ~PSL_C; /* carry bit */
break;
case ERESTART:
struct trapframe *tf = p->p_md.md_regs;
tf->tf_rax = 0;
- tf->tf_rdx = 1;
tf->tf_rflags &= ~PSL_C;
KERNEL_UNLOCK();
-/* $OpenBSD: syscall.c,v 1.10 2022/01/01 18:52:36 kettenis Exp $ */
+/* $OpenBSD: syscall.c,v 1.11 2022/11/02 07:20:08 guenther Exp $ */
/*
* Copyright (c) 2015 Dale Rahn <drahn@dalerahn.com>
*
}
rval[0] = 0;
- rval[1] = frame->tf_x[1];
+ rval[1] = 0;
error = mi_syscall(p, code, callp, args, rval);
switch (error) {
case 0:
frame->tf_x[0] = rval[0];
- frame->tf_x[1] = rval[1];
-
frame->tf_spsr &= ~PSR_C; /* carry bit */
break;
struct trapframe *frame = p->p_addr->u_pcb.pcb_tf;
frame->tf_x[0] = 0;
- frame->tf_x[1] = 1;
frame->tf_spsr &= ~PSR_C; /* carry bit */
KERNEL_UNLOCK();
-/* $OpenBSD: trap.c,v 1.158 2022/08/12 17:19:52 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.159 2022/11/02 07:20:07 guenther Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
* Set up return value registers as libc:fork() expects
*/
tf->tf_ret0 = 0;
- tf->tf_ret1 = 1; /* ischild */
tf->tf_t1 = 0; /* errno */
KERNEL_UNLOCK();
-/* $OpenBSD: trap.c,v 1.122 2022/08/12 08:31:06 jsg Exp $ */
+/* $OpenBSD: trap.c,v 1.123 2022/11/02 07:20:07 guenther Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
* Copyright (c) 1998 Steve Murphree, Jr.
tf = (struct trapframe *)USER_REGS(p);
tf->tf_r[2] = 0;
- tf->tf_r[3] = 0;
tf->tf_epsr &= ~PSR_C;
/* skip br instruction as in syscall() */
#ifdef M88100
-/* $OpenBSD: trap.c,v 1.160 2022/10/07 14:59:39 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.161 2022/11/02 07:20:08 guenther Exp $ */
/*
* Copyright (c) 1988 University of Utah.
}
rval[0] = 0;
- rval[1] = locr0->v1;
+ rval[1] = 0;
#if defined(DDB) || defined(DEBUG)
trapdebug[TRAPSIZE * ci->ci_cpuid + (trppos[ci->ci_cpuid] == 0 ?
switch (error) {
case 0:
locr0->v0 = rval[0];
- locr0->v1 = rval[1];
locr0->a3 = 0;
break;
trapframe = p->p_md.md_regs;
trapframe->v0 = 0;
- trapframe->v1 = 1;
trapframe->a3 = 0;
KERNEL_UNLOCK();
-/* $OpenBSD: trap.c,v 1.126 2022/10/22 00:58:56 gkoehler Exp $ */
+/* $OpenBSD: trap.c,v 1.127 2022/11/02 07:20:07 guenther Exp $ */
/* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */
/*
tf->fixreg[0] = 0;
tf->fixreg[FIRSTARG] = 0;
- tf->fixreg[FIRSTARG + 1] = 1;
tf->cr &= ~0x10000000;
/* Disable FPU, VECT, as we can't be fpuproc */
tf->srr1 &= ~(PSL_FP|PSL_VEC);
-/* $OpenBSD: syscall.c,v 1.8 2021/12/09 00:26:11 guenther Exp $ */
+/* $OpenBSD: syscall.c,v 1.9 2022/11/02 07:20:08 guenther Exp $ */
/*
* Copyright (c) 2015 Dale Rahn <drahn@dalerahn.com>
}
rval[0] = 0;
- rval[1] = frame->fixreg[4];
+ rval[1] = 0;
error = mi_syscall(p, code, callp, args, rval);
case 0:
frame->fixreg[0] = 0;
frame->fixreg[3] = rval[0];
- frame->fixreg[4] = rval[1];
frame->cr &= ~0x10000000;
break;
frame->fixreg[0] = 0;
frame->fixreg[3] = 0;
- frame->fixreg[4] = 1;
frame->cr &= ~0x10000000;
KERNEL_UNLOCK();
-/* $OpenBSD: syscall.c,v 1.12 2022/02/22 13:34:23 visa Exp $ */
+/* $OpenBSD: syscall.c,v 1.13 2022/11/02 07:20:08 guenther Exp $ */
/*
* Copyright (c) 2020 Brian Bamsch <bbamsch@google.com>
}
rval[0] = 0;
- rval[1] = frame->tf_a[1];
+ rval[1] = 0;
error = mi_syscall(p, code, callp, args, rval);
switch (error) {
case 0:
frame->tf_a[0] = rval[0];
- frame->tf_a[1] = rval[1];
frame->tf_t[0] = 0; /* syscall succeeded */
break;
struct trapframe *frame = process_frame(p);
frame->tf_a[0] = 0;
- frame->tf_a[1] = 1;
frame->tf_t[0] = 0; /* no error */
KERNEL_UNLOCK();
-/* $OpenBSD: trap.c,v 1.111 2022/10/21 18:55:42 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.112 2022/11/02 07:20:08 guenther Exp $ */
/* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */
/*
}
rval[0] = 0;
- rval[1] = tf->tf_out[1];
+ rval[1] = 0;
error = mi_syscall(p, code, callp, args, rval);
case 0:
/* Note: fork() does not return here in the child */
tf->tf_out[0] = rval[0];
- tf->tf_out[1] = rval[1];
if (new) {
/* jmp %g2 on success */
dest = tf->tf_global[2];
* Return values in the frame set by cpu_fork().
*/
tf->tf_out[0] = 0;
- tf->tf_out[1] = 0;
KERNEL_UNLOCK();
-/* $OpenBSD: kern_fork.c,v 1.242 2022/08/14 01:58:27 jsg Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.243 2022/11/02 07:20:07 guenther Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
/*
* Return child pid to parent process
*/
- if (retval != NULL) {
- retval[0] = pr->ps_pid;
- retval[1] = 0;
- }
+ if (retval != NULL)
+ *retval = pr->ps_pid;
return (0);
}
/*
* Return tid to parent thread and copy it out to userspace
*/
- retval[0] = tid = p->p_tid + THREAD_PID_OFFSET;
- retval[1] = 0;
+ *retval = tid = p->p_tid + THREAD_PID_OFFSET;
if (tidptr != NULL) {
if (copyout(&tid, tidptr, sizeof(tid)))
psignal(curp, SIGSEGV);