summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/sh
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2017-01-22 10:24:51 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2017-01-28 10:31:19 +0100
commitbddde5860ffb8a78587854cc8e3e914bd69269ca (patch)
treed37c90a9ca983fb8be614844343ba2941927f88a /libc/sysdeps/linux/sh
parent30adfbeb8843c28869cc6ee33d7c556721cb241a (diff)
remove PID caching
Follow GNU C Library from c579f48edba88380635ab98cb612030e3ed8691e and remove the PID caching. These simplifies the architecture specific assembly code. The run of the test suite found no regressions, it even solves some of the test failures for x86/x86_64/sparc. Reviewed-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Vineet Gupta <Vineet.Gupta1@synopsys.com> Acked-by: Matthew Fortune <Matthew.Fortune@imgtec.com> Acked-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Diffstat (limited to 'libc/sysdeps/linux/sh')
-rw-r--r--libc/sysdeps/linux/sh/Makefile.arch7
-rw-r--r--libc/sysdeps/linux/sh/clone.S36
2 files changed, 5 insertions, 38 deletions
diff --git a/libc/sysdeps/linux/sh/Makefile.arch b/libc/sysdeps/linux/sh/Makefile.arch
index 99a77213b..6103381fd 100644
--- a/libc/sysdeps/linux/sh/Makefile.arch
+++ b/libc/sysdeps/linux/sh/Makefile.arch
@@ -6,10 +6,7 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC-y := \
- pipe.c __init_brk.c brk.c sbrk.c pread_write.c
-
-SSRC-y := setjmp.S __longjmp.S ___fpscr_values.S
+CSRC-y := pipe.c __init_brk.c brk.c sbrk.c pread_write.c
+SSRC-y := setjmp.S __longjmp.S ___fpscr_values.S clone.S vfork.S
CSRC-$(UCLIBC_LINUX_SPECIFIC) += cacheflush.c
-SSRC-$(if $(UCLIBC_HAS_THREADS_NATIVE),,y) += clone.S vfork.S
diff --git a/libc/sysdeps/linux/sh/clone.S b/libc/sysdeps/linux/sh/clone.S
index 3ed6b25de..334f83f1a 100644
--- a/libc/sysdeps/linux/sh/clone.S
+++ b/libc/sysdeps/linux/sh/clone.S
@@ -23,9 +23,7 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#ifdef RESET_PID
-#include <tcb-offsets.h>
-#endif
+
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
pid_t *ptid, void *tls, pid_t *ctid); */
@@ -85,29 +83,7 @@ ENTRY(__clone)
2:
/* terminate the stack frame */
mov #0, r14
-#ifdef RESET_PID
- mov r4, r0
- shlr16 r0
- tst #1, r0 // CLONE_THREAD = (1 << 16)
- bf/s 4f
- mov r4, r0
- /* new pid */
- shlr8 r0
- tst #1, r0 // CLONE_VM = (1 << 8)
- bf/s 3f
- mov #-1, r0
- mov #+SYS_ify(getpid), r3
- trapa #0x15
-3:
- stc gbr, r1
- mov.w .Lpidoff, r2
- add r1, r2
- mov.l r0, @r2
- mov.w .Ltidoff, r2
- add r1, r2
- mov.l r0, @r2
-4:
-#endif
+
/* thread starts */
mov.l @r15, r1
jsr @r1
@@ -138,12 +114,6 @@ ENTRY(__clone)
.long _GLOBAL_OFFSET_TABLE_
.L3:
.long PLTJMP(C_SYMBOL_NAME(_exit))
-#ifdef RESET_PID
-.Lpidoff:
- .word PID - TLS_PRE_TCB_SIZE
-.Ltidoff:
- .word TID - TLS_PRE_TCB_SIZE
-#endif
-PSEUDO_END (__clone)
+PSEUDO_END (__clone)
weak_alias (__clone, clone)