summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
authorDavid McCullough <davidm@snapgear.com>2002-09-17 01:43:35 +0000
committerDavid McCullough <davidm@snapgear.com>2002-09-17 01:43:35 +0000
commitc21b7e64b85e18113f7bf01b72bbc7904b55e2c6 (patch)
tree7cc88ecd2476d0db2e65c3244d0b0830ea6cc1b3 /libc/sysdeps
parenta0b93e7b31f8fb02e1bef769ef1b0c336992e74a (diff)
Add in clone and make the assembler PIC/msep-data friendly.
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/linux/m68k/clone.S22
1 files changed, 16 insertions, 6 deletions
diff --git a/libc/sysdeps/linux/m68k/clone.S b/libc/sysdeps/linux/m68k/clone.S
index 1f900685e..d1e4fd850 100644
--- a/libc/sysdeps/linux/m68k/clone.S
+++ b/libc/sysdeps/linux/m68k/clone.S
@@ -9,9 +9,12 @@
#include <sys/syscall.h>
/* int _clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
-
+
.text
.align 4
+.type clone,@function
+.globl clone;
+clone:
.type __clone,@function
.globl __clone;
__clone:
@@ -20,11 +23,11 @@ __clone:
movel 4(%sp), %d1 /* no NULL function pointers */
movel %d1, %a0
tstl %d1
- jeq syscall_error
+ beq.w syscall_error
movel 8(%sp), %d1 /* no NULL stack pointers */
movel %d1, %a1
tstl %d1
- jeq syscall_error
+ beq.w syscall_error
/* Allocate space and copy the argument onto the new stack. */
movel 16(%sp), -(%a1)
@@ -49,8 +52,8 @@ __clone:
#endif
tstl %d0
- jmi syscall_error
- jeq thread_start
+ bmi.w syscall_error
+ beq.w thread_start
rts
@@ -58,7 +61,7 @@ syscall_error:
negl %d0
movel %d0, %sp@-
lea __errno_location-.-8, %a0
- jsr 0(%pc, %a0)
+ jsr %pc@(%a0)
movel %d0, %a0
movel %sp@+, %a0@
moveq #-1, %d0
@@ -73,3 +76,10 @@ thread_start:
trap #0
/*jsr exit*/
+#if defined(HAVE_ELF)
+ .weak clone
+ clone = __clone
+#else
+ .set clone,__clone
+#endif
+