summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/microblaze/clone.S
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-31 18:05:44 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-11-03 20:37:48 +0100
commit191739597c6d380692885cfdd8dd8aa4f31f029d (patch)
treeb3f05ce72f7a87433905698dd58371048c904812 /libc/sysdeps/linux/microblaze/clone.S
parent7825930078208462655e107677656c45014e91b4 (diff)
microblaze: add NPTL/TLS support from GNU libc
Not perfect, but a starting point. Some tests of the test suite are failing.
Diffstat (limited to 'libc/sysdeps/linux/microblaze/clone.S')
-rw-r--r--libc/sysdeps/linux/microblaze/clone.S17
1 files changed, 8 insertions, 9 deletions
diff --git a/libc/sysdeps/linux/microblaze/clone.S b/libc/sysdeps/linux/microblaze/clone.S
index 46d4fe6b4..69c20453f 100644
--- a/libc/sysdeps/linux/microblaze/clone.S
+++ b/libc/sysdeps/linux/microblaze/clone.S
@@ -23,6 +23,10 @@
#define _ERRNO_H 1
#include <bits/errno.h>
+#if defined __UCLIBC_HAS_THREADS__ && !defined __UCLIBC_HAS_LINUXTHREADS__
+#include <sysdep-cancel.h>
+#endif
+
/* int clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg,
pid_t *ptid, struct user_desc *tls, pid_t *ctid);
@@ -39,8 +43,8 @@
.text
ENTRY (__clone)
addik r3,r0,-EINVAL
- beqi r5,1f ; // Invalid func
- beqi r6,1f ; // Invalid stack
+ beqi r5,SYSCALL_ERROR_LABEL ; // Invalid func
+ beqi r6,SYSCALL_ERROR_LABEL ; // Invalid stack
addik r6,r6,-8
swi r5,r6,0 ; // Push fn onto child's stack
swi r8,r6,4 ; // Push arg for child
@@ -53,7 +57,7 @@ ENTRY (__clone)
addk r0,r0,r0
addik r4,r0,-4095
cmpu r4,r4,r3
- bgei r4,1f
+ bgei r4,SYSCALL_ERROR_LABEL
beqi r3,L(thread_start)
rtsd r15,8
nop
@@ -67,12 +71,7 @@ L(thread_start):
addik r12,r0,SYS_ify(exit)
brki r14,8
nop
-
-1: rsubk r3,r3,r0
- rtsd r15,8
- addik r3,r0,-1 /* delay slot. */
-
-END(__clone)
+PSEUDO_END(__clone)
libc_hidden_def (__clone)
weak_alias (__clone,clone)