summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/xtensa
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/xtensa
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/xtensa')
-rw-r--r--libc/sysdeps/linux/xtensa/Makefile.arch4
-rw-r--r--libc/sysdeps/linux/xtensa/clone.S19
-rw-r--r--libc/sysdeps/linux/xtensa/vfork.S25
3 files changed, 1 insertions, 47 deletions
diff --git a/libc/sysdeps/linux/xtensa/Makefile.arch b/libc/sysdeps/linux/xtensa/Makefile.arch
index b9b6b87d5..23cd08ee5 100644
--- a/libc/sysdeps/linux/xtensa/Makefile.arch
+++ b/libc/sysdeps/linux/xtensa/Makefile.arch
@@ -6,9 +6,7 @@
#
CSRC-y := brk.c sigaction.c __syscall_error.c
-
SSRC-y := bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S \
- sigrestorer.S syscall.S mmap.S windowspill.S __longjmp.S vfork.S
+ sigrestorer.S syscall.S mmap.S windowspill.S __longjmp.S vfork.S
CSRC-$(if $(UCLIBC_HAS_THREADS_NATIVE),,y) += fork.c
-SSRC-$(if $(UCLIBC_HAS_THREADS_NATIVE),,y) += clone.S
diff --git a/libc/sysdeps/linux/xtensa/clone.S b/libc/sysdeps/linux/xtensa/clone.S
index efdfcdd5e..913ec5a5f 100644
--- a/libc/sysdeps/linux/xtensa/clone.S
+++ b/libc/sysdeps/linux/xtensa/clone.S
@@ -21,9 +21,6 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#ifdef RESET_PID
-#include <tls.h>
-#endif
#define __ASSEMBLY__
#include <linux/sched.h>
@@ -76,21 +73,6 @@ ENTRY (__clone)
# error invalid values for CLONE_THREAD or CLONE_VM
#endif
-#ifdef RESET_PID
- bbsi.l a6, 16, .Lskip_restore_pid /* CLONE_THREAD = 0x00010000 */
- movi a2, -1
- bbsi a6, 8, .Lgotpid /* CLONE_VM = 0x00000100 */
- movi a2, SYS_ify(getpid)
- syscall
-.Lgotpid:
- rur a3, threadptr
- movi a0, TLS_PRE_TCB_SIZE
- sub a3, a3, a0
- s32i a2, a3, PID
- s32i a2, a3, TID
-.Lskip_restore_pid:
-#endif
-
/* start child thread */
movi a0, 0 /* terminate the stack frame */
@@ -115,5 +97,4 @@ ENTRY (__clone)
#endif
PSEUDO_END (__clone)
-
weak_alias (__clone, clone)
diff --git a/libc/sysdeps/linux/xtensa/vfork.S b/libc/sysdeps/linux/xtensa/vfork.S
index 8058fb057..140ab775e 100644
--- a/libc/sysdeps/linux/xtensa/vfork.S
+++ b/libc/sysdeps/linux/xtensa/vfork.S
@@ -34,16 +34,6 @@
*/
-#ifndef SAVE_PID
-#define SAVE_PID(a,b,c,d)
-#endif
-#ifndef RESTORE_PID
-#define RESTORE_PID(a,b,c)
-#endif
-#ifndef RESTORE_PID12
-#define RESTORE_PID12(a,b,c)
-#endif
-
/*
pid_t vfork(void);
Implemented as __clone_syscall(CLONE_VFORK | CLONE_VM | SIGCHLD, 0)
@@ -73,8 +63,6 @@ HIDDEN_ENTRY (__vfork)
.L4: mov a12, a2
mov a13, a3
- SAVE_PID(a5,a15,a2,a3)
-
/* use syscall 'clone' and set new stack pointer to the same address */
movi a2, SYS_ify(clone)
@@ -83,8 +71,6 @@ HIDDEN_ENTRY (__vfork)
syscall
- RESTORE_PID(a5,a15,a2)
-
movi a5, -4096
mov a6, a2
@@ -102,16 +88,12 @@ HIDDEN_ENTRY (__vfork)
mov a13, a3
mov a14, a6
- SAVE_PID(a9,a15,a2,a3)
-
movi a2, SYS_ify(clone)
movi a3, 0
movi a6, CLONE_VM | CLONE_VFORK | SIGCHLD
syscall
- RESTORE_PID(a9,a15,a2)
-
movi a9, -4096
mov a10, a2
@@ -131,16 +113,12 @@ HIDDEN_ENTRY (__vfork)
mov a13, a3
mov a14, a6
- SAVE_PID (a2,a3,a2,a6)
-
movi a2, SYS_ify(clone)
movi a3, 0
movi a6, CLONE_VM | CLONE_VFORK | SIGCHLD
syscall
- RESTORE_PID12(a3,a6,a15)
-
mov a3, a13
movi a13, -4096
@@ -168,7 +146,6 @@ HIDDEN_ENTRY (__vfork)
.Lpseudo_end:
retw
#elif defined(__XTENSA_CALL0_ABI__)
- SAVE_PID(a5, a8, a3, a4)
/* Use syscall 'clone'. Set new stack pointer to the same address. */
movi a2, SYS_ify (clone)
@@ -176,8 +153,6 @@ HIDDEN_ENTRY (__vfork)
movi a6, CLONE_VM | CLONE_VFORK | SIGCHLD
syscall
- RESTORE_PID(a5, a8, a2)
-
movi a3, -4096
bgeu a2, a3, 1f
ret