summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/h8300/vfork.S
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-02-02 19:03:57 +0000
committerEric Andersen <andersen@codepoet.org>2002-02-02 19:03:57 +0000
commit8dc1d08d0c3a5abe3856b04a5a864227fe0ba62d (patch)
tree65d254a60aec64fb933cf3c4c11ffa7235e02413 /libc/sysdeps/linux/h8300/vfork.S
parent327b0c83302af0a288c65a03f4f2c82af321bd28 (diff)
Add in support for the Hitach H8/300H architecture,
contributed by Yoshinori Sato <qzb04471@nifty.ne.jp>
Diffstat (limited to 'libc/sysdeps/linux/h8300/vfork.S')
-rw-r--r--libc/sysdeps/linux/h8300/vfork.S31
1 files changed, 31 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/h8300/vfork.S b/libc/sysdeps/linux/h8300/vfork.S
new file mode 100644
index 000000000..889b43ace
--- /dev/null
+++ b/libc/sysdeps/linux/h8300/vfork.S
@@ -0,0 +1,31 @@
+
+#include <asm/unistd.h>
+
+#ifndef __NR_vfork
+#define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
+#endif
+
+ .h8300h
+ .text
+ .align 2
+ .globl _errno
+ .globl _vfork
+#if defined HAVE_ELF
+ .type vfork,@function
+#endif
+_vfork:
+ mov.l @sp+, er1
+ sub.l er0,er0
+ mov.b #__NR_vfork,r0l
+ trapa #0
+ mov.l #-4096, er2
+ cmp.l er0,er2
+ bcs fix_errno
+ jmp @er1 /* don't return, just jmp directly */
+fix_errno:
+ neg.l er0
+ mov.l er0,@_errno
+ sub.l er0,er0
+ dec.l #1,er0
+ jmp @er1 /* don't return, just jmp directly */
+