summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/vax/sys
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2015-03-31 04:32:01 +0000
committerguenther <guenther@openbsd.org>2015-03-31 04:32:01 +0000
commit26e1ecc85e4cb7150f8657b3dfe28eaf6e48ff59 (patch)
treefdbd436f0044f6903de7a2fae2a0391c5e2359ce /lib/libc/arch/vax/sys
parentUpon finding an AUX slot that has no driver for it (such as the (diff)
downloadwireguard-openbsd-26e1ecc85e4cb7150f8657b3dfe28eaf6e48ff59.tar.xz
wireguard-openbsd-26e1ecc85e4cb7150f8657b3dfe28eaf6e48ff59.zip
Simplify fork/vfork logic: the kernel has handled returning zero in the child
for a long time, so there's no need to test the second return register here in the asm stub. ok and testing of many archs by krw@ miod@
Diffstat (limited to 'lib/libc/arch/vax/sys')
-rw-r--r--lib/libc/arch/vax/sys/Ovfork.S10
-rw-r--r--lib/libc/arch/vax/sys/fork.S8
2 files changed, 3 insertions, 15 deletions
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)