summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/m68k/vfork.S
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2017-12-16 21:01:39 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2017-12-31 11:12:07 +0100
commit23bb649090ff588e8642f0c581cfe7ce2d29c757 (patch)
tree4a68d696415fce9f2dd50edf27a79bacbde3fc50 /libc/sysdeps/linux/m68k/vfork.S
parent604781391549faafc59516700d9439ab1a7ec19b (diff)
m68k: add NPTL/TLS support
Port over NPTL/TLS support from GNU C Library. In the first step only the slower syscall is used for TLS access. The uClibc-ng testsuite shows 79 errors, so their is room for bugfixes and improvements.
Diffstat (limited to 'libc/sysdeps/linux/m68k/vfork.S')
-rw-r--r--libc/sysdeps/linux/m68k/vfork.S30
1 files changed, 12 insertions, 18 deletions
diff --git a/libc/sysdeps/linux/m68k/vfork.S b/libc/sysdeps/linux/m68k/vfork.S
index bde9d5a3a..eb1639e37 100644
--- a/libc/sysdeps/linux/m68k/vfork.S
+++ b/libc/sysdeps/linux/m68k/vfork.S
@@ -10,8 +10,6 @@
#define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
#endif
-#define IMM #
-
.text
.align 2
.globl __vfork
@@ -19,26 +17,22 @@
.type __vfork,@function
__vfork:
- movl %sp@+, %a1 /* save the return address for later */
- movl IMM __NR_vfork,%d0
+ /* Pop the return PC value into A0. */
+ movel %sp@+, %a0
+
+ /* Stuff the syscall number in D0 and trap into the kernel. */
+ movel #SYS_ify (vfork), %d0
trap #0
- movl %a1, -(%sp)
- cmpil #-4096,%d0
- blss 1f
+ tstl %d0
+ jmi .Lerror /* Branch forward if it failed. */
- neg.l %d0
-#ifndef __PIC__ /* needs handling as the other archs */
- movl errno, %a0
-#else
- movl errno@GOT(%a5), %a0
-#endif
- movl %d0, %a0@
- move.l #-1, %d0
+ /* Jump to the return PC. */
+ jmp %a0@
-1:
- move.l %d0, %a0
- rts
+.Lerror:
+ /* Push back the return PC. */
+ movel %a0,%sp@-
.size __vfork,.-__vfork
weak_alias(__vfork,vfork)