summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arm/clone.S
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2009-10-17 13:23:11 -0700
committerAustin Foxley <austinf@cetoncorp.com>2009-10-17 13:23:11 -0700
commite58798e107d652644629a1daaa95d76430808d53 (patch)
treef02c3778cf6e3df14f1c0d499c9f660af476ed99 /libc/sysdeps/linux/arm/clone.S
parentb04c2ba52317dab5b2e4172d2f8678b1025780d8 (diff)
arm specific bits needed for nptl
* SAVE_PID, RESTORE_PID in vfork.S * clone.S tweaks to allow for the pid to be reset Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/sysdeps/linux/arm/clone.S')
-rw-r--r--libc/sysdeps/linux/arm/clone.S23
1 files changed, 18 insertions, 5 deletions
diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
index d9483735d..fdc05b88b 100644
--- a/libc/sysdeps/linux/arm/clone.S
+++ b/libc/sysdeps/linux/arm/clone.S
@@ -30,12 +30,12 @@
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
.text
-.global clone
-.type clone,%function
+.global __clone
+.type __clone,%function
.align 2
#if defined(THUMB1_ONLY)
.thumb_func
-clone:
+__clone:
@ sanity check args
cmp r0, #0
beq __einval
@@ -52,9 +52,15 @@ clone:
@ get flags
mov r0, r2
@ new sp is already in r1
+ @ load remaining arguments off the stack
+ stmfd sp!, {r4}
+ ldr r2, [sp, #4]
+ ldr r3, [sp, #8]
+ ldr r4, [sp, #12]
DO_CALL (clone)
movs a1, a1
blt __error
+ ldmnefd sp!, {r4}
beq 1f
bx lr
1:
@@ -80,7 +86,7 @@ __error:
POP_RET
.pool
#else
-clone:
+__clone:
@ sanity check args
cmp r0, #0
IT(te, ne)
@@ -98,9 +104,15 @@ clone:
@ get flags
mov r0, r2
@ new sp is already in r1
+ @ load remaining arguments off the stack
+ stmfd sp!, {r4}
+ ldr r2, [sp, #4]
+ ldr r3, [sp, #8]
+ ldr r4, [sp, #12]
DO_CALL (clone)
movs a1, a1
blt __error
+ ldmnefd sp!, {r4}
IT(t, ne)
#if defined(__USE_BX__)
bxne lr
@@ -120,6 +132,7 @@ __error:
b __syscall_error
#endif
-.size clone,.-clone
+.size __clone,.-__clone
+weak_alias(__clone, clone)
#endif