summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/arch/alpha/sys/Ovfork.S7
-rw-r--r--lib/libc/arch/alpha/sys/fork.S7
-rw-r--r--lib/libc/arch/amd64/sys/Ovfork.S11
-rw-r--r--lib/libc/arch/amd64/sys/fork.S7
-rw-r--r--lib/libc/arch/arm/sys/Ovfork.S11
-rw-r--r--lib/libc/arch/arm/sys/fork.S15
-rw-r--r--lib/libc/arch/hppa/sys/Ovfork.S5
-rw-r--r--lib/libc/arch/hppa/sys/fork.S11
-rw-r--r--lib/libc/arch/hppa64/sys/Ovfork.S5
-rw-r--r--lib/libc/arch/hppa64/sys/fork.S11
-rw-r--r--lib/libc/arch/i386/sys/Ovfork.S11
-rw-r--r--lib/libc/arch/i386/sys/fork.S7
-rw-r--r--lib/libc/arch/m88k/sys/Ovfork.S12
-rw-r--r--lib/libc/arch/mips64/sys/Ovfork.S32
-rw-r--r--lib/libc/arch/mips64/sys/fork.S25
-rw-r--r--lib/libc/arch/powerpc/sys/Ovfork.S3
-rw-r--r--lib/libc/arch/sh/sys/Ovfork.S27
-rw-r--r--lib/libc/arch/sh/sys/fork.S19
-rw-r--r--lib/libc/arch/sparc/sys/Ovfork.S14
-rw-r--r--lib/libc/arch/sparc/sys/fork.S7
-rw-r--r--lib/libc/arch/sparc64/sys/Ovfork.S14
-rw-r--r--lib/libc/arch/sparc64/sys/fork.S7
-rw-r--r--lib/libc/arch/vax/sys/Ovfork.S10
-rw-r--r--lib/libc/arch/vax/sys/fork.S8
24 files changed, 43 insertions, 243 deletions
diff --git a/lib/libc/arch/alpha/sys/Ovfork.S b/lib/libc/arch/alpha/sys/Ovfork.S
index 1bbf1305628..5da581bcc6f 100644
--- a/lib/libc/arch/alpha/sys/Ovfork.S
+++ b/lib/libc/arch/alpha/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.5 2005/08/07 16:40:13 espie Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.6 2015/03/31 04:32:01 guenther Exp $ */
/* $NetBSD: Ovfork.S,v 1.1 1995/02/10 17:50:29 cgd Exp $ */
/*
@@ -30,7 +30,4 @@
#include "SYS.h"
-SYSCALL(vfork)
- cmovne a4, zero, v0 /* a4 (rv[1]) != 0, child */
- RET
-SYSEND(vfork)
+RSYSCALL(vfork)
diff --git a/lib/libc/arch/alpha/sys/fork.S b/lib/libc/arch/alpha/sys/fork.S
index 8b36ebe3ef4..d2509858586 100644
--- a/lib/libc/arch/alpha/sys/fork.S
+++ b/lib/libc/arch/alpha/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.5 2005/08/07 16:40:13 espie Exp $ */
+/* $OpenBSD: fork.S,v 1.6 2015/03/31 04:32:01 guenther Exp $ */
/* $NetBSD: fork.S,v 1.1 1995/02/10 17:50:34 cgd Exp $ */
/*
@@ -30,7 +30,4 @@
#include "SYS.h"
-SYSCALL(fork)
- cmovne a4, zero, v0 /* a4 (rv[1]) != 0, child */
- RET
-SYSEND(fork)
+RSYSCALL(fork)
diff --git a/lib/libc/arch/amd64/sys/Ovfork.S b/lib/libc/arch/amd64/sys/Ovfork.S
index 84986ffbef9..6494a8bdb53 100644
--- a/lib/libc/arch/amd64/sys/Ovfork.S
+++ b/lib/libc/arch/amd64/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.3 2012/08/22 17:19:34 pascal Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.4 2015/03/31 04:32:01 guenther Exp $ */
/* $NetBSD: Ovfork.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $ */
/*-
@@ -39,19 +39,10 @@
#include "SYS.h"
-/*
- * pid = vfork();
- *
- * %edx == 0 in parent process, %edx == 1 in child process.
- * %eax == pid of child in parent, %eax == pid of parent in child.
- *
- */
SYSENTRY(vfork)
popq %r9 /* my rta into r9 */
SYSTRAP(vfork)
jc err
- decl %edx
- andl %edx,%eax
jmp *%r9
err:
pushq %r9
diff --git a/lib/libc/arch/amd64/sys/fork.S b/lib/libc/arch/amd64/sys/fork.S
index 531520cea2e..d0a2ea33178 100644
--- a/lib/libc/arch/amd64/sys/fork.S
+++ b/lib/libc/arch/amd64/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.2 2005/12/13 00:10:48 jsg Exp $ */
+/* $OpenBSD: fork.S,v 1.3 2015/03/31 04:32:01 guenther Exp $ */
/* $NetBSD: fork.S,v 1.2 2003/02/13 02:50:51 nathanw Exp $ */
/*-
@@ -39,7 +39,4 @@
#include "SYS.h"
-SYSCALL(fork)
- decl %edx /* from 1 to 0 in child, 0 to -1 in parent */
- andl %edx,%eax
- ret /* pid = fork(); */
+RSYSCALL(fork)
diff --git a/lib/libc/arch/arm/sys/Ovfork.S b/lib/libc/arch/arm/sys/Ovfork.S
index 49a81e6e8a8..a015a9082a5 100644
--- a/lib/libc/arch/arm/sys/Ovfork.S
+++ b/lib/libc/arch/arm/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.3 2004/02/16 16:49:58 drahn Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.4 2015/03/31 04:32:01 guenther Exp $ */
/* $NetBSD: Ovfork.S,v 1.6 2003/08/07 16:42:03 agc Exp $ */
/*-
@@ -34,13 +34,6 @@
#include "SYS.h"
-/*
- * pid = vfork();
- *
- * On return from the SWI:
- * r1 == 0 in parent process, r1 == 1 in child process.
- * r0 == pid of child in parent, r0 == pid of parent in child.
- */
.text
.align 0
@@ -48,6 +41,4 @@ SYSENTRY(vfork)
mov r2, r14
SYSTRAP(vfork)
bcs PIC_SYM(CERROR, PLT)
- sub r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */
- and r0, r0, r1 /* r0 == 0 if child, else unchanged */
mov r15, r2
diff --git a/lib/libc/arch/arm/sys/fork.S b/lib/libc/arch/arm/sys/fork.S
index bed00fae5ce..9836d80a975 100644
--- a/lib/libc/arch/arm/sys/fork.S
+++ b/lib/libc/arch/arm/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.2 2004/02/01 05:40:52 drahn Exp $ */
+/* $OpenBSD: fork.S,v 1.3 2015/03/31 04:32:01 guenther Exp $ */
/* $NetBSD: fork.S,v 1.5 2003/08/07 16:42:04 agc Exp $ */
/*-
@@ -34,15 +34,4 @@
#include "SYS.h"
-/*
- * pid = fork();
- *
- * On return from the SWI:
- * r1 == 0 in parent process, r1 == 1 in child process.
- * r0 == pid of child in parent, r0 == pid of parent in child.
- */
-
-_SYSCALL(fork,fork)
- sub r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */
- and r0, r0, r1 /* r0 == 0 if child, else unchanged */
- mov r15, r14
+RSYSCALL(fork)
diff --git a/lib/libc/arch/hppa/sys/Ovfork.S b/lib/libc/arch/hppa/sys/Ovfork.S
index 0477e6986c2..880c92ad961 100644
--- a/lib/libc/arch/hppa/sys/Ovfork.S
+++ b/lib/libc/arch/hppa/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.13 2006/01/05 22:13:55 kettenis Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.14 2015/03/31 04:32:01 guenther Exp $ */
/*
* Copyright (c) 1999,2002 Michael Shalayeff
@@ -37,9 +37,8 @@ SYSENTRY(vfork)
.import __cerror, code
comb,<> r0, t1, __cerror
copy t4, rp
- addi -1, ret1, ret1
bv r0(rp)
- and ret1, ret0, ret0
+ nop
SYSEXIT(vfork)
.end
diff --git a/lib/libc/arch/hppa/sys/fork.S b/lib/libc/arch/hppa/sys/fork.S
index ae766fee515..6a4efd8f3de 100644
--- a/lib/libc/arch/hppa/sys/fork.S
+++ b/lib/libc/arch/hppa/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.11 2006/01/05 22:13:55 kettenis Exp $ */
+/* $OpenBSD: fork.S,v 1.12 2015/03/31 04:32:01 guenther Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -28,11 +28,4 @@
#include "SYS.h"
-SYSENTRY(fork)
- SYSCALL(fork)
- addi -1, ret1, ret1
- bv r0(rp)
- and ret0, ret1, ret0
-SYSEXIT(fork)
-
- .end
+RSYSCALL(fork)
diff --git a/lib/libc/arch/hppa64/sys/Ovfork.S b/lib/libc/arch/hppa64/sys/Ovfork.S
index 60f7412d798..de7cd713ad1 100644
--- a/lib/libc/arch/hppa64/sys/Ovfork.S
+++ b/lib/libc/arch/hppa64/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.4 2011/04/21 14:12:20 jsing Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.5 2015/03/31 04:32:01 guenther Exp $ */
/*
* Copyright (c) 1999,2002 Michael Shalayeff
@@ -37,9 +37,8 @@ SYSENTRY(vfork)
.import __cerror, code
comb,<> %r0, arg4, __cerror
copy arg7, %rp
- addi -1, %ret1, %ret1
bv %r0(%rp)
- and %ret1, %ret0, %ret0
+ nop
SYSEXIT(vfork)
.end
diff --git a/lib/libc/arch/hppa64/sys/fork.S b/lib/libc/arch/hppa64/sys/fork.S
index 79a9cffa161..ce870ec4024 100644
--- a/lib/libc/arch/hppa64/sys/fork.S
+++ b/lib/libc/arch/hppa64/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.4 2011/04/21 14:12:20 jsing Exp $ */
+/* $OpenBSD: fork.S,v 1.5 2015/03/31 04:32:01 guenther Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -28,11 +28,4 @@
#include "SYS.h"
-SYSENTRY(fork)
- SYSCALL(fork)
- addi -1, %ret1, %ret1
- bv %r0(%rp)
- and %ret0, %ret1, %ret0
-SYSEXIT(fork)
-
- .end
+RSYSCALL(fork)
diff --git a/lib/libc/arch/i386/sys/Ovfork.S b/lib/libc/arch/i386/sys/Ovfork.S
index 984c26c3cb0..aad09330695 100644
--- a/lib/libc/arch/i386/sys/Ovfork.S
+++ b/lib/libc/arch/i386/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.7 2012/08/22 17:19:34 pascal Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.8 2015/03/31 04:32:01 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -33,20 +33,11 @@
#include "SYS.h"
-/*
- * pid = vfork();
- *
- * %edx == 0 in parent process, %edx == 1 in child process.
- * %eax == pid of child in parent, %eax == pid of parent in child.
- *
- */
SYSENTRY(vfork)
popl %ecx /* my rta into ecx */
movl $(SYS_vfork),%eax
int $0x80
jc err
- decl %edx
- andl %edx,%eax
jmp *%ecx
err:
#ifdef __PIC__
diff --git a/lib/libc/arch/i386/sys/fork.S b/lib/libc/arch/i386/sys/fork.S
index e8850dd5b5c..205ae5942c1 100644
--- a/lib/libc/arch/i386/sys/fork.S
+++ b/lib/libc/arch/i386/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.4 2005/08/07 11:30:38 espie Exp $ */
+/* $OpenBSD: fork.S,v 1.5 2015/03/31 04:32:01 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -33,7 +33,4 @@
#include "SYS.h"
-SYSCALL(fork)
- decl %edx /* from 1 to 0 in child, 0 to -1 in parent */
- andl %edx,%eax
- ret /* pid = fork(); */
+RSYSCALL(fork)
diff --git a/lib/libc/arch/m88k/sys/Ovfork.S b/lib/libc/arch/m88k/sys/Ovfork.S
index d2b6c3c3027..916f563de92 100644
--- a/lib/libc/arch/m88k/sys/Ovfork.S
+++ b/lib/libc/arch/m88k/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.9 2013/01/11 21:23:24 miod Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.10 2015/03/31 04:32:02 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -35,12 +35,4 @@
#include "SYS.h"
-/* r2 = pid. r3 = 0 in parent, 1 in child */
-
-SYSCALL(vfork)
- bcnd eq0,%r3,parent
- or %r2,%r0,0
- or %r3,%r0,0
-parent:
- jmp %r1 /* pid = vfork() */
-END(vfork)
+RSYSCALL(vfork)
diff --git a/lib/libc/arch/mips64/sys/Ovfork.S b/lib/libc/arch/mips64/sys/Ovfork.S
index b10d2fb2cca..6c1896bb8e6 100644
--- a/lib/libc/arch/mips64/sys/Ovfork.S
+++ b/lib/libc/arch/mips64/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.5 2011/04/04 12:42:39 guenther Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.6 2015/03/31 04:32:02 guenther Exp $ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -33,32 +33,4 @@
#include "SYS.h"
-/*
- * pid = vfork();
- *
- * v1 == 0 in parent process, v1 == 1 in child process.
- * v0 == pid of child in parent, v0 == pid of parent in child.
- */
-
-FRAMESZ= MKFSIZ(1,1)
-GPOFF= FRAMESZ-2*REGSZ
-
-SYSLEAF(vfork, FRAMESZ)
- PTR_SUBU sp, FRAMESZ
- SETUP_GP64(GPOFF, vfork)
- .set reorder
- li v0, SYS_vfork # system call number for vfork
- syscall
- beq a3, zero, 1f # jump if no errors
- LA t9, CERROR
- RESTORE_GP64
- PTR_ADDU sp, FRAMESZ
- jr t9
-1:
- beq v1, zero, 2f # parent process ?
- move v0, zero # return zero in child
-2:
- RESTORE_GP64
- PTR_ADDU sp, FRAMESZ
- j ra
-SYSEND(vfork)
+RSYSCALL(vfork)
diff --git a/lib/libc/arch/mips64/sys/fork.S b/lib/libc/arch/mips64/sys/fork.S
index 920557c32d1..39aebd47385 100644
--- a/lib/libc/arch/mips64/sys/fork.S
+++ b/lib/libc/arch/mips64/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.5 2011/04/04 12:42:39 guenther Exp $ */
+/* $OpenBSD: fork.S,v 1.6 2015/03/31 04:32:02 guenther Exp $ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -33,25 +33,4 @@
#include "SYS.h"
-FRAMESZ= MKFSIZ(1,1)
-GPOFF= FRAMESZ-2*REGSZ
-
-SYSLEAF(fork, FRAMESZ)
- PTR_SUBU sp, FRAMESZ
- SETUP_GP64(GPOFF, fork)
- .set reorder
- li v0, SYS_fork # pid = fork()
- syscall
- bne a3, zero, 2f
- beq v1, zero, 1f # v1 == 0 in parent, 1 in child
- move v0, zero
-1:
- RESTORE_GP64
- PTR_ADDU sp, FRAMESZ
- j ra
-2:
- LA t9, CERROR
- RESTORE_GP64
- PTR_ADDU sp, FRAMESZ
- jr t9
-SYSEND(fork)
+RSYSCALL(fork)
diff --git a/lib/libc/arch/powerpc/sys/Ovfork.S b/lib/libc/arch/powerpc/sys/Ovfork.S
index a217885e957..09edfc32c9d 100644
--- a/lib/libc/arch/powerpc/sys/Ovfork.S
+++ b/lib/libc/arch/powerpc/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.2 2002/10/07 04:47:12 drahn Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.3 2015/03/31 04:32:02 guenther Exp $ */
/*
* Copyright (c) 1996 Dale Rahn
@@ -27,5 +27,4 @@
#include "SYS.h"
-/* pid = vfork() */
RSYSCALL(vfork)
diff --git a/lib/libc/arch/sh/sys/Ovfork.S b/lib/libc/arch/sh/sys/Ovfork.S
index 19492a11b70..a8d7d5e442e 100644
--- a/lib/libc/arch/sh/sys/Ovfork.S
+++ b/lib/libc/arch/sh/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.1 2006/10/10 22:07:10 miod Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.2 2015/03/31 04:32:02 guenther Exp $ */
/* $NetBSD: Ovfork.S,v 1.5 2003/08/07 16:42:20 agc Exp $ */
/*-
@@ -37,27 +37,4 @@
#include "SYS.h"
-/*
- * pid = vfork();
- *
- * r1 == 0 in parent process, r1 == 1 in child process.
- * r0 == pid of child in parent, r0 == pid of parent in child.
- *
- */
-SYSENTRY(vfork)
- mov.l .L_SYS_vfork, r0
- trapa #0x80
- bf err
-
- add #0xff, r1 /* from 1 to 0 in child, 0 to -1 in parent */
- rts
- and r1, r0 /* 0 in child, child pid in parent */
-
-err:
- JUMP_CERROR
-
- .align 2
-.L_SYS_vfork:
- .long SYS_vfork
-
- SET_ENTRY_SIZE(vfork)
+RSYSCALL(vfork)
diff --git a/lib/libc/arch/sh/sys/fork.S b/lib/libc/arch/sh/sys/fork.S
index 9e5db8af913..cf552fd07b2 100644
--- a/lib/libc/arch/sh/sys/fork.S
+++ b/lib/libc/arch/sh/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.2 2006/11/03 21:23:22 drahn Exp $ */
+/* $OpenBSD: fork.S,v 1.3 2015/03/31 04:32:02 guenther Exp $ */
/* $NetBSD: fork.S,v 1.10 2006/01/06 05:11:29 uwe Exp $ */
/*-
@@ -37,19 +37,4 @@
#include "SYS.h"
-/*
- * pid = fork();
- *
- * r1 == 0 in parent process, r1 == 1 in child process.
- * r0 == pid of child in parent, r0 == pid of parent in child.
- *
- */
-_SYSCALL(fork,fork)
- add #-1, r1 /* from 1 to 0 in child, 0 to -1 in parent */
- rts
- and r1, r0 /* 0 in child, child pid in parent */
-
-err:
- JUMP_CERROR
-
- SET_ENTRY_SIZE(fork)
+RSYSCALL(fork)
diff --git a/lib/libc/arch/sparc/sys/Ovfork.S b/lib/libc/arch/sparc/sys/Ovfork.S
index 9c20e6f2371..a0a9ce8d3d8 100644
--- a/lib/libc/arch/sparc/sys/Ovfork.S
+++ b/lib/libc/arch/sparc/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.4 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.5 2015/03/31 04:32:02 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,16 +32,6 @@
* SUCH DAMAGE.
*/
-/*
- * pid = vfork();
- *
- * %o1 == 0 in parent process, 1 in child process.
- * %o0 == pid of child in parent, pid of parent in child.
- */
-
#include "SYS.h"
-SYSCALL(vfork)
- dec %o1 ! from 1 to 0 in child, 0 to -1 in parent
- retl
- and %o0, %o1, %o0 ! return 0 in child, pid in parent
+RSYSCALL(vfork)
diff --git a/lib/libc/arch/sparc/sys/fork.S b/lib/libc/arch/sparc/sys/fork.S
index 7e31698afde..83916669e78 100644
--- a/lib/libc/arch/sparc/sys/fork.S
+++ b/lib/libc/arch/sparc/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.4 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: fork.S,v 1.5 2015/03/31 04:32:02 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -34,7 +34,4 @@
#include "SYS.h"
-SYSCALL(fork)
- dec %o1 ! from 1 to 0 in child, 0 to -1 in parent
- retl
- and %o0, %o1, %o0 ! return 0 in child, pid in parent
+RSYSCALL(fork)
diff --git a/lib/libc/arch/sparc64/sys/Ovfork.S b/lib/libc/arch/sparc64/sys/Ovfork.S
index 02ef47c1b55..86860d38482 100644
--- a/lib/libc/arch/sparc64/sys/Ovfork.S
+++ b/lib/libc/arch/sparc64/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.2 2003/06/02 20:18:33 millert Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.3 2015/03/31 04:32:02 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -35,16 +35,6 @@
#include <machine/asm.h>
-/*
- * pid = vfork();
- *
- * %o1 == 0 in parent process, 1 in child process.
- * %o0 == pid of child in parent, pid of parent in child.
- */
-
#include "SYS.h"
-SYSCALL(vfork)
- dec %o1 /* from 1 to 0 in child, 0 to -1 in parent */
- retl
- and %o0, %o1, %o0 /* return 0 in child, pid in parent */
+RSYSCALL(vfork)
diff --git a/lib/libc/arch/sparc64/sys/fork.S b/lib/libc/arch/sparc64/sys/fork.S
index b1aacfe8321..ffb32b62ad0 100644
--- a/lib/libc/arch/sparc64/sys/fork.S
+++ b/lib/libc/arch/sparc64/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.2 2003/06/02 20:18:33 millert Exp $ */
+/* $OpenBSD: fork.S,v 1.3 2015/03/31 04:32:02 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -37,7 +37,4 @@
#include "SYS.h"
-SYSCALL(fork)
- dec %o1 /* from 1 to 0 in child, 0 to -1 in parent */
- retl
- and %o0, %o1, %o0 /* return 0 in child, pid in parent */
+RSYSCALL(fork)
diff --git a/lib/libc/arch/vax/sys/Ovfork.S b/lib/libc/arch/vax/sys/Ovfork.S
index cadbff6cb76..0a619255047 100644
--- a/lib/libc/arch/vax/sys/Ovfork.S
+++ b/lib/libc/arch/vax/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.8 2013/07/05 21:10:50 miod Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.9 2015/03/31 04:32:02 guenther Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -36,11 +36,6 @@
#include "SYS.h"
/*
- * pid = vfork();
- *
- * r1 == 0 in parent process, r1 == 1 in child process.
- * r0 == pid of child in parent, r0 == pid of parent in child.
- *
* trickery here, due to keith sklower, uses ret to clear the stack,
* and then returns with a jump indirect, since only one person can return
* with a ret off this stack... we do the ret before we vfork!
@@ -53,9 +48,6 @@ SYSENTRY(vfork)
here:
chmk $ SYS_vfork
bcs err # if failed, set errno and return -1
- /* this next trick is Chris Torek's fault */
- mnegl %r1,%r1 # r1 = 0xffffffff if child, 0 if parent
- bicl2 %r1,%r0 # r0 &= ~r1, i.e., 0 if child, else unchanged
jmp (%r2)
err:
diff --git a/lib/libc/arch/vax/sys/fork.S b/lib/libc/arch/vax/sys/fork.S
index 449f185f73d..9204b5af8b2 100644
--- a/lib/libc/arch/vax/sys/fork.S
+++ b/lib/libc/arch/vax/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.5 2013/07/05 21:10:50 miod Exp $ */
+/* $OpenBSD: fork.S,v 1.6 2015/03/31 04:32:02 guenther Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,8 +30,4 @@
#include "SYS.h"
-SYSCALL(fork)
- jlbc %r1,1f # parent, since r1 == 0 in parent, 1 in child
- clrl %r0
-1:
- ret # pid = fork()
+RSYSCALL(fork)