From 6b6ede3d15f04fe825cfa9f697507457e3640344 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 14 Feb 2015 23:00:19 -0600 Subject: resolve merge --- .../linuxthreads/sysdeps/alpha/elf/pt-initfini.c | 89 ---- libpthread/linuxthreads/sysdeps/alpha/pspinlock.c | 109 ---- libpthread/linuxthreads/sysdeps/alpha/tls.h | 133 ----- libpthread/linuxthreads/sysdeps/arc/pt-machine.h | 42 ++ libpthread/linuxthreads/sysdeps/arm/pspinlock.c | 81 --- libpthread/linuxthreads/sysdeps/arm/pt-machine.h | 69 ++- .../linuxthreads/sysdeps/arm/sysdep-cancel.h | 8 - libpthread/linuxthreads/sysdeps/arm/tls.h | 171 ------ libpthread/linuxthreads/sysdeps/bfin/pt-machine.h | 75 +++ libpthread/linuxthreads/sysdeps/c6x/pt-machine.h | 63 +++ libpthread/linuxthreads/sysdeps/cris/pspinlock.c | 71 --- libpthread/linuxthreads/sysdeps/cris/pt-machine.h | 21 +- libpthread/linuxthreads/sysdeps/frv/pt-machine.h | 69 +++ libpthread/linuxthreads/sysdeps/h8300/pt-machine.h | 57 ++ libpthread/linuxthreads/sysdeps/hppa/pspinlock.c | 80 --- libpthread/linuxthreads/sysdeps/hppa/pt-machine.h | 59 --- .../linuxthreads/sysdeps/i386/i686/pt-machine.h | 78 --- libpthread/linuxthreads/sysdeps/i386/pspinlock.c | 102 ---- libpthread/linuxthreads/sysdeps/i386/pt-machine.h | 93 ++-- .../linuxthreads/sysdeps/i386/tcb-offsets.sym | 7 - libpthread/linuxthreads/sysdeps/i386/tls.h | 84 +-- libpthread/linuxthreads/sysdeps/i386/useldt.h | 19 +- libpthread/linuxthreads/sysdeps/ia64/pspinlock.c | 78 --- libpthread/linuxthreads/sysdeps/ia64/pt-machine.h | 6 +- .../linuxthreads/sysdeps/ia64/tcb-offsets.sym | 9 - libpthread/linuxthreads/sysdeps/ia64/tls.h | 6 - libpthread/linuxthreads/sysdeps/m68k/pspinlock.c | 91 ---- libpthread/linuxthreads/sysdeps/m68k/pt-machine.h | 8 +- .../linuxthreads/sysdeps/microblaze/pt-machine.h | 106 ++++ .../sysdeps/microblaze/sigcontextinfo.h | 17 + libpthread/linuxthreads/sysdeps/mips/pspinlock.c | 95 ---- libpthread/linuxthreads/sysdeps/mips/pt-machine.h | 41 +- libpthread/linuxthreads/sysdeps/mips/tls.h | 169 ------ libpthread/linuxthreads/sysdeps/nios/pt-machine.h | 67 +++ libpthread/linuxthreads/sysdeps/nios2/pt-machine.h | 57 ++ .../sysdeps/powerpc/powerpc32/pspinlock.c | 69 --- .../sysdeps/powerpc/powerpc32/pt-machine.h | 119 ----- .../sysdeps/powerpc/powerpc64/pspinlock.c | 69 --- .../sysdeps/powerpc/powerpc64/pt-machine.h | 184 ------- .../linuxthreads/sysdeps/powerpc/pspinlock.c | 8 - .../linuxthreads/sysdeps/powerpc/pt-machine.h | 103 +++- .../linuxthreads/sysdeps/powerpc/tcb-offsets.sym | 19 - libpthread/linuxthreads/sysdeps/powerpc/tls.h | 164 ------ .../linuxthreads/sysdeps/pthread/bits/initspin.h | 27 - .../linuxthreads/sysdeps/pthread/bits/libc-lock.h | 65 +-- .../linuxthreads/sysdeps/pthread/bits/libc-tsd.h | 14 +- .../sysdeps/pthread/bits/pthreadtypes.h | 12 +- .../linuxthreads/sysdeps/pthread/bits/typesizes.h | 65 --- .../linuxthreads/sysdeps/pthread/errno-loc.c | 44 -- .../linuxthreads/sysdeps/pthread/flockfile.c | 32 -- .../linuxthreads/sysdeps/pthread/ftrylockfile.c | 32 -- .../linuxthreads/sysdeps/pthread/funlockfile.c | 32 -- .../linuxthreads/sysdeps/pthread/getcpuclockid.c | 116 ----- .../linuxthreads/sysdeps/pthread/herrno-loc.c | 44 -- libpthread/linuxthreads/sysdeps/pthread/list.h | 113 ---- .../linuxthreads/sysdeps/pthread/malloc-machine.h | 66 --- .../linuxthreads/sysdeps/pthread/not-cancel.h | 4 +- .../linuxthreads/sysdeps/pthread/posix-timer.h | 203 -------- .../linuxthreads/sysdeps/pthread/pt-initfini.c | 123 ----- .../sysdeps/pthread/pthread-functions.h | 14 +- libpthread/linuxthreads/sysdeps/pthread/pthread.h | 46 +- .../linuxthreads/sysdeps/pthread/ptlongjmp.c | 32 -- .../linuxthreads/sysdeps/pthread/res-state.c | 46 -- .../linuxthreads/sysdeps/pthread/semaphore.h | 1 - .../linuxthreads/sysdeps/pthread/sigaction.c | 56 -- .../linuxthreads/sysdeps/pthread/tcb-offsets.h | 1 - .../linuxthreads/sysdeps/pthread/timer_create.c | 169 ------ .../linuxthreads/sysdeps/pthread/timer_delete.c | 69 --- .../linuxthreads/sysdeps/pthread/timer_getoverr.c | 44 -- .../linuxthreads/sysdeps/pthread/timer_gettime.c | 76 --- .../linuxthreads/sysdeps/pthread/timer_routines.c | 572 --------------------- .../linuxthreads/sysdeps/pthread/timer_settime.c | 136 ----- libpthread/linuxthreads/sysdeps/pthread/tls.h | 80 +++ .../linuxthreads/sysdeps/pthread/tst-timer.c | 113 ---- .../linuxthreads/sysdeps/pthread/uClibc-glue.h | 47 -- libpthread/linuxthreads/sysdeps/sh/pspinlock.c | 79 --- libpthread/linuxthreads/sysdeps/sh/tcb-offsets.sym | 10 - libpthread/linuxthreads/sysdeps/sh/tls.h | 140 ++--- libpthread/linuxthreads/sysdeps/sh64/Makefile.arch | 30 ++ libpthread/linuxthreads/sysdeps/sh64/pt-machine.c | 46 ++ libpthread/linuxthreads/sysdeps/sh64/pt-machine.h | 38 ++ libpthread/linuxthreads/sysdeps/sparc/pspinlock.c | 87 ---- .../linuxthreads/sysdeps/sparc/tcb-offsets.h | 1 + .../linuxthreads/sysdeps/sparc/tcb-offsets.sym | 4 - libpthread/linuxthreads/sysdeps/sparc/tls.h | 114 ---- .../sysdeps/unix/sysv/linux/allocalim.h | 25 - .../sysdeps/unix/sysv/linux/allocrtsig.c | 88 ---- .../sysdeps/unix/sysv/linux/alpha/aio_cancel.c | 33 -- .../sysdeps/unix/sysv/linux/alpha/bits/local_lim.h | 91 ---- .../sysdeps/unix/sysv/linux/alpha/bits/typesizes.h | 65 --- .../sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S | 27 - .../sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h | 145 ------ .../sysdeps/unix/sysv/linux/alpha/vfork.S | 69 --- .../sysdeps/unix/sysv/linux/arm/sysdep-cancel.h | 129 ----- .../sysdeps/unix/sysv/linux/arm/vfork.S | 77 --- .../linuxthreads/sysdeps/unix/sysv/linux/execve.c | 39 -- .../linuxthreads/sysdeps/unix/sysv/linux/fork.c | 29 -- .../linuxthreads/sysdeps/unix/sysv/linux/fork.h | 57 -- .../sysdeps/unix/sysv/linux/hppa/aio_cancel.c | 33 -- .../sysdeps/unix/sysv/linux/hppa/bits/initspin.h | 26 - .../sysdeps/unix/sysv/linux/hppa/malloc-machine.h | 72 --- .../sysdeps/unix/sysv/linux/hppa/pt-initfini.c | 108 ---- .../sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h | 188 ------- .../sysdeps/unix/sysv/linux/i386/sysdep-cancel.h | 186 ------- .../sysdeps/unix/sysv/linux/i386/vfork.S | 94 ---- .../sysdeps/unix/sysv/linux/ia64/bits/local_lim.h | 91 ---- .../sysdeps/unix/sysv/linux/ia64/fork.h | 24 - .../sysdeps/unix/sysv/linux/ia64/pt-initfini.c | 141 ----- .../sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c | 32 -- .../sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h | 143 ------ .../sysdeps/unix/sysv/linux/ia64/vfork.S | 53 -- .../sysdeps/unix/sysv/linux/jmp-unwind.c | 34 -- .../sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h | 128 ----- .../sysdeps/unix/sysv/linux/m68k/vfork.S | 83 --- .../unix/sysv/linux/mips/mips64/sysdep-cancel.h | 143 ------ .../sysdeps/unix/sysv/linux/mips/sysdep-cancel.h | 143 ------ .../sysdeps/unix/sysv/linux/mips/vfork.S | 104 ---- .../sysdeps/unix/sysv/linux/mq_notify.c | 284 ---------- .../sysv/linux/powerpc/powerpc32/sysdep-cancel.h | 158 ------ .../unix/sysv/linux/powerpc/powerpc32/vfork.S | 85 --- .../sysv/linux/powerpc/powerpc64/sysdep-cancel.h | 126 ----- .../unix/sysv/linux/powerpc/powerpc64/vfork.S | 90 ---- .../sysdeps/unix/sysv/linux/powerpc/ptlongjmp.c | 70 --- .../sysdeps/unix/sysv/linux/pt-sigsuspend.c | 32 -- .../linuxthreads/sysdeps/unix/sysv/linux/raise.c | 41 -- .../sysdeps/unix/sysv/linux/register-atfork.c | 86 ---- .../sysdeps/unix/sysv/linux/sh/pt-initfini.c | 142 ----- .../linuxthreads/sysdeps/unix/sysv/linux/sh/smp.h | 23 - .../sysdeps/unix/sysv/linux/sh/sysdep-cancel.h | 226 -------- .../sysdeps/unix/sysv/linux/sh/vfork.S | 77 --- .../linuxthreads/sysdeps/unix/sysv/linux/sigwait.c | 82 --- .../linuxthreads/sysdeps/unix/sysv/linux/smp.h | 47 -- .../sysdeps/unix/sysv/linux/sparc/aio_cancel.c | 33 -- .../sysdeps/unix/sysv/linux/sparc/bits/local_lim.h | 91 ---- .../sysdeps/unix/sysv/linux/sparc/bits/typesizes.h | 65 --- .../sysdeps/unix/sysv/linux/sparc/fork.h | 20 - .../sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h | 100 ---- .../sysdeps/unix/sysv/linux/sparc/vfork.S | 64 --- .../sysdeps/unix/sysv/linux/unregister-atfork.c | 48 -- .../sysdeps/unix/sysv/linux/x86_64/pt-sigsuspend.c | 1 - .../sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h | 131 ----- .../sysdeps/unix/sysv/linux/x86_64/vfork.S | 61 --- libpthread/linuxthreads/sysdeps/v850/pt-machine.h | 52 ++ libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c | 96 ---- .../linuxthreads/sysdeps/x86_64/pt-machine.h | 156 +----- .../linuxthreads/sysdeps/x86_64/tcb-offsets.sym | 4 - .../linuxthreads/sysdeps/xtensa/pt-machine.h | 79 +++ 147 files changed, 1345 insertions(+), 10033 deletions(-) delete mode 100644 libpthread/linuxthreads/sysdeps/alpha/elf/pt-initfini.c delete mode 100644 libpthread/linuxthreads/sysdeps/alpha/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/alpha/tls.h create mode 100644 libpthread/linuxthreads/sysdeps/arc/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/arm/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/arm/tls.h create mode 100644 libpthread/linuxthreads/sysdeps/bfin/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/c6x/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/cris/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/frv/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/h8300/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/hppa/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/hppa/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/i386/i686/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/i386/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/i386/tcb-offsets.sym delete mode 100644 libpthread/linuxthreads/sysdeps/ia64/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/ia64/tcb-offsets.sym delete mode 100644 libpthread/linuxthreads/sysdeps/m68k/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/microblaze/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/microblaze/sigcontextinfo.h delete mode 100644 libpthread/linuxthreads/sysdeps/mips/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/mips/tls.h create mode 100644 libpthread/linuxthreads/sysdeps/nios/pt-machine.h create mode 100644 libpthread/linuxthreads/sysdeps/nios2/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/powerpc/powerpc32/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/powerpc/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/powerpc/tcb-offsets.sym delete mode 100644 libpthread/linuxthreads/sysdeps/powerpc/tls.h delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/bits/initspin.h delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/bits/typesizes.h delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/errno-loc.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/flockfile.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/ftrylockfile.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/funlockfile.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/getcpuclockid.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/herrno-loc.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/list.h delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/malloc-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/posix-timer.h delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/pt-initfini.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/ptlongjmp.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/res-state.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/semaphore.h delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/sigaction.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/tcb-offsets.h delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/timer_create.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/timer_delete.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/timer_getoverr.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/timer_gettime.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/timer_routines.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/timer_settime.c create mode 100644 libpthread/linuxthreads/sysdeps/pthread/tls.h delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/tst-timer.c delete mode 100644 libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h delete mode 100644 libpthread/linuxthreads/sysdeps/sh/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/sh/tcb-offsets.sym create mode 100644 libpthread/linuxthreads/sysdeps/sh64/Makefile.arch create mode 100644 libpthread/linuxthreads/sysdeps/sh64/pt-machine.c create mode 100644 libpthread/linuxthreads/sysdeps/sh64/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/pspinlock.c create mode 100644 libpthread/linuxthreads/sysdeps/sparc/tcb-offsets.h delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/tcb-offsets.sym delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/tls.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocalim.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/allocrtsig.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/aio_cancel.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/vfork.S delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/vfork.S delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/execve.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/aio_cancel.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/malloc-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/vfork.S delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/fork.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-initfini.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/ia64/vfork.S delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/jmp-unwind.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/vfork.S delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/vfork.S delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/mq_notify.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/ptlongjmp.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/raise.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/register-atfork.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/pt-initfini.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/smp.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sigwait.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/smp.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/aio_cancel.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/unregister-atfork.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/pt-sigsuspend.c delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/x86_64/vfork.S create mode 100644 libpthread/linuxthreads/sysdeps/v850/pt-machine.h delete mode 100644 libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c delete mode 100644 libpthread/linuxthreads/sysdeps/x86_64/tcb-offsets.sym create mode 100644 libpthread/linuxthreads/sysdeps/xtensa/pt-machine.h (limited to 'libpthread/linuxthreads/sysdeps') diff --git a/libpthread/linuxthreads/sysdeps/alpha/elf/pt-initfini.c b/libpthread/linuxthreads/sysdeps/alpha/elf/pt-initfini.c deleted file mode 100644 index 6cdc69d58..000000000 --- a/libpthread/linuxthreads/sysdeps/alpha/elf/pt-initfini.c +++ /dev/null @@ -1,89 +0,0 @@ -/* Special .init and .fini section support for Alpha. Linuxthreads version. - Copyright (C) 2002, 2003 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 - . */ - -/* This file is compiled into assembly code which is then munged by a sed - script into two files: crti.s and crtn.s. - - * crti.s puts a function prologue at the beginning of the .init and .fini - sections and defines global symbols for those addresses, so they can be - called as functions. - - * crtn.s puts the corresponding function epilogues in the .init and .fini - sections. - - This differs from what would be generated by the generic code in that - we save and restore the GP within the function. In order for linker - relaxation to work, the value in the GP register on exit from a function - must be valid for the function entry point. Normally, a function is - contained within one object file and this is not an issue, provided - that the function reloads the gp after making any function calls. - However, _init and _fini are constructed from pieces of many object - files, all of which may have different GP values. So we must reload - the GP value from crti.o in crtn.o. */ - -__asm__ (" \n\ -#include \"defs.h\" \n\ - \n\ -/*@HEADER_ENDS*/ \n\ - \n\ -/*@_init_PROLOG_BEGINS*/ \n\ - .section .init, \"ax\", @progbits \n\ - .globl _init \n\ - .type _init,@function \n\ - .usepv _init,std \n\ -_init: \n\ - ldgp $29, 0($27) \n\ - subq $30, 16, $30 \n\ - stq $26, 0($30) \n\ - stq $29, 8($30) \n\ - jsr $26, __pthread_initialize_minimal \n\ - ldq $29, 8($30) \n\ - .align 3 \n\ -/*@_init_PROLOG_ENDS*/ \n\ - \n\ -/*@_init_EPILOG_BEGINS*/ \n\ - .section .init, \"ax\", @progbits \n\ - ldq $26, 0($30) \n\ - ldq $29, 8($30) \n\ - addq $30, 16, $30 \n\ - ret \n\ -/*@_init_EPILOG_ENDS*/ \n\ - \n\ -/*@_fini_PROLOG_BEGINS*/ \n\ - .section .fini, \"ax\", @progbits \n\ - .globl _fini \n\ - .type _fini,@function \n\ - .usepv _fini,std \n\ -_fini: \n\ - ldgp $29, 0($27) \n\ - subq $30, 16, $30 \n\ - stq $26, 0($30) \n\ - stq $29, 8($30) \n\ - .align 3 \n\ -/*@_fini_PROLOG_ENDS*/ \n\ - \n\ -/*@_fini_EPILOG_BEGINS*/ \n\ - .section .fini, \"ax\", @progbits \n\ - ldq $26, 0($30) \n\ - ldq $29, 8($30) \n\ - addq $30, 16, $30 \n\ - ret \n\ -/*@_fini_EPILOG_ENDS*/ \n\ - \n\ -/*@TRAILER_BEGINS*/ \n\ -"); diff --git a/libpthread/linuxthreads/sysdeps/alpha/pspinlock.c b/libpthread/linuxthreads/sysdeps/alpha/pspinlock.c deleted file mode 100644 index cdf4be99c..000000000 --- a/libpthread/linuxthreads/sysdeps/alpha/pspinlock.c +++ /dev/null @@ -1,109 +0,0 @@ -/* POSIX spinlock implementation. Alpha version. - Copyright (C) 2000 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; see the file COPYING.LIB. If - not, see . */ - -#include -#include -#include "internals.h" - - -/* This implementation is similar to the one used in the Linux kernel. - But the kernel is byte instructions for the memory access. This is - faster but unusable here. The problem is that only 128 - threads/processes could use the spinlock at the same time. If (by - a design error in the program) a thread/process would hold the - spinlock for a time long enough to accumulate 128 waiting - processes, the next one will find a positive value in the spinlock - and assume it is unlocked. We cannot accept that. */ - -int -__pthread_spin_lock (pthread_spinlock_t *lock) -{ - unsigned int tmp; - __asm__ __volatile__ - ("1: ldl_l %0,%1\n" - " blbs %0,2f\n" - " or %0,1,%0\n" - " stl_c %0,%1\n" - " beq %0,2f\n" - " mb\n" - ".subsection 2\n" - "2: ldl %0,%1\n" - " blbs %0,2b\n" - " br 1b\n" - ".previous" - : "=r" (tmp), "=m" (lock) - : "m" (lock)); - return 0; -} -weak_alias (__pthread_spin_lock, pthread_spin_lock) - - -int -__pthread_spin_trylock (pthread_spinlock_t *lock) -{ - unsigned long int oldval; - unsigned long int temp; - - __asm__ __volatile__ - ("1: ldl_l %0,%1\n" - " and %0,%3,%2\n" - " bne %2,2f\n" - " xor %0,%3,%0\n" - " stl_c %0,%1\n" - " beq %0,3f\n" - " mb\n" - "2:\n" - ".subsection 2\n" - "3: br 1b\n" - ".previous" - : "=&r" (temp), "=m" (*lock), "=&r" (oldval) - : "Ir" (1UL), "m" (*lock)); - - return oldval == 0 ? 0 : EBUSY; -} -weak_alias (__pthread_spin_trylock, pthread_spin_trylock) - - -int -__pthread_spin_unlock (pthread_spinlock_t *lock) -{ - __asm__ __volatile__ ("mb"); - return *lock = 0; -} -weak_alias (__pthread_spin_unlock, pthread_spin_unlock) - - -int -__pthread_spin_init (pthread_spinlock_t *lock, int pshared) -{ - /* We can ignore the `pshared' parameter. Since we are busy-waiting - all processes which can access the memory location `lock' points - to can use the spinlock. */ - *lock = 0; - return 0; -} -weak_alias (__pthread_spin_init, pthread_spin_init) - - -int -__pthread_spin_destroy (pthread_spinlock_t *lock) -{ - /* Nothing to do. */ - return 0; -} -weak_alias (__pthread_spin_destroy, pthread_spin_destroy) diff --git a/libpthread/linuxthreads/sysdeps/alpha/tls.h b/libpthread/linuxthreads/sysdeps/alpha/tls.h deleted file mode 100644 index 51c7fea8b..000000000 --- a/libpthread/linuxthreads/sysdeps/alpha/tls.h +++ /dev/null @@ -1,133 +0,0 @@ -/* Definitions for thread-local data handling. linuxthreads/Alpha version. - Copyright (C) 2002, 2003, 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 - . */ - -#ifndef _TLS_H -#define _TLS_H - -#ifndef __ASSEMBLER__ - -# include -# include -# include - -/* Type for the dtv. */ -typedef union dtv -{ - size_t counter; - struct - { - void *val; - bool is_static; - } pointer; -} dtv_t; - - -typedef struct -{ - dtv_t *dtv; - - /* Reserved for the thread implementation. Unused in LinuxThreads. */ - void *private; -} tcbhead_t; -#endif - - -#ifdef HAVE_TLS_SUPPORT - -/* Signal that TLS support is available. */ -# define USE_TLS 1 - -# ifndef __ASSEMBLER__ -/* Get system call information. */ -# include - -/* This is the size of the initial TCB. */ -# define TLS_INIT_TCB_SIZE sizeof (tcbhead_t) - -/* Alignment requirements for the initial TCB. */ -# define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) - -/* This is the size of the TCB. */ -# define TLS_TCB_SIZE sizeof (tcbhead_t) - -/* Alignment requirements for the TCB. */ -# define TLS_TCB_ALIGN __alignof__ (tcbhead_t) - -/* This is the size we need before TCB. */ -# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) - -/* The DTV is allocated at the TP; the TCB is placed elsewhere. */ -# define TLS_DTV_AT_TP 1 - -/* Install the dtv pointer. The pointer passed is to the element with - index -1 which contain the length. */ -# define INSTALL_DTV(TCBP, DTVP) \ - (((tcbhead_t *) (TCBP))->dtv = (DTVP) + 1) - -/* Install new dtv for current thread. */ -# define INSTALL_NEW_DTV(DTV) \ - (((tcbhead_t *)__builtin_thread_pointer ())->dtv = (DTV)) - -/* Return dtv of given thread descriptor. */ -# define GET_DTV(TCBP) \ - (((tcbhead_t *) (TCBP))->dtv) - -/* Code to initially initialize the thread pointer. This might need - special attention since 'errno' is not yet available and if the - operation can cause a failure 'errno' must not be touched. */ -# define TLS_INIT_TP(TCBP, SECONDCALL) \ - (__builtin_set_thread_pointer (TCBP), 0) - -/* Return the address of the dtv for the current thread. */ -# define THREAD_DTV() \ - (((tcbhead_t *)__builtin_thread_pointer ())->dtv) - -/* Return the thread descriptor for the current thread. */ -# undef THREAD_SELF -# define THREAD_SELF \ - ((pthread_descr)__builtin_thread_pointer () - 1) - -# undef INIT_THREAD_SELF -# define INIT_THREAD_SELF(DESCR, NR) \ - __builtin_set_thread_pointer ((struct _pthread_descr_struct *)(DESCR) + 1) - -/* Get the thread descriptor definition. */ -# include - -/* ??? Generic bits of LinuxThreads may call these macros with - DESCR set to NULL. We are expected to be able to reference - the "current" value. - - In our case, we'd really prefer to use DESCR, since lots of - PAL_code calls would be expensive. We can only trust that - the compiler does its job and unifies the multiple - __builtin_thread_pointer instances. */ - -#define THREAD_GETMEM(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_GETMEM_NC(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_SETMEM(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) -#define THREAD_SETMEM_NC(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) - -# endif /* HAVE_TLS_SUPPORT */ -#endif /* __ASSEMBLER__ */ - -#endif /* tls.h */ diff --git a/libpthread/linuxthreads/sysdeps/arc/pt-machine.h b/libpthread/linuxthreads/sysdeps/arc/pt-machine.h new file mode 100644 index 000000000..8df1e77e3 --- /dev/null +++ b/libpthread/linuxthreads/sysdeps/arc/pt-machine.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com) + * + * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. + */ + +#ifndef _PT_MACHINE_H +#define _PT_MACHINE_H 1 +#include + +#ifndef PT_EI +# define PT_EI __extern_always_inline +#endif + +extern long int testandset (int *spinlock); +extern int __compare_and_swap (long int *p, long int oldval, long int newval); + +PT_EI long int +testandset (int *spinlock) +{ + unsigned int old = 1; + + /* Atomically exchange @spinlock with 1 */ + __asm__ __volatile__( + "ex %0, [%1]" + : "+r" (old) + : "r" (spinlock) + : "memory"); + + return old; + +} + +/* Get some notion of the current stack. Need not be exactly the top + of the stack, just something somewhere in the current frame. + I don't trust register variables, so let's do this the safe way. */ +#define CURRENT_STACK_FRAME \ +__extension__ ({ char *__sp; __asm__ ("mov %0,sp" : "=r" (__sp)); __sp; }) + +#else +#error PT_MACHINE already defined +#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/arm/pspinlock.c b/libpthread/linuxthreads/sysdeps/arm/pspinlock.c deleted file mode 100644 index 691085270..000000000 --- a/libpthread/linuxthreads/sysdeps/arm/pspinlock.c +++ /dev/null @@ -1,81 +0,0 @@ -/* POSIX spinlock implementation. Arm version. - Copyright (C) 2000 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; see the file COPYING.LIB. If - not, see . */ - -#include -#include -#include "internals.h" - - -int -__pthread_spin_lock (pthread_spinlock_t *lock) -{ - unsigned int val; - - do - __asm__ __volatile__ ("swp %0, %1, [%2]" - : "=r" (val) - : "0" (1), "r" (lock) - : "memory"); - while (val != 0); - - return 0; -} -weak_alias (__pthread_spin_lock, pthread_spin_lock) - - -int -__pthread_spin_trylock (pthread_spinlock_t *lock) -{ - unsigned int val; - - __asm__ __volatile__ ("swp %0, %1, [%2]" - : "=r" (val) - : "0" (1), "r" (lock) - : "memory"); - - return val ? EBUSY : 0; -} -weak_alias (__pthread_spin_trylock, pthread_spin_trylock) - - -int -__pthread_spin_unlock (pthread_spinlock_t *lock) -{ - return *lock = 0; -} -weak_alias (__pthread_spin_unlock, pthread_spin_unlock) - - -int -__pthread_spin_init (pthread_spinlock_t *lock, int pshared) -{ - /* We can ignore the `pshared' parameter. Since we are busy-waiting - all processes which can access the memory location `lock' points - to can use the spinlock. */ - return *lock = 0; -} -weak_alias (__pthread_spin_init, pthread_spin_init) - - -int -__pthread_spin_destroy (pthread_spinlock_t *lock) -{ - /* Nothing to do. */ - return 0; -} -weak_alias (__pthread_spin_destroy, pthread_spin_destroy) diff --git a/libpthread/linuxthreads/sysdeps/arm/pt-machine.h b/libpthread/linuxthreads/sysdeps/arm/pt-machine.h index 0a455b97d..2b877f980 100644 --- a/libpthread/linuxthreads/sysdeps/arm/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/arm/pt-machine.h @@ -1,6 +1,6 @@ /* Machine-dependent pthreads configuration and inline functions. ARM version. - Copyright (C) 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell . @@ -21,29 +21,86 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 -#include +#include +#include #ifndef PT_EI # define PT_EI __extern_always_inline #endif +#if defined(__thumb__) +#if defined(__USE_LDREXSTREX__) +PT_EI long int ldrex(int *spinlock) +{ + long int ret; + __asm__ __volatile__( + "ldrex %0, [%1]\n" + : "=r"(ret) + : "r"(spinlock) : "memory"); + return ret; +} + +PT_EI long int strex(int val, int *spinlock) +{ + long int ret; + __asm__ __volatile__( + "strex %0, %1, [%2]\n" + : "=r"(ret) + : "r" (val), "r"(spinlock) : "memory"); + return ret; +} + +/* Spinlock implementation; required. */ +PT_EI long int +testandset (int *spinlock) +{ + register unsigned int ret; + + do { + ret = ldrex(spinlock); + } while (strex(1, spinlock)); + + return ret; +} + +#else /* __USE_LDREXSTREX__ */ + /* This will not work on ARM1 or ARM2 because SWP is lacking on those machines. Unfortunately we have no way to detect this at compile time; let's hope nobody tries to use one. */ /* Spinlock implementation; required. */ -PT_EI long int -testandset (int *spinlock) +PT_EI long int testandset (int *spinlock); +PT_EI long int testandset (int *spinlock) { register unsigned int ret; + void *pc; + __asm__ __volatile__( + ".align 0\n" + "\tbx pc\n" + "\tnop\n" + "\t.arm\n" + "\tswp %0, %2, [%3]\n" + "\torr %1, pc, #1\n" + "\tbx %1\n" + "\t.force_thumb" + : "=r"(ret), "=r"(pc) + : "0"(1), "r"(spinlock)); + return ret; +} +#endif +#else /* __thumb__ */ +PT_EI long int testandset (int *spinlock); +PT_EI long int testandset (int *spinlock) +{ + register unsigned int ret; __asm__ __volatile__("swp %0, %1, [%2]" : "=r"(ret) : "0"(1), "r"(spinlock)); - return ret; } - +#endif /* Get some notion of the current stack. Need not be exactly the top of the stack, just something somewhere in the current frame. */ diff --git a/libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h deleted file mode 100644 index ba6a1e04b..000000000 --- a/libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h +++ /dev/null @@ -1,8 +0,0 @@ -#include - -/* No multi-thread handling enabled. */ -#define SINGLE_THREAD_P (1) -#define RTLD_SINGLE_THREAD_P (1) -#define LIBC_CANCEL_ASYNC() 0 /* Just a dummy value. */ -#define LIBC_CANCEL_RESET(val) ((void)(val)) /* Nothing, but evaluate it. */ -#define LIBC_CANCEL_HANDLED() /* Nothing. */ diff --git a/libpthread/linuxthreads/sysdeps/arm/tls.h b/libpthread/linuxthreads/sysdeps/arm/tls.h deleted file mode 100644 index df8d97009..000000000 --- a/libpthread/linuxthreads/sysdeps/arm/tls.h +++ /dev/null @@ -1,171 +0,0 @@ -/* Definitions for thread-local data handling. linuxthreads/ARM version. - 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 - . */ - -#ifndef _TLS_H -#define _TLS_H - -#ifndef __ASSEMBLER__ - -# include -# include -# include - -/* Type for the dtv. */ -typedef union dtv -{ - size_t counter; - struct - { - void *val; - bool is_static; - } pointer; -} dtv_t; - -typedef struct -{ - dtv_t *dtv; - - /* Reserved for the thread implementation. Unused in LinuxThreads. */ - void *private; -} tcbhead_t; -#endif - - -/* We can support TLS only if the floating-stack support is available. - However, we want to compile in the support and test at runtime whether - the running kernel can support it or not. To avoid bothering with the - TLS support code at all, use configure --without-tls. - - We need USE_TLS to be consistently defined, for ldsodefs.h conditionals. - But some of the code below can cause problems in building libpthread - (e.g. useldt.h will defined FLOATING_STACKS when it shouldn't). */ - -/* LinuxThreads can only support TLS if both floating stacks and support - from the tools are available. - - We have to define USE_TLS consistently, or ldsodefs.h will lay out types - differently between an NPTL build and a LinuxThreads build. It can be set - for libc.so and not libpthread.so, but only if we provide appropriate padding - in the _pthread_descr_struct. - - Currently nothing defines FLOATING_STACKS. We could assume this based on - kernel version once the TLS patches are available in kernel.org. - - To avoid bothering with the TLS support code at all, use configure - --without-tls. */ - -#if defined HAVE_TLS_SUPPORT \ - && (defined FLOATING_STACKS || !defined IS_IN_libpthread) - -/* Signal that TLS support is available. */ -# define USE_TLS 1 - -/* Include padding in _pthread_descr_struct so that libc can find p_errno, - if libpthread will only include the padding because of the !IS_IN_libpthread - check. */ -#ifndef FLOATING_STACKS -# define INCLUDE_TLS_PADDING 1 -#endif - -# ifndef __ASSEMBLER__ -/* Get system call information. */ -# include - -/* This is the size of the initial TCB. */ -# define TLS_INIT_TCB_SIZE sizeof (tcbhead_t) - -/* Alignment requirements for the initial TCB. */ -# define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) - -/* This is the size of the TCB. */ -# define TLS_TCB_SIZE sizeof (tcbhead_t) - -/* Alignment requirements for the TCB. */ -# define TLS_TCB_ALIGN __alignof__ (tcbhead_t) - -/* This is the size we need before TCB. */ -# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) - -/* The DTV is allocated at the TP; the TCB is placed elsewhere. */ -# define TLS_DTV_AT_TP 1 - -/* Install the dtv pointer. The pointer passed is to the element with - index -1 which contain the length. */ -# define INSTALL_DTV(TCBP, DTVP) \ - (((tcbhead_t *) (TCBP))->dtv = (DTVP) + 1) - -/* Install new dtv for current thread. */ -# define INSTALL_NEW_DTV(DTV) \ - (((tcbhead_t *)__builtin_thread_pointer ())->dtv = (DTV)) - -/* Return dtv of given thread descriptor. */ -# define GET_DTV(TCBP) \ - (((tcbhead_t *) (TCBP))->dtv) - -/* Code to initially initialize the thread pointer. This might need - special attention since 'errno' is not yet available and if the - operation can cause a failure 'errno' must not be touched. */ -# define TLS_INIT_TP(TCBP, SECONDCALL) \ - ({ INTERNAL_SYSCALL_DECL (err); \ - long result_var; \ - result_var = INTERNAL_SYSCALL_ARM (set_tls, err, 1, (TCBP)); \ - INTERNAL_SYSCALL_ERROR_P (result_var, err) \ - ? "unknown error" : NULL; }) - -/* Return the address of the dtv for the current thread. */ -# define THREAD_DTV() \ - (((tcbhead_t *)__builtin_thread_pointer ())->dtv) - -/* Return the thread descriptor for the current thread. */ -# undef THREAD_SELF -# define THREAD_SELF \ - ((pthread_descr)__builtin_thread_pointer () - 1) - -# undef INIT_THREAD_SELF -# define INIT_THREAD_SELF(DESCR, NR) \ - TLS_INIT_TP ((struct _pthread_descr_struct *)(DESCR) + 1, 0) - -/* Get the thread descriptor definition. */ -# include - -/* ??? Generic bits of LinuxThreads may call these macros with - DESCR set to NULL. We are expected to be able to reference - the "current" value. - - In our case, we'd really prefer to use DESCR, since lots of - PAL_code calls would be expensive. We can only trust that - the compiler does its job and unifies the multiple - __builtin_thread_pointer instances. */ - -#define THREAD_GETMEM(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_GETMEM_NC(descr, member) \ - ((void) sizeof (descr), THREAD_SELF->member) -#define THREAD_SETMEM(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) -#define THREAD_SETMEM_NC(descr, member, value) \ - ((void) sizeof (descr), THREAD_SELF->member = (value)) - -/* Initializing the thread pointer will generate a SIGILL if the syscall - is not available. */ -#define TLS_INIT_TP_EXPENSIVE 1 - -# endif /* HAVE_TLS_SUPPORT */ -#endif /* __ASSEMBLER__ */ - -#endif /* tls.h */ diff --git a/libpthread/linuxthreads/sysdeps/bfin/pt-machine.h b/libpthread/linuxthreads/sysdeps/bfin/pt-machine.h new file mode 100644 index 000000000..912d64b2c --- /dev/null +++ b/libpthread/linuxthreads/sysdeps/bfin/pt-machine.h @@ -0,0 +1,75 @@ +/* Machine-dependent pthreads configuration and inline functions. + Copyright (C) 1996, 1998, 2000, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson . + + 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; see the file COPYING.LIB. If + not, see . */ + +#ifndef _PT_MACHINE_H +#define _PT_MACHINE_H 1 + +#include + +#ifndef PT_EI +# define PT_EI __extern_always_inline +#endif + +#include + +/* Spinlock implementation; required. */ +/* The semantics of the TESTSET instruction cannot be guaranteed. We cannot + easily move all locks used by linux kernel to non-cacheable memory. + EXCPT 0x4 is used to trap into kernel to do the atomic testandset. + It's ugly. But it's the only thing we can do now. + The handler of EXCPT 0x4 expects the address of the lock is passed through + R0. And the result is returned by R0. */ +PT_EI long int +testandset (int *spinlock) +{ + long int res; + + __asm__ __volatile__ ( + "CALL (%4);" + : "=q0" (res), "=m" (*spinlock) + : "qA" (spinlock), "m" (*spinlock), "a" (ATOMIC_XCHG32), "q1" (1) + : "RETS", "cc", "memory"); + + return res; +} + +#define HAS_COMPARE_AND_SWAP +PT_EI int +__compare_and_swap (long int *p, long int oldval, long int newval) +{ + long int readval; + __asm__ __volatile__ ( + "CALL (%5);" + : "=q0" (readval), "=m" (*p) + : "qA" (p), + "q1" (oldval), + "q2" (newval), + "a" (ATOMIC_CAS32), + "m" (*p) + : "RETS", "memory", "cc"); + return readval == oldval; +} + +#ifdef SHARED +# define PTHREAD_STATIC_FN_REQUIRE(name) +#else +# define PTHREAD_STATIC_FN_REQUIRE(name) __asm__ (".globl " "_"#name); +#endif + +#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/c6x/pt-machine.h b/libpthread/linuxthreads/sysdeps/c6x/pt-machine.h new file mode 100644 index 000000000..5e8bfca56 --- /dev/null +++ b/libpthread/linuxthreads/sysdeps/c6x/pt-machine.h @@ -0,0 +1,63 @@ +/* Machine-dependent pthreads configuration and inline functions. + C6x version. + Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Aurelien Jacquiot . + + 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; see the file COPYING.LIB. If + not, see . */ + +#ifndef _PT_MACHINE_H +#define _PT_MACHINE_H 1 + +#ifndef PT_EI +# define PT_EI extern inline +#endif + +extern int __compare_and_swap (long int *p, long int oldval, long int newval); + +/* Spinlock implementation; required. */ +static inline long int +testandset (int *spinlock) +{ + register unsigned int ret = 1; + int dummy; + __asm__ __volatile__ ("mvc .s2 CSR, %0\n\tand .s2 -2, %0, %0\n\tmvc .s2 %0, CSR\n" + : "=b" (dummy)); + + if (*spinlock == 0) { + *spinlock = 1; + ret = 0; + } + __asm__ __volatile__ ("mvc .s2 CSR, %0\n\tor .s2 1, %0, %0\n\tmvc .s2 %0, CSR\n" + : "=b" (dummy)); + return ret; +} + +#define WRITE_MEMORY_BARRIER() +#define READ_MEMORY_BARRIER() + +/* Get some notion of the current stack. Need not be exactly the top + of the stack, just something somewhere in the current frame. */ +#define CURRENT_STACK_FRAME get_stack_pointer() +static inline char * get_stack_pointer(void) +{ + char *sp; + __asm__ __volatile__ ("mv .d2 B15, %0" : "=b" (sp)); + return sp; +} + +#define THREAD_STACK_OFFSET 8 + +#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/cris/pspinlock.c b/libpthread/linuxthreads/sysdeps/cris/pspinlock.c deleted file mode 100644 index 7e3e62959..000000000 --- a/libpthread/linuxthreads/sysdeps/cris/pspinlock.c +++ /dev/null @@ -1,71 +0,0 @@ -/* POSIX spinlock implementation. CRIS version. - Copyright (C) 2000, 2001 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; see the file COPYING.LIB. If - not, see . */ - -#include -#include -#include "internals.h" - -/* FIXME: These are just dummies. I don't know why or if they're needed; - configury should default to these definitions. We just follow the - crowd here. */ - -int -__pthread_spin_lock (pthread_spinlock_t *lock) -{ - while (testandset (lock) != 0) - ; - - return 0; -} -weak_alias (__pthread_spin_lock, pthread_spin_lock) - - -int -__pthread_spin_trylock (pthread_spinlock_t *lock) -{ - return testandset (lock) != 0 ? EBUSY : 0; -} -weak_alias (__pthread_spin_trylock, pthread_spin_trylock) - - -int -__pthread_spin_unlock (pthread_spinlock_t *lock) -{ - return *lock = 0; -} -weak_alias (__pthread_spin_unlock, pthread_spin_unlock) - - -int -__pthread_spin_init (pthread_spinlock_t *lock, int pshared) -{ - /* We can ignore the `pshared' parameter. Since we are busy-waiting - all processes which can access the memory location `lock' points - to can use the spinlock. */ - return *lock = 0; -} -weak_alias (__pthread_spin_init, pthread_spin_init) - - -int -__pthread_spin_destroy (pthread_spinlock_t *lock) -{ - /* Nothing to do. */ - return 0; -} -weak_alias (__pthread_spin_destroy, pthread_spin_destroy) diff --git a/libpthread/linuxthreads/sysdeps/cris/pt-machine.h b/libpthread/linuxthreads/sysdeps/cris/pt-machine.h index 9b2acb761..a89579ee0 100644 --- a/libpthread/linuxthreads/sysdeps/cris/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/cris/pt-machine.h @@ -14,9 +14,8 @@ 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; see the file COPYING.LIB. If - not, see . */ - + License along with the GNU C Library; see the file COPYING.LIB. If not, + see . */ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 @@ -33,6 +32,19 @@ testandset (int *spinlock) /* Note the use of a dummy output of *spinlock to expose the write. The memory barrier is to stop *other* writes being moved past this code. */ + +#ifdef __arch_v32 + __asm__ __volatile__("clearf p\n" + "0:\n\t" + "movu.b [%2],%0\n\t" + "ax\n\t" + "move.b %3,[%2]\n\t" + "bcs 0b\n\t" + "clearf p" + : "=&r" (ret), "=m" (*spinlock) + : "r" (spinlock), "r" ((int) 1), "m" (*spinlock) + : "memory"); +#else /* not __arch_v32 */ __asm__ __volatile__("clearf\n" "0:\n\t" "movu.b [%2],%0\n\t" @@ -41,8 +53,9 @@ testandset (int *spinlock) "bwf 0b\n\t" "clearf" : "=&r" (ret), "=m" (*spinlock) - : "r" (spinlock), "r" ((int) 1) + : "r" (spinlock), "r" ((int) 1), "m" (*spinlock) : "memory"); +#endif /* __arch_v32 */ return ret; } diff --git a/libpthread/linuxthreads/sysdeps/frv/pt-machine.h b/libpthread/linuxthreads/sysdeps/frv/pt-machine.h new file mode 100644 index 000000000..6f867ade7 --- /dev/null +++ b/libpthread/linuxthreads/sysdeps/frv/pt-machine.h @@ -0,0 +1,69 @@ +/* Machine-dependent pthreads configuration and inline functions. + FR-V version. + Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva + + 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; see the file COPYING.LIB. If + not, see . */ + +#ifndef _PT_MACHINE_H +#define _PT_MACHINE_H 1 + +#include + +#ifndef __ASSEMBLER__ + +#ifndef PT_EI +# define PT_EI __extern_always_inline +#endif + +/* Spinlock implementation; required. */ +PT_EI long int +testandset (int *spinlock) +{ + int i = 1; + __asm__ ("swap%I0 %M0, %1" : "+m"(*(volatile int *)spinlock), "+r"(i)); + return i; +} + +/* We want the OS to assign stack addresses. */ +#define FLOATING_STACKS 1 + +/* This symbol is defined by the ABI as the stack size requested by + the main program. */ +extern char __stacksize; +#define ARCH_STACK_MAX_SIZE ((unsigned long)&__stacksize) + +/* Memory barrier; default is to do nothing */ +#define MEMORY_BARRIER() __asm__ __volatile__("membar" : : : "memory") +/* Write barrier. */ +#define WRITE_MEMORY_BARRIER() __asm__ __volatile__("membar" : : : "memory") + +/* Return the thread descriptor for the current thread. */ +register struct _pthread_descr_struct *THREAD_SELF __asm__ ("gr29"); +#define THREAD_SELF THREAD_SELF + +/* Initialize the thread-unique value. */ +#define INIT_THREAD_SELF(descr, nr) \ + (THREAD_SELF = descr) + +/* Get some notion of the current stack. Need not be exactly the top + of the stack, just something somewhere in the current frame. */ +#define CURRENT_STACK_FRAME stack_pointer +register char * stack_pointer __asm__ ("sp"); + +#endif + +#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/h8300/pt-machine.h b/libpthread/linuxthreads/sysdeps/h8300/pt-machine.h new file mode 100644 index 000000000..a37384de9 --- /dev/null +++ b/libpthread/linuxthreads/sysdeps/h8300/pt-machine.h @@ -0,0 +1,57 @@ +/* Machine-dependent pthreads configuration and inline functions. + H8/300 version. + Copyright (C) 1996, 1998, 2000, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson . + + 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; see the file COPYING.LIB. If + not, see . */ + +#ifndef _PT_MACHINE_H +#define _PT_MACHINE_H 1 + +#include + +#ifndef PT_EI +# define PT_EI __extern_always_inline +#endif + +/* Spinlock implementation; required. */ +PT_EI long int +testandset (int *spinlock) +{ + char ret; + + __asm__ __volatile__( + "sub.w %0,%0\n\t" + "stc ccr,@-sp\n\t" + "orc #0x80,ccr\n\t" + "bld #0,@%2\n\t" + "bset #0,@%2\n\t" + "rotxl.w %0\n\t" + "ldc @sp+,ccr\n\t" + :"=r"(ret),"=m"(*spinlock) + :"g"(spinlock) + :"cc"); + + return ret; +} + + +/* Get some notion of the current stack. Need not be exactly the top + of the stack, just something somewhere in the current frame. */ +#define CURRENT_STACK_FRAME stack_pointer +register char * stack_pointer __asm__ ("%sp"); + +#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/hppa/pspinlock.c b/libpthread/linuxthreads/sysdeps/hppa/pspinlock.c deleted file mode 100644 index 1a6aa64a9..000000000 --- a/libpthread/linuxthreads/sysdeps/hppa/pspinlock.c +++ /dev/null @@ -1,80 +0,0 @@ -/* POSIX spinlock implementation. hppa version. - Copyright (C) 2000 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; see the file COPYING.LIB. If - not, see . */ - -#include -#include -#include "internals.h" - -int -__pthread_spin_lock (pthread_spinlock_t *lock) -{ - unsigned int val; - - do - __asm__ __volatile__ ("ldcw %1,%0" - : "=r" (val), "=m" (*lock) - : "m" (*lock)); - while (!val); - - return 0; -} -weak_alias (__pthread_spin_lock, pthread_spin_lock) - - -int -__pthread_spin_trylock (pthread_spinlock_t *lock) -{ - unsigned int val; - - __asm__ __volatile__ ("ldcw %1,%0" - : "=r" (val), "=m" (*lock) - : "m" (*lock)); - - return val ? 0 : EBUSY; -} -weak_alias (__pthread_spin_trylock, pthread_spin_trylock) - - -int -__pthread_spin_unlock (pthread_spinlock_t *lock) -{ - *lock = 1; - return 0; -} -weak_alias (__pthread_spin_unlock, pthread_spin_unlock) - - -int -__pthread_spin_init (pthread_spinlock_t *lock, int pshared) -{ - /* We can ignore the `pshared' parameter. Since we are busy-waiting - all processes which can access the memory location `lock' points - to can use the spinlock. */ - *lock = 1; - return 0; -} -weak_alias (__pthread_spin_init, pthread_spin_init) - - -int -__pthread_spin_destroy (pthread_spinlock_t *lock) -{ - /* Nothing to do. */ - return 0; -} -weak_alias (__pthread_spin_destroy, pthread_spin_destroy) diff --git a/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h b/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h deleted file mode 100644 index 85c453c77..000000000 --- a/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Machine-dependent pthreads configuration and inline functions. - hppa version. - Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Richard Henderson . - - 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; see the file COPYING.LIB. If - not, see . */ - -#ifndef _PT_MACHINE_H -#define _PT_MACHINE_H 1 - -#include -#include - -#ifndef PT_EI -# define PT_EI __extern_always_inline -#endif - -/* Get some notion of the current stack. Need not be exactly the top - of the stack, just something somewhere in the current frame. */ -#define CURRENT_STACK_FRAME stack_pointer -register char * stack_pointer __asm__ ("%r30"); - - -/* The hppa only has one atomic read and modify memory operation, - load and clear, so hppa spinlocks must use zero to signify that - someone is holding the lock. */ - -#define xstr(s) str(s) -#define str(s) #s -/* Spinlock implementation; required. */ -PT_EI long int -testandset (int *spinlock) -{ - int ret; - - __asm__ __volatile__( - "ldcw 0(%2),%0" - : "=r"(ret), "=m"(*spinlock) - : "r"(spinlock)); - - return ret == 0; -} -#undef str -#undef xstr - -#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/i386/i686/pt-machine.h b/libpthread/linuxthreads/sysdeps/i386/i686/pt-machine.h deleted file mode 100644 index 2e52abe2e..000000000 --- a/libpthread/linuxthreads/sysdeps/i386/i686/pt-machine.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Machine-dependent pthreads configuration and inline functions. - i686 version. - Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Richard Henderson . - - 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; see the file COPYING.LIB. If - not, see . */ - -#ifndef _PT_MACHINE_H -#define _PT_MACHINE_H 1 - -#ifndef PT_EI -# define PT_EI __extern_always_inline -#endif -#include - -#ifndef __ASSEMBLER__ -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - -/* Get some notion of the current stack. Need not be exactly the top - of the stack, just something somewhere in the current frame. */ -#define CURRENT_STACK_FRAME __builtin_frame_address (0) - - -/* Spinlock implementation; required. */ -PT_EI long int -testandset (int *spinlock) -{ - long int ret; - - __asm__ __volatile__ ( - "xchgl %0, %1" - : "=r" (ret), "=m" (*spinlock) - : "0" (1), "m" (*spinlock) - : "memory"); - - return ret; -} - - -/* Compare-and-swap for semaphores. It's always available on i686. */ -#define HAS_COMPARE_AND_SWAP - -PT_EI int -__compare_and_swap (long int *p, long int oldval, long int newval) -{ - char ret; - long int readval; - - __asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0" - : "=q" (ret), "=m" (*p), "=a" (readval) - : "r" (newval), "m" (*p), "a" (oldval) - : "memory"); - return ret; -} -#endif - -#if __ASSUME_LDT_WORKS > 0 -#include "../useldt.h" -#endif - -/* The P4 and above really want some help to prevent overheating. */ -#define BUSY_WAIT_NOP __asm__ ("rep; nop") - -#endif /* pt-machine.h */ diff --git a/libpthread/linuxthreads/sysdeps/i386/pspinlock.c b/libpthread/linuxthreads/sysdeps/i386/pspinlock.c deleted file mode 100644 index 7936735f9..000000000 --- a/libpthread/linuxthreads/sysdeps/i386/pspinlock.c +++ /dev/null @@ -1,102 +0,0 @@ -/* POSIX spinlock implementation. x86 version. - Copyright (C) 2000, 2002, 2006 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 o