diff options
Diffstat (limited to 'libpthread/nptl/sysdeps')
63 files changed, 120 insertions, 790 deletions
diff --git a/libpthread/nptl/sysdeps/alpha/tcb-offsets.sym b/libpthread/nptl/sysdeps/alpha/tcb-offsets.sym index c21a79104..1005621b3 100644 --- a/libpthread/nptl/sysdeps/alpha/tcb-offsets.sym +++ b/libpthread/nptl/sysdeps/alpha/tcb-offsets.sym @@ -10,5 +10,4 @@ #define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - sizeof(struct pthread)) MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads) -PID_OFFSET thread_offsetof (pid) TID_OFFSET thread_offsetof (tid) diff --git a/libpthread/nptl/sysdeps/arc/tcb-offsets.sym b/libpthread/nptl/sysdeps/arc/tcb-offsets.sym index cbf0ae42c..519a62954 100644 --- a/libpthread/nptl/sysdeps/arc/tcb-offsets.sym +++ b/libpthread/nptl/sysdeps/arc/tcb-offsets.sym @@ -2,7 +2,6 @@ #include <tls.h> PTHREAD_TID offsetof (struct pthread, tid) -PTHREAD_PID offsetof (struct pthread, pid) MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads) TLS_PRE_TCB_SIZE sizeof (struct pthread) TLS_TCB_SIZE sizeof(tcbhead_t) diff --git a/libpthread/nptl/sysdeps/arm/tcb-offsets.sym b/libpthread/nptl/sysdeps/arm/tcb-offsets.sym index 92cc441d3..bf9c0a1c1 100644 --- a/libpthread/nptl/sysdeps/arm/tcb-offsets.sym +++ b/libpthread/nptl/sysdeps/arm/tcb-offsets.sym @@ -7,5 +7,4 @@ #define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - sizeof(struct pthread)) MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads) -PID_OFFSET thread_offsetof (pid) TID_OFFSET thread_offsetof (tid) diff --git a/libpthread/nptl/sysdeps/i386/tcb-offsets.sym b/libpthread/nptl/sysdeps/i386/tcb-offsets.sym index 69f9deb36..990ac7a57 100644 --- a/libpthread/nptl/sysdeps/i386/tcb-offsets.sym +++ b/libpthread/nptl/sysdeps/i386/tcb-offsets.sym @@ -3,7 +3,6 @@ RESULT offsetof (struct pthread, result) TID offsetof (struct pthread, tid) -PID offsetof (struct pthread, pid) CANCELHANDLING offsetof (struct pthread, cancelhandling) CLEANUP_JMP_BUF offsetof (struct pthread, cleanup_jmp_buf) MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) diff --git a/libpthread/nptl/sysdeps/metag/tcb-offsets.sym b/libpthread/nptl/sysdeps/metag/tcb-offsets.sym index 753b72b2d..852b5cc26 100644 --- a/libpthread/nptl/sysdeps/metag/tcb-offsets.sym +++ b/libpthread/nptl/sysdeps/metag/tcb-offsets.sym @@ -3,7 +3,6 @@ RESULT offsetof (struct pthread, result) TID offsetof (struct pthread, tid) -PID offsetof (struct pthread, pid) CANCELHANDLING offsetof (struct pthread, cancelhandling) CLEANUP_JMP_BUF offsetof (struct pthread, cleanup_jmp_buf) MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads) diff --git a/libpthread/nptl/sysdeps/microblaze/tcb-offsets.sym b/libpthread/nptl/sysdeps/microblaze/tcb-offsets.sym index 18afbee29..614f0dfed 100644 --- a/libpthread/nptl/sysdeps/microblaze/tcb-offsets.sym +++ b/libpthread/nptl/sysdeps/microblaze/tcb-offsets.sym @@ -7,5 +7,4 @@ #define thread_offsetof(mem) (long)(offsetof (struct pthread, mem) - sizeof (struct pthread)) MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads) -PID_OFFSET thread_offsetof (pid) TID_OFFSET thread_offsetof (tid) diff --git a/libpthread/nptl/sysdeps/mips/tcb-offsets.sym b/libpthread/nptl/sysdeps/mips/tcb-offsets.sym index e0e71dc43..9ea25b94a 100644 --- a/libpthread/nptl/sysdeps/mips/tcb-offsets.sym +++ b/libpthread/nptl/sysdeps/mips/tcb-offsets.sym @@ -7,5 +7,4 @@ #define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE) MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads) -PID_OFFSET thread_offsetof (pid) TID_OFFSET thread_offsetof (tid) diff --git a/libpthread/nptl/sysdeps/nds32/tcb-offsets.sym b/libpthread/nptl/sysdeps/nds32/tcb-offsets.sym index 3b9e10186..6701626e1 100644 --- a/libpthread/nptl/sysdeps/nds32/tcb-offsets.sym +++ b/libpthread/nptl/sysdeps/nds32/tcb-offsets.sym @@ -7,6 +7,5 @@ #define thread_offsetof(mem) (long)(offsetof(struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE) MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads) -PID_OFFSET thread_offsetof (pid) TID_OFFSET thread_offsetof (tid) diff --git a/libpthread/nptl/sysdeps/nios2/tcb-offsets.sym b/libpthread/nptl/sysdeps/nios2/tcb-offsets.sym index d9ae95258..3cd8d984a 100644 --- a/libpthread/nptl/sysdeps/nios2/tcb-offsets.sym +++ b/libpthread/nptl/sysdeps/nios2/tcb-offsets.sym @@ -9,6 +9,5 @@ # define thread_offsetof(mem) ((ptrdiff_t) THREAD_SELF + offsetof (struct pthread, mem)) MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads) -PID_OFFSET thread_offsetof (pid) TID_OFFSET thread_offsetof (tid) POINTER_GUARD (offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t)) diff --git a/libpthread/nptl/sysdeps/powerpc/tcb-offsets.sym b/libpthread/nptl/sysdeps/powerpc/tcb-offsets.sym index 8ac133dfd..0bd16fb3a 100644 --- a/libpthread/nptl/sysdeps/powerpc/tcb-offsets.sym +++ b/libpthread/nptl/sysdeps/powerpc/tcb-offsets.sym @@ -12,7 +12,6 @@ #if TLS_MULTIPLE_THREADS_IN_TCB MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads) #endif -PID thread_offsetof (pid) TID thread_offsetof (tid) POINTER_GUARD (offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t)) #ifndef __ASSUME_PRIVATE_FUTEX diff --git a/libpthread/nptl/sysdeps/pthread/createthread.c b/libpthread/nptl/sysdeps/pthread/createthread.c index ebfee16f9..550bf2cfe 100644 --- a/libpthread/nptl/sysdeps/pthread/createthread.c +++ b/libpthread/nptl/sysdeps/pthread/createthread.c @@ -91,6 +91,7 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr, if (__builtin_expect (stopped != 0, 0)) { INTERNAL_SYSCALL_DECL (err); + pid_t pid = getpid (); int res = 0; /* Set the affinity mask if necessary. */ @@ -105,9 +106,7 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr, send it the cancellation signal. */ INTERNAL_SYSCALL_DECL (err2); err_out: - (void) INTERNAL_SYSCALL (tgkill, err2, 3, - THREAD_GETMEM (THREAD_SELF, pid), - pd->tid, SIGCANCEL); + (void) INTERNAL_SYSCALL (tgkill, err2, 3, pid, pd->tid, SIGCANCEL); return (INTERNAL_SYSCALL_ERROR_P (res, err) ? INTERNAL_SYSCALL_ERRNO (res, err) diff --git a/libpthread/nptl/sysdeps/sh/tcb-offsets.sym b/libpthread/nptl/sysdeps/sh/tcb-offsets.sym index 753b72b2d..852b5cc26 100644 --- a/libpthread/nptl/sysdeps/sh/tcb-offsets.sym +++ b/libpthread/nptl/sysdeps/sh/tcb-offsets.sym @@ -3,7 +3,6 @@ RESULT offsetof (struct pthread, result) TID offsetof (struct pthread, tid) -PID offsetof (struct pthread, pid) CANCELHANDLING offsetof (struct pthread, cancelhandling) CLEANUP_JMP_BUF offsetof (struct pthread, cleanup_jmp_buf) MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads) diff --git a/libpthread/nptl/sysdeps/sparc/tcb-offsets.sym b/libpthread/nptl/sysdeps/sparc/tcb-offsets.sym index 923af8a5b..f75d02065 100644 --- a/libpthread/nptl/sysdeps/sparc/tcb-offsets.sym +++ b/libpthread/nptl/sysdeps/sparc/tcb-offsets.sym @@ -3,5 +3,4 @@ MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) POINTER_GUARD offsetof (tcbhead_t, pointer_guard) -PID offsetof (struct pthread, pid) TID offsetof (struct pthread, tid) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/clone.S deleted file mode 100644 index eea1cbeed..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/clone.S +++ /dev/null @@ -1,2 +0,0 @@ -#define RESET_PID -#include <sysdeps/unix/sysv/linux/alpha/clone.S> diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/vfork.S deleted file mode 100644 index 664cac494..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/vfork.S +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> -#include <tcb-offsets.h> - -#undef PSEUDO_PREPARE_ARGS -#define PSEUDO_PREPARE_ARGS \ - /* Load the current cached pid value across the vfork. */ \ - rduniq; \ - ldl a2, PID_OFFSET(v0); \ - mov v0, a1; \ - /* If the cached value is initialized (nonzero), then write \ - back its negation, or INT_MIN, to indicate that the pid \ - value is uninitialized in the the child, and in the window \ - between here and the point at which we restore the value. */ \ - ldah t0, -0x8000; \ - negl a2, t1; \ - cmovne a2, t1, t0; \ - stl t0, PID_OFFSET(v0); - -PSEUDO (__vfork, vfork, 0) - - /* If we're back in the parent, restore the saved pid. */ - beq v0, 1f - stl a2, PID_OFFSET(a1) -1: ret - -PSEUDO_END (__vfork) -libc_hidden_def (__vfork) -weak_alias (__vfork, vfork) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch index fa5d530d4..64f3a4f7b 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch @@ -9,6 +9,3 @@ libpthread_linux_arch_SSRC = libpthread_linux_arch_CSRC = pthread_once.c libc_linux_arch_CSRC = fork.c -libc_linux_arch_SSRC = clone.S vfork.S -libc_linux_arch_SSRC-OMIT = waitpid.S - diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/clone.S deleted file mode 100644 index 5fd1de3c2..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/clone.S +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com) - * - * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. - */ - -#define RESET_PID -#include <tls.h> -#include <tcb-offsets.h> -#include "../../../../../../../libc/sysdeps/linux/arc/clone.S" diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/vfork.S deleted file mode 100644 index d29e05a8a..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/vfork.S +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com) - * - * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. - */ - -#define SAVE_PID -#define RESTORE_PID -#include <tls.h> -#include <tcb-offsets.h> -#include "../../../../../../../libc/sysdeps/linux/arc/vfork.S" diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch index 49d0684ee..55afe20af 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch @@ -9,11 +9,3 @@ libpthread_linux_arch_SSRC = libpthread_linux_arch_CSRC = pthread_once.c libc_linux_arch_CSRC = fork.c -libc_linux_arch_SSRC = clone.S vfork.S -libc_linux_arch_SSRC-OMIT = waitpid.S - -# We always compile it in arm mode because of SAVE_PID macro -# This macro should be alternatively implemented in THUMB -# assembly. -ASFLAGS-vfork.S = -marm -CFLAGS-OMIT-vfork.S = -mthumb diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S deleted file mode 100644 index 23227eb24..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S +++ /dev/null @@ -1,3 +0,0 @@ -#define RESET_PID -#include <tcb-offsets.h> -#include "../../../../../../../libc/sysdeps/linux/arm/clone.S" diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/vfork.S deleted file mode 100644 index b9e8cf846..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/vfork.S +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <tcb-offsets.h> - -/* Save the PID value. */ -#define SAVE_PID \ - str lr, [sp, #-4]!; /* Save LR. */ \ - mov r0, #0xffff0fff; /* Point to the high page. */ \ - mov lr, pc; /* Save our return address. */ \ - sub pc, r0, #31; /* Jump to the TLS entry. */ \ - ldr lr, [sp], #4; /* Restore LR. */ \ - mov r2, r0; /* Save the TLS addr in r2. */ \ - ldr r3, [r2, #PID_OFFSET]; /* Load the saved PID. */ \ - rsbs r0, r3, #0; /* Negate it. */ \ - moveq r0, #0x80000000; /* Use 0x80000000 if it was 0. */ \ - str r0, [r2, #PID_OFFSET] /* Store the temporary PID. */ - -/* Restore the old PID value in the parent. */ -#define RESTORE_PID \ - cmp r0, #0; /* If we are the parent... */ \ - strne r3, [r2, #PID_OFFSET] /* ... restore the saved PID. */ - -#include "../../../../../../../libc/sysdeps/linux/arm/vfork.S" diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c b/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c index af4041031..49806dab9 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c @@ -135,12 +135,6 @@ fork (void) pid_t ppid = THREAD_GETMEM (THREAD_SELF, tid); #endif - /* We need to prevent the getpid() code to update the PID field so - that, if a signal arrives in the child very early and the signal - handler uses getpid(), the value returned is correct. */ - pid_t parentpid = THREAD_GETMEM (THREAD_SELF, pid); - THREAD_SETMEM (THREAD_SELF, pid, -parentpid); - #ifdef ARCH_FORK pid = ARCH_FORK (); #else @@ -158,9 +152,6 @@ fork (void) if (__fork_generation_pointer != NULL) *__fork_generation_pointer += 4; - /* Adjust the PID field for the new process. */ - THREAD_SETMEM (self, pid, THREAD_GETMEM (self, tid)); - #if HP_TIMING_AVAIL /* The CPU clock of the thread and process have to be set to z |