summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arc
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/arc
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/arc')
-rw-r--r--libc/sysdeps/linux/arc/clone.S13
-rw-r--r--libc/sysdeps/linux/arc/vfork.S13
2 files changed, 1 insertions, 25 deletions
diff --git a/libc/sysdeps/linux/arc/clone.S b/libc/sysdeps/linux/arc/clone.S
index 3942b88f7..c2ce906c9 100644
--- a/libc/sysdeps/linux/arc/clone.S
+++ b/libc/sysdeps/linux/arc/clone.S
@@ -61,20 +61,9 @@ ENTRY(clone)
; Setup TP register (since kernel doesn't do that)
and.f 0, r12, CLONE_SETTLS
bz .Lnext_clone_quirk
- SET_TP r9
+ mov r25, r9
.Lnext_clone_quirk:
-#ifdef RESET_PID
- bbit1 r12, 16, .Lgo_thread ; CLONE_THREAD = (1 << 16)
-
- mov r8, __NR_getpid
- ARC_TRAP_INSN ; r0 has PID
- THREAD_SELF r1 ; Get to struct pthread (just before TCB)
- st r0, [r1, PTHREAD_PID]
- st r0, [r1, PTHREAD_TID]
-
-.Lgo_thread:
-#endif
#endif
; child jumps off to @fn with @arg as argument, and returns here
jl.d [r10]
diff --git a/libc/sysdeps/linux/arc/vfork.S b/libc/sysdeps/linux/arc/vfork.S
index 573a29f26..11959b66b 100644
--- a/libc/sysdeps/linux/arc/vfork.S
+++ b/libc/sysdeps/linux/arc/vfork.S
@@ -16,25 +16,12 @@
#define CLONE_FLAGS_FOR_VFORK (CLONE_VM|CLONE_VFORK|SIGCHLD)
ENTRY(__vfork)
-#ifdef SAVE_PID
- THREAD_SELF r1 ; Get to struct pthread (just before TCB)
- ld r2, [r1, PTHREAD_PID]
- neg.f r3, r2
- bset.z r3, r3, 31
- st r3, [r1, PTHREAD_PID]
-#endif
mov r0, CLONE_FLAGS_FOR_VFORK
mov_s r1, sp
mov r8, __NR_clone
ARC_TRAP_INSN
cmp r0, 0
-#ifdef RESTORE_PID
- bz 1f ; child continues
- THREAD_SELF r1 ; Get to struct pthread (just before TCB)
- st r2, [r1, PTHREAD_PID]
-1:
-#endif
jge [blink] ; pid >=0 return, else detour via tailcall to errno
b __syscall_error