summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arm
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-02-12 14:06:43 -0600
committerWaldemar Brodkorb <wbx@openadk.org>2015-02-12 14:08:52 -0600
commit322fdd37d307a12c913be78cebcc348a77731dd3 (patch)
treeca9d101d32462a60b3a635f1a5d4b5012b1a151e /libc/sysdeps/linux/arm
parentc725f1deaef5bbfb22c83fbfc221a86255a3072b (diff)
unbreak support for ARM no MMU case
As suggested on the uCLibc mailing list: http://lists.uclibc.org/pipermail/uclibc/2014-November/048702.html http://lists.uclibc.org/pipermail/uclibc/2014-November/048703.html http://lists.uclibc.org/pipermail/uclibc/2014-November/048704.html
Diffstat (limited to 'libc/sysdeps/linux/arm')
-rw-r--r--libc/sysdeps/linux/arm/clone.S14
1 files changed, 8 insertions, 6 deletions
diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
index 29045ef7b..d1c9239da 100644
--- a/libc/sysdeps/linux/arm/clone.S
+++ b/libc/sysdeps/linux/arm/clone.S
@@ -26,7 +26,10 @@
#include <sys/syscall.h>
#include <bits/arm_asm.h>
#include <bits/arm_bx.h>
+
+#if defined __UCLIBC_HAS_THREADS__ && !defined __LINUXTHREADS_OLD__
#include <sysdep-cancel.h>
+#endif
#define CLONE_VM 0x00000100
#define CLONE_THREAD 0x00010000
@@ -57,23 +60,22 @@ __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:
@ pick the function arg and call address off the stack and execute
ldr r0, [sp, #4]
+#if defined(__USE_BX__)
ldr r1, [sp]
bl 2f @ blx r1
+#else
+ mov lr, pc
+ ldr pc, [sp]
+#endif
@ and we are done, passing the return value through r0
bl HIDDEN_JUMPTARGET(_exit)