diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-10-25 00:37:10 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-10-25 00:37:10 +0000 |
commit | 4bbe4e2185c5484328182720ff7b3bb4f9593bff (patch) | |
tree | cd67e40a74928c0f58d4f5b79d2e260e4099fee7 /libc/nptl | |
parent | 91b4be71461f78cabe1fb5f164cea71b60e9e98a (diff) |
Merge changes between r15223 and r15532 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@15545 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/nptl')
40 files changed, 213 insertions, 360 deletions
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog index caae5dcf3..7b0676381 100644 --- a/libc/nptl/ChangeLog +++ b/libc/nptl/ChangeLog @@ -1,3 +1,78 @@ +2011-10-23 Ulrich Drepper <drepper@gmail.com> + + * sysdeps/i386/tls.h: Remove #include <list.h>. + +2011-10-15 Ulrich Drepper <drepper@gmail.com> + + * pthread_create.c (start_thread): Call __ctype_init. + +2011-09-15 Andreas Schwab <schwab@redhat.com> + + * sysdeps/pthread/list.h: Define only list_t if __need_list_t is + defined. + (list_add): Add atomic_write_barrier. + * descr.h: Define __need_list_t before including <list.h>. + * nptl-init.c: Include <list.h> + * allocatestack.c: Likewise. + +2011-09-11 Ulrich Drepper <drepper@gmail.com> + + * sysdeps/i386/tls.h: Remove HAVE_TLS_SUPPORT test. + * sysdeps/ia64/tls.h: Likewise. + * sysdeps/powerpc/tls.h: Likewise. + * sysdeps/s390/tls.h: Likewise. + * sysdeps/sh/tls.h: Likewise. + * sysdeps/sparc/tls.h: Likewise. + * sysdeps/x86_64/tls.h: Likewise. + +2011-09-10 Ulrich Drepper <drepper@gmail.com> + + * sysdeps/pthread/malloc-machine.h: Define MUTEX_INITIALIZER. + + * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Don't handle + !USE___THREAD. + * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise. + * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise. + * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise. + * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise. + * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise. + * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise. + * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise. + * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise. + + * tst-tls1.c: Support for __thread is now mandatory. + * tst-tls2.c: Likewise. + * tst-tls3.c: Likewise. + * tst-tls3mod.c: Likewise. + * tst-tls4.c: Likewise. + * tst-tls4moda.c: Likewise. + * tst-tls4modb.c: Likewise. + * tst-tls5.h: Likewise. + +2011-09-08 Ulrich Drepper <drepper@gmail.com> + + [BZ #12403] + * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S + (pthread_rwlock_timedwrlock): Use correct macro in test. + Patch by H.J. Lu <hongjiu.lu@intel.com>. + +2011-09-06 Ulrich Drepper <drepper@gmail.com> + + * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait): Don't + use gettimeofday vsyscall, just call gettimeofday. + * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: + Likewise. + * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: + Likewise. + * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise. + Simplify __vdso_clock_gettime use. + 2011-09-05 David S. Miller <davem@davemloft.net> * sysdeps/unix/sysv/linux/sem_timedwait.c (do_futex_timed_wait): diff --git a/libc/nptl/allocatestack.c b/libc/nptl/allocatestack.c index 23d2ce559..36b4aa16f 100644 --- a/libc/nptl/allocatestack.c +++ b/libc/nptl/allocatestack.c @@ -28,6 +28,7 @@ #include <dl-sysdep.h> #include <dl-tls.h> #include <tls.h> +#include <list.h> #include <lowlevellock.h> #include <kernel-features.h> diff --git a/libc/nptl/descr.h b/libc/nptl/descr.h index 9c366e740..e57e29e31 100644 --- a/libc/nptl/descr.h +++ b/libc/nptl/descr.h @@ -26,6 +26,7 @@ #include <stdbool.h> #include <sys/types.h> #include <hp-timing.h> +#define __need_list_t #include <list.h> #include <lowlevellock.h> #include <pthreaddef.h> diff --git a/libc/nptl/nptl-init.c b/libc/nptl/nptl-init.c index 33492c160..db45cab23 100644 --- a/libc/nptl/nptl-init.c +++ b/libc/nptl/nptl-init.c @@ -29,6 +29,7 @@ #include <atomic.h> #include <ldsodefs.h> #include <tls.h> +#include <list.h> #include <fork.h> #include <version.h> #include <shlib-compat.h> diff --git a/libc/nptl/pthread_create.c b/libc/nptl/pthread_create.c index 649cdae8f..499e92e88 100644 --- a/libc/nptl/pthread_create.c +++ b/libc/nptl/pthread_create.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2007,2008,2009,2010 Free Software Foundation, Inc. +/* Copyright (C) 2002-2007,2008,2009,2010,2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <ctype.h> #include <errno.h> #include <stdbool.h> #include <stdlib.h> @@ -242,6 +243,9 @@ start_thread (void *arg) __resp = &pd->res; #endif + /* Initialize pointers to locale data. */ + __ctype_init (); + /* Allow setxid from now onwards. */ if (__builtin_expect (atomic_exchange_acq (&pd->setxid_futex, 0) == -2, 0)) lll_futex_wake (&pd->setxid_futex, 1, LLL_PRIVATE); diff --git a/libc/nptl/sysdeps/i386/tls.h b/libc/nptl/sysdeps/i386/tls.h index f23977e73..3d7433897 100644 --- a/libc/nptl/sysdeps/i386/tls.h +++ b/libc/nptl/sysdeps/i386/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. nptl/i386 version. - Copyright (C) 2002-2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2002-2007, 2009, 2011 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 @@ -26,7 +26,6 @@ # include <stddef.h> # include <stdint.h> # include <stdlib.h> -# include <list.h> # include <sysdep.h> # include <kernel-features.h> @@ -70,11 +69,6 @@ typedef struct #endif -/* We require TLS support in the tools. */ -#ifndef HAVE_TLS_SUPPORT -# error "TLS support is required." -#endif - /* Alignment requirement for the stack. For IA-32 this is governed by the SSE memory functions. */ #define STACK_ALIGN 16 @@ -261,7 +255,7 @@ union user_desc_init The contained asm must *not* be marked volatile since otherwise assignments like - pthread_descr self = thread_self(); + pthread_descr self = thread_self(); do not get optimized away. */ # define THREAD_SELF \ ({ struct pthread *__self; \ diff --git a/libc/nptl/sysdeps/ia64/tls.h b/libc/nptl/sysdeps/ia64/tls.h index 936ff01a7..c2a092663 100644 --- a/libc/nptl/sysdeps/ia64/tls.h +++ b/libc/nptl/sysdeps/ia64/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. nptl/IA-64 version. - Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2011 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 @@ -56,11 +56,6 @@ register struct pthread *__thread_self __asm__("r13"); #endif -/* We require TLS support in the tools. */ -#ifndef HAVE_TLS_SUPPORT -# error "TLS support is required." -#endif - /* Alignment requirement for the stack. */ #define STACK_ALIGN 16 diff --git a/libc/nptl/sysdeps/powerpc/tls.h b/libc/nptl/sysdeps/powerpc/tls.h index 0f4d5290d..09f7484c8 100644 --- a/libc/nptl/sysdeps/powerpc/tls.h +++ b/libc/nptl/sysdeps/powerpc/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. NPTL/PowerPC version. - Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2005, 2006, 2007, 2011 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 @@ -43,11 +43,6 @@ typedef union dtv #endif /* __ASSEMBLER__ */ -/* We require TLS support in the tools. */ -#ifndef HAVE_TLS_SUPPORT -# error "TLS support is required." -#endif - #ifndef __ASSEMBLER__ /* Get system call information. */ diff --git a/libc/nptl/sysdeps/pthread/list.h b/libc/nptl/sysdeps/pthread/list.h index 6ddccb9fb..cfc4abad3 100644 --- a/libc/nptl/sysdeps/pthread/list.h +++ b/libc/nptl/sysdeps/pthread/list.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2009, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -18,27 +18,39 @@ 02111-1307 USA. */ #ifndef _LIST_H -#define _LIST_H 1 + +#ifndef __need_list_t +# define _LIST_H 1 +#endif /* The definitions of this file are adopted from those which can be found in the Linux kernel headers to enable people familiar with the latter find their way in these sources as well. */ +#if defined __need_list_t || defined _LIST_H +# ifndef __list_t_defined +# define __list_t_defined /* Basic type for the double-link list. */ typedef struct list_head { struct list_head *next; struct list_head *prev; } list_t; +# endif +# undef __need_list_t +#endif + +#ifdef _LIST_H +# include <atomic.h> /* Define a variable with the head and tail of the list. */ -#define LIST_HEAD(name) \ +# define LIST_HEAD(name) \ list_t name = { &(name), &(name) } /* Initialize a new list head. */ -#define INIT_LIST_HEAD(ptr) \ +# define INIT_LIST_HEAD(ptr) \ (ptr)->next = (ptr)->prev = (ptr) @@ -49,6 +61,7 @@ list_add (list_t *newp, list_t *head) newp->next = head->next; newp->prev = head; head->next->prev = newp; + atomic_write_barrier (); head->next = newp; } @@ -78,26 +91,28 @@ list_splice (list_t *add, list_t *head) /* Get typed element from list at a given position. */ -#define list_entry(ptr, type, member) \ +# define list_entry(ptr, type, member) \ ((type *) ((char *) (ptr) - (unsigned long) (&((type *) 0)->member))) /* Iterate forward over the elements of the list. */ -#define list_for_each(pos, head) \ +# define list_for_each(pos, head) \ for (pos = (head)->next; pos != (head); pos = pos->next) /* Iterate forward over the elements of the list. */ -#define list_for_each_prev(pos, head) \ +# define list_for_each_prev(pos, head) \ for (pos = (head)->prev; pos != (head); pos = pos->prev) /* Iterate backwards over the elements list. The list elements can be removed from the list while doing this. */ -#define list_for_each_prev_safe(pos, p, head) \ +# define list_for_each_prev_safe(pos, p, head) \ for (pos = (head)->prev, p = pos->prev; \ pos != (head); \ pos = p, p = pos->prev) +#endif /* _LIST_H */ + #endif /* list.h */ diff --git a/libc/nptl/sysdeps/pthread/malloc-machine.h b/libc/nptl/sysdeps/pthread/malloc-machine.h index e99aaa781..73503aee0 100644 --- a/libc/nptl/sysdeps/pthread/malloc-machine.h +++ b/libc/nptl/sysdeps/pthread/malloc-machine.h @@ -1,6 +1,6 @@ /* Basic platform-independent macro definitions for mutexes, thread-specific data and parameters for malloc. - Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2003, 2007, 2008, 2011 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 @@ -32,6 +32,7 @@ __libc_lock_define (typedef, mutex_t) #define mutex_lock(m) __libc_lock_lock (*(m)) #define mutex_trylock(m) __libc_lock_trylock (*(m)) #define mutex_unlock(m) __libc_lock_unlock (*(m)) +#define MUTEX_INITIALIZER LLL_LOCK_INITIALIZER /* This is defined by newer gcc version unique for each module. */ extern void *__dso_handle __attribute__ ((__weak__)); diff --git a/libc/nptl/sysdeps/s390/tls.h b/libc/nptl/sysdeps/s390/tls.h index 2b38ed4e7..52fe351fb 100644 --- a/libc/nptl/sysdeps/s390/tls.h +++ b/libc/nptl/sysdeps/s390/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. NPTL/s390 version. - Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2011 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 @@ -66,11 +66,6 @@ typedef struct #endif -/* We require TLS support in the tools. */ -#ifndef HAVE_TLS_SUPPORT -# error "TLS support is required." -#endif - /* Alignment requirement for the stack. For IA-32 this is governed by the SSE memory functions. */ #define STACK_ALIGN 16 diff --git a/libc/nptl/sysdeps/sh/tls.h b/libc/nptl/sysdeps/sh/tls.h index a2d4d565f..908e45587 100644 --- a/libc/nptl/sysdeps/sh/tls.h +++ b/libc/nptl/sysdeps/sh/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. NPTL/SH version. - Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2005, 2006, 2007, 2011 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 @@ -55,11 +55,6 @@ typedef struct #endif /* __ASSEMBLER__ */ -/* We require TLS support in the tools. */ -#ifndef HAVE_TLS_SUPPORT -# error "TLS support is required." -#endif - #ifndef __ASSEMBLER__ /* Get system call information. */ @@ -116,7 +111,7 @@ typedef struct /* Return the thread descriptor for the current thread. The contained asm must *not* be marked volatile since otherwise assignments like - struct pthread *self = thread_self(); + struct pthread *self = thread_self(); do not get optimized away. */ # define THREAD_SELF \ ({ struct pthread *__self; \ diff --git a/libc/nptl/sysdeps/sparc/tls.h b/libc/nptl/sysdeps/sparc/tls.h index dc1b3868c..64ede5a89 100644 --- a/libc/nptl/sysdeps/sparc/tls.h +++ b/libc/nptl/sysdeps/sparc/tls.h @@ -1,5 +1,5 @@ /* Definitions for thread-local data handling. NPTL/sparc version. - Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2005, 2006, 2007, 2011 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 @@ -65,10 +65,6 @@ typedef struct # include <tcb-offsets.h> #endif /* __ASSEMBLER__ */ -/* We require TLS support in the tools. */ -#ifndef HAVE_TLS_SUPPORT -# error "TLS support is required." -#endif #ifndef __ASSEMBLER__ /* Get system call information. */ diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S index 86992c877..9f3e63520 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2005, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2002,2003,2005,2007,2008,2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -81,18 +81,13 @@ __new_sem_post: 4: #endif addl $_GLOBAL_OFFSET_TABLE_, %ebx -#if USE___THREAD -# ifdef NO_TLS_DIRECT_SEG_REFS +#ifdef NO_TLS_DIRECT_SEG_REFS movl errno@gotntpoff(%ebx), %edx addl %gs:0, %edx movl $EINVAL, (%edx) -# else +#else movl errno@gotntpoff(%ebx), %edx movl $EINVAL, %gs:(%edx) -# endif -#else - call __errno_location@plt - movl $EINVAL, (%eax) #endif orl $-1, %eax @@ -107,18 +102,13 @@ __new_sem_post: 5: #endif addl $_GLOBAL_OFFSET_TABLE_, %ebx -#if USE___THREAD -# ifdef NO_TLS_DIRECT_SEG_REFS +#ifdef NO_TLS_DIRECT_SEG_REFS movl errno@gotntpoff(%ebx), %edx addl %gs:0, %edx movl $EOVERFLOW, (%edx) -# else +#else movl errno@gotntpoff(%ebx), %edx movl $EOVERFLOW, %gs:(%edx) -# endif -#else - call __errno_location@plt - movl $EOVERFLOW, (%eax) #endif orl $-1, %eax diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S index 18013a8df..ee46ab936 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2002-2005, 2007, 2009, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -154,18 +154,13 @@ sem_timedwait: 4: #endif addl $_GLOBAL_OFFSET_TABLE_, %ebx -#if USE___THREAD -# ifdef NO_TLS_DIRECT_SEG_REFS +#ifdef NO_TLS_DIRECT_SEG_REFS movl errno@gotntpoff(%ebx), %edx addl %gs:0, %edx movl %esi, (%edx) -# else +#else movl errno@gotntpoff(%ebx), %edx movl %esi, %gs:(%edx) -# endif -#else - call __errno_location@plt - movl %esi, (%eax) #endif movl 28(%esp), %ebx /* Load semaphore address. */ diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S index 2d49934f0..18adb9a09 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2005, 2007, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -49,18 +49,13 @@ __new_sem_trywait: 3: #endif addl $_GLOBAL_OFFSET_TABLE_, %ecx -#if USE___THREAD -# ifdef NO_TLS_DIRECT_SEG_REFS +#ifdef NO_TLS_DIRECT_SEG_REFS movl errno@gotntpoff(%ecx), %edx addl %gs:0, %edx movl $EAGAIN, (%edx) -# else +#else movl errno@gotntpoff(%ecx), %edx movl $EAGAIN, %gs:(%edx) -# endif -#else - call __errno_location@plt - movl $EAGAIN, (%eax) #endif orl $-1, %eax ret diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S index 93c0a64a9..fb8a39843 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2005, 2007, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -114,18 +114,13 @@ __new_sem_wait: 8: #endif addl $_GLOBAL_OFFSET_TABLE_, %ebx -#if USE___THREAD -# ifdef NO_TLS_DIRECT_SEG_REFS +#ifdef NO_TLS_DIRECT_SEG_REFS movl errno@gotntpoff(%ebx), %edx addl %gs:0, %edx movl %esi, (%edx) -# else +#else movl errno@gotntpoff(%ebx), %edx movl %esi, %gs:(%edx) -# endif -#else - call __errno_location@plt - movl %esi, (%eax) #endif orl $-1, %eax @@ -228,13 +223,13 @@ sem_wait_cleanup: .byte 14 # DW_CFA_def_cfa_offset .uleb128 8 .byte 0x83 # DW_CFA_offset %ebx - .uleb128 2 + .uleb128 2 .byte 4 # DW_CFA_advance_loc4 .long .Lpush_esi-.Lpush_ebx .byte 14 # DW_CFA_def_cfa_offset .uleb128 12 .byte 0x86 # DW_CFA_offset %esi - .uleb128 3 + .uleb128 3 .byte 4 # DW_CFA_advance_loc4 .long .Lsub_esp-.Lpush_esi .byte 14 # DW_CFA_def_cfa_offset @@ -250,9 +245,9 @@ sem_wait_cleanup: .byte 14 # DW_CFA_def_cfa_offset .uleb128 16 .byte 0x83 # DW_CFA_offset %ebx - .uleb128 2 + .uleb128 2 .byte 0x86 # DW_CFA_offset %esi - .uleb128 3 + .uleb128 3 .align 4 .LENDFDE: @@ -333,18 +328,13 @@ __old_sem_wait: 4: #endif addl $_GLOBAL_OFFSET_TABLE_, %ebx -#if USE___THREAD -# ifdef NO_TLS_DIRECT_SEG_REFS +#ifdef NO_TLS_DIRECT_SEG_REFS movl errno@gotntpoff(%ebx), %edx addl %gs:0, %edx movl %esi, (%edx) -# else +#else movl errno@gotntpoff(%ebx), %edx movl %esi, %gs:(%edx) -# endif -#else - call __errno_location@plt - movl %esi, (%eax) #endif orl $-1, %eax jmp 5b diff --git a/libc/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h b/libc/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h index c4d52860d..8687ba46a 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h +++ b/libc/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2006, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2002. @@ -27,13 +27,12 @@ # undef PSEUDO -# if USE___THREAD -# ifndef NOT_IN_libc -# define SYSDEP_CANCEL_ERRNO __libc_errno -# else -# define SYSDEP_CANCEL_ERRNO errno -# endif -# define SYSDEP_CANCEL_ERROR(args) \ +# ifndef NOT_IN_libc +# define SYSDEP_CANCEL_ERRNO __libc_errno +# else +# define SYSDEP_CANCEL_ERRNO errno +# endif +# define SYSDEP_CANCEL_ERROR(args) \ .section .gnu.linkonce.t.__syscall_error_##args, "ax"; \ .align 32; \ .proc __syscall_error_##args; \ @@ -53,28 +52,6 @@ __syscall_error_##args: \ add loc4 = loc4, r13;; \ st4 [loc4] = loc3; \ mov ar.pfs = loc0 -# else -# define SYSDEP_CANCEL_ERROR(args) \ -.section .gnu.linkonce.t.__syscall_error_##args, "ax"; \ - .align 32; \ - .proc __syscall_error_##args; \ - .global __syscall_error_##args; \ - .hidden __syscall_error_##args; \ - .size __syscall_error_##args, 64; \ -__syscall_error_##args: \ - .prologue; \ - .regstk args, 5, args, 0; \ - .save ar.pfs, loc0; \ - .save rp, loc1; \ - .body; \ - mov loc4 = r1;; \ - br.call.sptk.many b0 = __errno_location;; \ - st4 [r8] = loc3; \ - mov r1 = loc4; \ - mov rp = loc1; \ - mov r8 = -1; \ - mov ar.pfs = loc0 -# endif # ifndef USE_DL_SYSINFO diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S index 4a154fc64..c3dd6825f 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2007, 2008, 2011 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 @@ -65,7 +65,7 @@ __new_sem_post: 3: mov #EOVERFLOW, r2 -4: +4: mov.l r12, @-r15 mov.l r8, @-r15 sts.l pr, @-r15 @@ -73,7 +73,6 @@ __new_sem_post: mov.l .Lgot3, r12 add r0, r12 -#if USE___THREAD mov.l .Lerrno3, r0 stc gbr, r1 mov.l @(r0, r12), r0 @@ -84,14 +83,6 @@ __new_sem_post: .long errno@GOTTPOFF .Lexit: mov.l r2, @r0 -#else - mov r2, r8 - mov.l .Lerrloc3, r1 - bsrf r1 - nop -.Lerrloc3b: - mov r8, @r0 -#endif lds.l @r15+, pr mov.l @r15+, r8 mov.l @r15+, r12 @@ -103,9 +94,5 @@ __new_sem_post: .long SEM_VALUE_MAX .Lgot3: .long _GLOBAL_OFFSET_TABLE_ -#if !USE___THREAD -.Lerrloc3: - .long __errno_location@PLT-(.Lerrloc3b-.) -#endif .size __new_sem_post,.-__new_sem_post versioned_symbol(libpthread, __new_sem_post, sem_post, GLIBC_2_1) diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S index 7924e8759..d57986150 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2007, 2011 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 @@ -131,7 +131,7 @@ sem_timedwait: mov r10, r4 bsrf r1 mov r0, r10 -.Ldisable0b: +.Ldisable0b: mov r10, r0 .LcleanupEND: @@ -173,7 +173,6 @@ sem_timedwait: mov.l .Lgot2, r12 add r0, r12 -#if USE___THREAD mov.l .Lerrno2, r0 stc gbr, r1 mov.l @(r0, r12), r0 @@ -181,14 +180,8 @@ sem_timedwait: add r1, r0 .align 2 .Lerrno2: - .long errno@GOTTPOFF + .long errno@GOTTPOFF .Lexit: -#else - mov.l .Lerrloc2, r1 - bsrf r1 - nop -.Lerrloc2b: -#endif mov.l r10, @r0 DEC (@(NWAITERS,r8), r2) bra 10b @@ -201,10 +194,6 @@ sem_timedwait: .long 1000000000 .Lgot2: .long _GLOBAL_OFFSET_TABLE_ -#if !USE___THREAD -.Lerrloc2: - .long __errno_location@PLT-(.Lerrloc2b-.) -#endif .Lenable0: .long __pthread_enable_asynccancel-.Lenable0b .Ldisable0: @@ -213,7 +202,7 @@ sem_timedwait: .type sem_wait_cleanup,@function sem_wait_cleanup: - DEC (@(NWAITERS,r8), r2) + DEC (@(NWAITERS,r8), r2) .LcallUR: mov.l .Lresume, r1 #ifdef PIC @@ -314,25 +303,25 @@ sem_wait_cleanup: .byte 14 ! DW_CFA_def_cfa_offset .uleb128 4 .byte 0x88 ! DW_CFA_offset r8 - .uleb128 1 + .uleb128 1 .byte 4 ! DW_CFA_advance_loc4 .ualong .Lpush_r9-.Lpush_r8 .byte 14 ! DW_CFA_def_cfa_offset .uleb128 8 .byte 0x89 ! DW_CFA_offset r9 - .uleb128 2 + .uleb128 2 .byte 4 ! DW_CFA_advance_loc4 .ualong .Lpush_r10-.Lpush_r9 .byte 14 ! DW_CFA_def_cfa_offset .uleb128 12 .byte 0x8a ! DW_CFA_offset r10 - .uleb128 3 + .uleb128 3 .byte 4 ! DW_CFA_advance_loc4 .ualong .Lpush_r12-.Lpush_r10 .byte 14 ! DW_CFA_def_cfa_offset .uleb128 16 .byte 0x8c ! DW_CFA_offset r12 - .uleb128 4 + .uleb128 4 .byte 4 ! DW_CFA_advance_loc4 .ualong .Lpush_pr-.Lpush_r12 .byte 14 ! DW_CFA_def_cfa_offset diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S index 835e37db9..183aac6bc 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2007, 2011 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 @@ -57,7 +57,6 @@ __new_sem_trywait: mov.l .Lgot1, r12 add r0, r12 -#if USE___THREAD mov.l .Lerrno1, r0 stc gbr, r1 mov.l @(r0, r12), r0 @@ -67,12 +66,6 @@ __new_sem_trywait: .Lerrno1: .long errno@GOTTPOFF .Lexit: -#else - mov.l .Lerrloc1, r1 - bsrf r1 - nop -.Lerrloc1b: -#endif mov.l r8, @r0 lds.l @r15+, pr mov.l @r15+, r8 @@ -83,9 +76,5 @@ __new_sem_trywait: .align 2 .Lgot1: .long _GLOBAL_OFFSET_TABLE_ -#if !USE___THREAD -.Lerrloc1: - .long __errno_location@PLT-(.Lerrloc1b-.) -#endif .size __new_sem_trywait,.-__new_sem_trywait versioned_symbol(libpthread, __new_sem_trywait, sem_trywait, GLIBC_2_1) diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S index 6ef7fcf0c..aed8609fd 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2007, 2011 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 @@ -68,7 +68,7 @@ __new_sem_wait: .Lafter_ret: 1: INC (@(NWAITERS,r8),r2) - + .LcleanupSTART: 6: mov.l .Lenable0, r1 @@ -96,7 +96,7 @@ __new_sem_wait: mov r10, r4 bsrf r1 mov r0, r10 -.Ldisable0b: +.Ldisable0b: mov r10, r0 .LcleanupEND: @@ -131,7 +131,6 @@ __new_sem_wait: mov.l .Lgot0, r12 add r0, r12 -#if USE___THREAD mov.l .Lerrno0, r0 stc gbr, r1 mov.l @(r0, r12), r0 @@ -141,12 +140,6 @@ __new_sem_wait: .Lerrno0: .long errno@GOTTPOFF .Lexit: -#else - mov.l .Lerrloc0, r1 - bsrf r1 - nop -.Lerrloc0b: -#endif mov.l r8, @r0 bra 9b mov #-1, r0 @@ -154,10 +147,6 @@ __new_sem_wait: .align 2 .Lgot0: .long _GLOBAL_OFFSET_TABLE_ -#if !USE___THREAD -.Lerrloc0: - .long __errno_location@PLT-(.Lerrloc0b-.) -#endif .Lenable0: .long __pthread_enable_asynccancel-.Lenable0b .Ldisable0: @@ -168,7 +157,7 @@ __new_sem_wait: .type sem_wait_cleanup,@function sem_wait_cleanup: - DEC (@(NWAITERS,r8), r2) + DEC (@(NWAITERS,r8), r2) .LcallUR: mov.l .Lresume, r1 #ifdef PIC @@ -269,25 +258,25 @@ sem_wait_cleanup: .byte 14 ! DW_CFA_def_cfa_offset .uleb128 4 .byte 0x88 ! DW_CFA_offset r8 - .uleb128 1 + .uleb128 1 .byte 4 ! DW_CFA_advance_loc4 .ualong .Lpush_r10-.Lpush_r8 .byte 14 ! DW_CFA_def_cfa_offset .uleb128 8 .byte 0x8a ! DW_CFA_offset r10 - .uleb128 2 + .uleb128 2 .byte 4 ! DW_CFA_advance_loc4 .ualong .Lpush_r12-.Lpush_r10 .byte 14 ! DW_CFA_def_cfa_offset .uleb128 12 .byte 0x8c ! DW_CFA_offset r12 - .uleb128 3 + .uleb128 3 .byte 4 ! DW_CFA_advance_loc4 .ualong .Lpush_pr-.Lpush_r12 .byte 14 ! DW_CFA_def_cfa_offset .uleb128 16 .byte 0x91 ! DW_CFA_offset pr - .uleb128 4 + .uleb128 4 .align 4 .LENDFDE: diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S index 3195db259..018da0cc5 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2006, 2007, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 2002-2007, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -68,10 +68,6 @@ #endif -/* For the calculation see asm/vsyscall.h. */ -#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000 - - .globl __lll_lock_wait_private .type __lll_lock_wait_private,@function .hidden __lll_lock_wait_private @@ -250,10 +246,9 @@ __lll_timedlock_wait: /* Get current time. */ movq %rsp, %rdi xorl %esi, %esi - movq $VSYSCALL_ADDR_vgettimeofday, %rax - /* This is a regular function call, all caller-save registers - might be clobbered. */ - callq *%rax + /* This call works because we directly jump to a system call entry + which preserves all the registers. */ + call JUMPTARGET(__gettimeofday) /* Compute relative timeout. */ movq 8(%rsp), %rax @@ -402,8 +397,9 @@ __lll_timedwait_tid: /* Get current time. */ 2: movq %rsp, %rdi xorl %esi, %esi - movq $VSYSCALL_ADDR_vgettimeofday, %rax - callq *%rax + /* This call works because we directly jump to a system call entry + which preserves all the registers. */ + call JUMPTARGET(__gettimeofday) /* Compute relative timeout. */ movq 8(%rsp), %rax diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S index 5218a4f57..b7b8b3498 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002=2007, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2011=2007, 2009, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -50,9 +50,6 @@ orl $FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, reg #endif -/* For the calculation see asm/vsyscall.h. */ -#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000 - .globl __lll_robust_lock_wait .type __lll_robust_lock_wait,@function @@ -219,10 +216,9 @@ __lll_robust_timedlock_wait: /* Get current time. */ movq %rsp, %rdi xorl %esi, %esi - movq $VSYSCALL_ADDR_vgettimeofday, %rax - /* This is a regular function call, all caller-save registers - might be clobbered. */ - callq *%rax + /* This call works because we directly jump to a system call entry + which preserves all the registers. */ + call JUMPTARGET(__gettimeofday) /* Compute relative timeout. */ movq 8(%rsp), %rax diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S index 48ea8b967..d11b29746 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S @@ -26,9 +26,6 @@ #include <kernel-features.h> -/* For the calculation see asm/vsyscall.h. */ -#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000 - .text @@ -453,13 +450,11 @@ __pthread_cond_timedwait: movq __vdso_clock_gettime@GOTPCREL(%rip), %rax movq (%rax), %rax PTR_DEMANGLE (%rax) - jz 26f call *%rax - jmp 27f -# endif -26: movl $__NR_clock_gettime, %eax +# else + movl $__NR_clock_gettime, %eax syscall -27: +# endif # ifndef __ASSUME_POSIX_TIMERS cmpq $-ENOSYS, %rax je 19f @@ -473,8 +468,9 @@ __pthread_cond_timedwait: # else leaq 24(%rsp), %rdi xorl %esi, %esi - movq $VSYSCALL_ADDR_vgettimeofday, %rax - callq *%rax + /* This call works because we directly jump to a system call entry + which preserves all the registers. */ + call JUMPTARGET(__gettimeofday) /* Compute relative timeout. */ movq 40(%rsp), %rax @@ -611,8 +607,9 @@ __pthread_cond_timedwait: /* clock_gettime not available. */ 19: leaq 32(%rsp), %rdi xorl %esi, %esi - movq $VSYSCALL_ADDR_vgettimeofday, %rax - callq *%rax + /* This call works because we directly jump to a system call entry + which preserves all the registers. */ + call JUMPTARGET(__gettimeofday) /* Compute relative timeout. */ movq 40(%rsp), %rax diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S index f5d055c77..0e6a6ee8b 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2005, 2007, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 2002-2005,2007,2009,2010,2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -23,10 +23,6 @@ #include <pthread-errnos.h> #include <kernel-features.h> - -/* For the calculation see asm/vsyscall.h. */ -#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000 - .text .globl pthread_rwlock_timedrdlock @@ -123,8 +119,9 @@ pthread_rwlock_timedrdlock: /* Get current time. */ movq %rsp, %rdi xorl %esi, %esi - movq $VSYSCALL_ADDR_vgettimeofday, %rax - callq *%rax + /* This call works because we directly jump to a system call entry + which preserves all the registers. */ + call JUMPTARGET(__gettimeofday) /* Compute relative timeout. */ movq 8(%rsp), %rax diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S index 6ed8b49bd..57168d9b0 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S @@ -1,4 +1,5 @@ -/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010, 2011 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -23,10 +24,6 @@ #include <pthread-errnos.h> #include <kernel-features.h> - -/* For the calculation see asm/vsyscall.h. */ -#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000 - .text .globl pthread_rwlock_timedwrlock @@ -120,8 +117,9 @@ pthread_rwlock_timedwrlock: /* Get current time. */ movq %rsp, %rdi xorl %esi, %esi - movq $VSYSCALL_ADDR_vgettimeofday, %rax - callq *%rax + /* This call works because we directly jump to a system call entry + which preserves all the registers. */ + call JUMPTARGET(__gettimeofday) /* Compute relative timeout. */ movq 8(%rsp), %rax @@ -192,7 +190,7 @@ pthread_rwlock_timedwrlock: 7: movq %rdx, %rax -#ifndef __ASSUME_PRIVATE_FUTEX +#ifndef __ASSUME_FUTEX_CLOCK_REALTIME addq $16, %rsp cfi_adjust_cfa_offset(-16) popq %r14 diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S index 979b1bf1d..4691e4d68 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2005, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2002,2003,2005,2007,2008,2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -62,29 +62,15 @@ sem_post: retq 1: -#if USE___THREAD movl $EINVAL, %eax -#else - callq __errno_location@plt - movl $EINVAL, %edx -#endif jmp 4f 3: -#if USE___THREAD movl $EOVERFLOW, %eax -#else - callq __errno_location@plt - movl $EOVERFLOW, %edx -#endif 4: -#if USE___THREAD movq errno@gottpoff(%rip), %rdx movl %eax, %fs:(%rdx) -#else - movl %edx, (%rax) -#endif orl $-1, %eax retq .size sem_post,.-sem_post diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S index ca49cb89d..576a49496 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002,2003,2005,2007,2009,2010 Free Software Foundation, Inc. +/* Copyright (C) 2002,2003,2005,2007,2009,2010,2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -24,10 +24,6 @@ #include <pthread-errnos.h> #include <structsem.h> - -/* For the calculation see asm/vsyscall.h. */ -#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000 - .text .globl sem_timedwait @@ -147,39 +143,24 @@ sem_timedwait: cfi_adjust_cfa_offset(8) 3: negq %r9 -#if USE___THREAD movq errno@gottpoff(%rip), %rdx movl %r9d, %fs:(%rdx) -#else - callq __errno_location@plt - movl %r9d, (%rax) -#endif orl $-1, %eax jmp 15b cfi_adjust_cfa_offset(-8) 6: -#if USE___THREAD movq errno@gottpoff(%rip), %rdx movl $EINVAL, %fs:(%rdx) -#else - callq __errno_location@plt - movl $EINVAL, (%rax) -#endif orl $-1, %eax retq 16: -#if USE___THREAD movq errno@gottpoff(%rip), %rdx movl $ETIMEDOUT, %fs:(%rdx) -#else - callq __errno_location@plt - movl $ETIMEDOUT, (%rax) -#endif orl $-1, %eax @@ -212,9 +193,10 @@ sem_timedwait: addq $1, NWAITERS(%r12) 7: xorl %esi, %esi - movq %rsp, %rdi - movq $VSYSCALL_ADDR_vgettimeofday, %rax - callq *%rax + movq %rsp,%rdi + /* This call works because we directly jump to a system call entry + which preserves all the registers. */ + call JUMPTARGET(__gettimeofday) /* Compute relative timeout. */ movq 8(%rsp), %rax @@ -306,13 +288,8 @@ sem_timedwait: cfi_rel_offset(%r14, STACKFRAME) 33: negq %r14 36: -#if USE___THREAD movq errno@gottpoff(%rip), %rdx movl %r14d, %fs:(%rdx) -#else - callq __errno_location@plt - movl %r14d, (%rax) -#endif orl $-1, %eax jmp 45b diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_trywait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_trywait.S index a5719cadd..64652c46f 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_trywait.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_trywait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2005, 2007, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -41,13 +41,8 @@ sem_trywait: retq 1: -#if USE___THREAD movq errno@gottpoff(%rip), %rdx movl $EAGAIN, %fs:(%rdx) -#else - callq __errno_location@plt - movl $EAGAIN, (%rax) -#endif orl $-1, %eax retq .size sem_trywait,.-sem_trywait diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S index 2cf6ec10a..3ea714a75 100644 --- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S +++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -125,14 +125,8 @@ sem_wait: cfi_adjust_cfa_offset(8) 4: negq %rcx -#if USE___THREAD movq errno@gottpoff(%rip), %rdx movl %ecx, %fs:(%rdx) -#else -# error "not supported. %rcx and %rdi must be preserved" - callq __errno_location@plt - movl %ecx, (%rax) -#endif orl $-1, %eax jmp 9b diff --git a/libc/nptl/sysdeps/x86_64/tls.h b/libc/nptl/sysdeps/x86_64/tls.h index 41b5e6daa..95e022b0e 100644 --- a/libc/nptl/sysdeps/x86_64/tls.h +++ b/libc/nptl/sysdeps/x86_64/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. nptl/x86_64 version. - Copyright (C) 2002-2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2002-2007, 2008, 2009, 2011 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 @@ -80,11 +80,6 @@ typedef struct #endif -/* We require TLS support in the tools. */ -#ifndef HAVE_TLS_SUPPORT -# error "TLS support is required." -#endif - /* Alignment requirement for the stack. */ #define STACK_ALIGN 16 diff --git a/libc/nptl/tst-tls1.c b/libc/nptl/tst-tls1.c index 4e191222a..f79db4a1c 100644 --- a/libc/nptl/tst-tls1.c +++ b/libc/nptl/tst-tls1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -22,7 +22,6 @@ #include <stdlib.h> -#if HAVE___THREAD struct test_s { int a; @@ -52,19 +51,11 @@ tf (void *arg) return NULL; } -#endif int do_test (void) { -#if !HAVE___THREAD - - puts ("No __thread support in compiler, test skipped."); - - return 0; -#else - if (s.a != INIT_A || s.b != INIT_B) { puts ("initial value of s in main thread wrong"); @@ -114,7 +105,6 @@ do_test (void) } return 0; -#endif } diff --git a/libc/nptl/tst-tls2.c b/libc/nptl/tst-tls2.c index 73ed33eb6..ff3ab3a02 100644 --- a/libc/nptl/tst-tls2.c +++ b/libc/nptl/tst-tls2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -25,7 +25,6 @@ #include <stdlib.h> #include <unistd.h> -#if HAVE___THREAD #define N 10 static pthread_t th[N]; @@ -106,18 +105,11 @@ tf (void *arg) return NULL; } -#endif + int do_test (void) { -#if !HAVE___THREAD - - puts ("No __thread support in compiler, test skipped."); - - return 0; -#else - if (pthread_barrier_init (&b, NULL, N + 1) != 0) { puts ("barrier_init failed"); @@ -207,7 +199,6 @@ do_test (void) } return 0; -#endif } diff --git a/libc/nptl/tst-tls3.c b/libc/nptl/tst-tls3.c index 8c2663bb0..87883b0bd 100644 --- a/libc/nptl/tst-tls3.c +++ b/libc/nptl/tst-tls3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -73,13 +73,6 @@ int nsigs; int do_test (void) { -#if !HAVE___THREAD - - puts ("No __thread support in compiler, test skipped."); - - return 0; -#else - if ((uintptr_t) pthread_self () & (TCB_ALIGNMENT - 1)) { puts ("initial thread's struct pthread not aligned enough"); @@ -206,7 +199,6 @@ do_test (void) } return 0; -#endif } diff --git a/libc/nptl/tst-tls3mod.c b/libc/nptl/tst-tls3mod.c index 4cb96452e..8ca9956d6 100644 --- a/libc/nptl/tst-tls3mod.c +++ b/libc/nptl/tst-tls3mod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -26,7 +26,6 @@ #include <unistd.h> #include <pthreaddef.h> -#if HAVE___THREAD extern pthread_barrier_t b; @@ -88,5 +87,3 @@ tf (void *arg) return NULL; } - -#endif diff --git a/libc/nptl/tst-tls4.c b/libc/nptl/tst-tls4.c index 52775dee8..d33c97216 100644 --- a/libc/nptl/tst-tls4.c +++ b/libc/nptl/tst-tls4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -25,7 +25,6 @@ #include <unistd.h> #include <tls.h> -#if HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE #define N 3 @@ -181,11 +180,4 @@ do_test (void) #define TIMEOUT 5 #define TEST_FUNCTION do_test () - -#else - -#define TEST_FUNCTION 0 - -#endif - #include "../test-skeleton.c" diff --git a/libc/nptl/tst-tls4moda.c b/libc/nptl/tst-tls4moda.c index ff7ee5604..4f16a3691 100644 --- a/libc/nptl/tst-tls4moda.c +++ b/libc/nptl/tst-tls4moda.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -22,7 +22,6 @@ #include <unistd.h> #include <tls.h> -#if HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE static __thread unsigned char foo [32] __attribute__ ((tls_model ("initial-exec"), aligned (sizeof (void *)))); @@ -35,7 +34,7 @@ test1 (void) for (s = 0; s < sizeof (foo); ++s) { if (foo [s]) - abort (); + abort (); foo [s] = s; } } @@ -48,9 +47,7 @@ test2 (void) for (s = 0; s < sizeof (foo); ++s) { if (foo [s] != s) - abort (); + abort (); foo [s] = sizeof (foo) - s; } } - -#endif diff --git a/libc/nptl/tst-tls4modb.c b/libc/nptl/tst-tls4modb.c index 99f3b5405..10cca08fb 100644 --- a/libc/nptl/tst-tls4modb.c +++ b/libc/nptl/tst-tls4modb.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -22,7 +22,6 @@ #include <unistd.h> #include <tls.h> -#if HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE static int i; int bar; @@ -44,7 +43,7 @@ test1 (void) for (s = 0; s < sizeof (foo) / sizeof (void *); ++s) { if (foo [s]) - abort (); + abort (); foo [s] = &foo[s]; } } @@ -57,9 +56,7 @@ test2 (void) for (s = 0; s < sizeof (foo) / sizeof (void *); ++s) { if (foo [s] != &foo [s]) - abort (); + abort (); foo [s] = &foo [s ^ 1]; } } - -#endif diff --git a/libc/nptl/tst-tls5.h b/libc/nptl/tst-tls5.h index 9a76ab782..12f68b819 100644 --- a/libc/nptl/tst-tls5.h +++ b/libc/nptl/tst-tls5.h @@ -2,7 +2,6 @@ #include <stdlib.h> #include <tls.h> -#if HAVE___THREAD struct tls_obj { @@ -24,5 +23,3 @@ tls_register_##x (void) \ tls_registry[i].size = sizeof (x); \ tls_registry[i].align = __alignof__ (x); \ } - -#endif |