diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-06-12 16:53:43 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2008-06-12 16:53:43 +0000 |
commit | 72d4ac23660326e76443cf18f0ed8c2e4792d268 (patch) | |
tree | dec24311250bb61298456c3eb0e8937c3a4b7561 /nptl | |
parent | 8ba7d5cebbd4acf40dc8d22982baa50c2e1fd194 (diff) |
Updated to fedora-glibc-20080612T1619cvs/fedora-glibc-2_8_90-6
Diffstat (limited to 'nptl')
18 files changed, 331 insertions, 13 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 95e478af2e..f74463b6f1 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,5 +1,45 @@ +2008-06-12 Ulrich Drepper <drepper@redhat.com> + + * sysdeps/pthread/pthread.h: Remove inadvertant checkin. + +2008-05-17 Samuel Thibault <samuel.thibault@ens-lyon.org> + + * sysdeps/pthread/pthread.h: Fix typo in comment. + +2008-05-28 Ulrich Drepper <drepper@redhat.com> + + * sysdeps/pthread/createthread.c (do_clone): Pass accurate length + of CPU set to the kernel. + +2008-05-23 Paul Pluzhnikov <ppluzhnikov@google.com> + + * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add + cfi directives. + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise. + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise. + * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise. + * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise. + * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise. + * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise. + +2008-05-22 Paul Pluzhnikov <ppluzhnikov@google.com> + + * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add + cfi directives. + * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S: + Likewise. + * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: + Likewise. + * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: + Likewise. + +2008-05-26 Ulrich Drepper <drepper@redhat.com> + + * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants. + 2008-05-20 Jakub Jelinek <jakub@redhat.com> - David S. Miller <davem@davemloft.net> + + David S. Miller <davem@davemloft.net> * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file. diff --git a/nptl/Makefile b/nptl/Makefile index 5bfa9e0ba6..76d9e383e0 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -210,9 +210,9 @@ tests = tst-typesizes \ tst-robust6 tst-robust7 tst-robust8 tst-robust9 \ tst-robustpi1 tst-robustpi2 tst-robustpi3 tst-robustpi4 tst-robustpi5 \ tst-robustpi6 tst-robustpi7 tst-robustpi8 tst-robustpi9 \ - tst-rwlock1 tst-rwlock2 tst-rwlock3 tst-rwlock4 tst-rwlock5 \ - tst-rwlock6 tst-rwlock7 tst-rwlock8 tst-rwlock9 tst-rwlock10 \ - tst-rwlock11 tst-rwlock12 tst-rwlock13 tst-rwlock14 \ + tst-rwlock1 tst-rwlock2 tst-rwlock2a tst-rwlock3 tst-rwlock4 \ + tst-rwlock5 tst-rwlock6 tst-rwlock7 tst-rwlock8 tst-rwlock9 \ + tst-rwlock10 tst-rwlock11 tst-rwlock12 tst-rwlock13 tst-rwlock14 \ tst-once1 tst-once2 tst-once3 tst-once4 \ tst-key1 tst-key2 tst-key3 tst-key4 \ tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \ diff --git a/nptl/sysdeps/pthread/createthread.c b/nptl/sysdeps/pthread/createthread.c index 59e62c2dcf..66fafe8050 100644 --- a/nptl/sysdeps/pthread/createthread.c +++ b/nptl/sysdeps/pthread/createthread.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002-2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -98,7 +98,7 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr, if (attr->cpuset != NULL) { res = INTERNAL_SYSCALL (sched_setaffinity, err, 3, pd->tid, - sizeof (cpu_set_t), attr->cpuset); + attr->cpusetsize, attr->cpuset); if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (res, err), 0)) { diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h index f3ab0ae711..d5ffd383f5 100644 --- a/nptl/sysdeps/pthread/pthread.h +++ b/nptl/sysdeps/pthread/pthread.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -127,7 +127,7 @@ enum # if __WORDSIZE == 64 # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ - PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } # else # if __BYTE_ORDER == __LITTLE_ENDIAN # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ @@ -399,7 +399,7 @@ extern int pthread_attr_getaffinity_np (__const pthread_attr_t *__attr, /* Initialize thread attribute *ATTR with attributes corresponding to the - already running thread TH. It shall be called on unitialized ATTR + already running thread TH. It shall be called on uninitialized ATTR and destroyed with pthread_attr_destroy when no longer needed. */ extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW __nonnull ((2)); diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S index 77d252de8f..040d7f8c33 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S @@ -27,7 +27,10 @@ .type pthread_barrier_wait,@function .align 16 pthread_barrier_wait: + cfi_startproc pushl %ebx + cfi_adjust_cfa_offset(4) + cfi_offset(%ebx, -8) movl 8(%esp), %ebx @@ -45,6 +48,8 @@ pthread_barrier_wait: /* There are more threads to come. */ pushl %esi + cfi_adjust_cfa_offset(4) + cfi_offset(%esi, -12) #if CURR_EVENT == 0 movl (%ebx), %edx @@ -101,9 +106,16 @@ pthread_barrier_wait: 10: movl %esi, %eax /* != PTHREAD_BARRIER_SERIAL_THREAD */ popl %esi + cfi_adjust_cfa_offset(-4) + cfi_restore(%esi) popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) ret + cfi_adjust_cfa_offset(4) + cfi_offset(%ebx, -8) + /* The necessary number of threads arrived. */ 3: #if CURR_EVENT == 0 @@ -140,8 +152,12 @@ pthread_barrier_wait: 5: orl $-1, %eax /* == PTHREAD_BARRIER_SERIAL_THREAD */ popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) ret + cfi_adjust_cfa_offset(4) + cfi_offset(%ebx, -8) 1: movl PRIVATE(%ebx), %ecx leal MUTEX(%ebx), %edx xorl $LLL_SHARED, %ecx @@ -154,6 +170,8 @@ pthread_barrier_wait: call __lll_unlock_wake jmp 5b + cfi_adjust_cfa_offset(4) + cfi_offset(%esi, -12) 6: movl PRIVATE(%ebx), %ecx leal MUTEX(%ebx), %eax xorl $LLL_SHARED, %ecx @@ -165,4 +183,5 @@ pthread_barrier_wait: xorl $LLL_SHARED, %ecx call __lll_unlock_wake jmp 10b + cfi_endproc .size pthread_barrier_wait,.-pthread_barrier_wait diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S index 776c47f6cc..f46b4b874a 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S @@ -32,11 +32,19 @@ .type __pthread_cond_broadcast, @function .align 16 __pthread_cond_broadcast: - + cfi_startproc pushl %ebx + cfi_adjust_cfa_offset(4) pushl %esi + cfi_adjust_cfa_offset(4) pushl %edi + cfi_adjust_cfa_offset(4) pushl %ebp + cfi_adjust_cfa_offset(4) + cfi_offset(%ebx, -8) + cfi_offset(%esi, -12) + cfi_offset(%edi, -16) + cfi_offset(%ebp, -20) movl 20(%esp), %ebx @@ -114,11 +122,24 @@ __pthread_cond_broadcast: 10: xorl %eax, %eax popl %ebp + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebp) popl %edi + cfi_adjust_cfa_offset(-4) + cfi_restore(%edi) popl %esi + cfi_adjust_cfa_offset(-4) + cfi_restore(%esi) popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) ret + cfi_adjust_cfa_offset(16) + cfi_offset(%ebx, -8) + cfi_offset(%esi, -12) + cfi_offset(%edi, -16) + cfi_offset(%ebp, -20) .align 16 /* Unlock. */ 4: LOCK @@ -127,11 +148,24 @@ __pthread_cond_broadcast: 6: xorl %eax, %eax popl %ebp + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebp) popl %edi + cfi_adjust_cfa_offset(-4) + cfi_restore(%edi) popl %esi + cfi_adjust_cfa_offset(-4) + cfi_restore(%esi) popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) ret + cfi_adjust_cfa_offset(16) + cfi_offset(%ebx, -8) + cfi_offset(%esi, -12) + cfi_offset(%edi, -16) + cfi_offset(%ebp, -20) /* Initial locking failed. */ 1: #if cond_lock == 0 @@ -199,6 +233,7 @@ __pthread_cond_broadcast: movl $SYS_futex, %eax ENTER_KERNEL jmp 10b + cfi_endproc .size __pthread_cond_broadcast, .-__pthread_cond_broadcast versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast, GLIBC_2_3_2) diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S index 36a18036c5..4909f49107 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S @@ -33,8 +33,13 @@ .align 16 __pthread_cond_signal: + cfi_startproc pushl %ebx + cfi_adjust_cfa_offset(4) pushl %edi + cfi_adjust_cfa_offset(4) + cfi_offset(%ebx, -8) + cfi_offset(%edi, -12) movl 12(%esp), %edi @@ -69,7 +74,12 @@ __pthread_cond_signal: /* Wake up one thread. */ pushl %esi + cfi_adjust_cfa_offset(4) pushl %ebp + cfi_adjust_cfa_offset(4) + cfi_offset(%esi, -16) + cfi_offset(%ebp, -20) + #if FUTEX_PRIVATE_FLAG > 255 xorl %ecx, %ecx #endif @@ -91,7 +101,11 @@ __pthread_cond_signal: ENTER_KERNEL */ int $0x80 popl %ebp + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebp) popl %esi + cfi_adjust_cfa_offset(-4) + cfi_restore(%esi) /* For any kind of error, we try again with WAKE. The general test also covers running on old kernels. */ @@ -100,9 +114,17 @@ __pthread_cond_signal: 6: xorl %eax, %eax popl %edi + cfi_adjust_cfa_offset(-4) + cfi_restore(%edi) popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) ret + cfi_adjust_cfa_offset(8) + cfi_offset(%ebx, -8) + cfi_offset(%edi, -12) + 7: /* %ecx should be either FUTEX_WAKE_OP or FUTEX_WAKE_OP|FUTEX_PRIVATE_FLAG from the previous syscall. */ xorl $(FUTEX_WAKE ^ FUTEX_WAKE_OP), %ecx @@ -152,6 +174,7 @@ __pthread_cond_signal: call __lll_lock_wait jmp 2b + cfi_endproc .size __pthread_cond_signal, .-__pthread_cond_signal versioned_symbol (libpthread, __pthread_cond_signal, pthread_cond_signal, GLIBC_2_3_2) diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S index 2ddeed072f..4e5f0c5b2a 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S @@ -30,8 +30,13 @@ .type __pthread_rwlock_rdlock,@function .align 16 __pthread_rwlock_rdlock: + cfi_startproc pushl %esi + cfi_adjust_cfa_offset(4) pushl %ebx + cfi_adjust_cfa_offset(4) + cfi_offset(%esi, -8) + cfi_offset(%ebx, -12) xorl %esi, %esi movl 12(%esp), %ebx @@ -113,9 +118,16 @@ __pthread_rwlock_rdlock: movl %edx, %eax popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) popl %esi + cfi_adjust_cfa_offset(-4) + cfi_restore(%esi) ret + cfi_adjust_cfa_offset(8) + cfi_offset(%esi, -8) + cfi_offset(%ebx, -12) 1: #if MUTEX == 0 movl %ebx, %edx @@ -171,6 +183,7 @@ __pthread_rwlock_rdlock: movzbl PSHARED(%ebx), %ecx call __lll_lock_wait jmp 13b + cfi_endproc .size __pthread_rwlock_rdlock,.-__pthread_rwlock_rdlock .globl pthread_rwlock_rdlock diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S index 89027284ec..2b84cd06c2 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S @@ -30,11 +30,21 @@ .type pthread_rwlock_timedrdlock,@function .align 16 pthread_rwlock_timedrdlock: + cfi_startproc pushl %esi + cfi_adjust_cfa_offset(4) pushl %edi + cfi_adjust_cfa_offset(4) pushl %ebx + cfi_adjust_cfa_offset(4) pushl %ebp + cfi_adjust_cfa_offset(4) + cfi_offset(%esi, -8) + cfi_offset(%edi, -12) + cfi_offset(%ebx, -16) + cfi_offset(%ebp, -20) subl $8, %esp + cfi_adjust_cfa_offset(8) movl 28(%esp), %ebp movl 32(%esp), %edi @@ -150,12 +160,26 @@ pthread_rwlock_timedrdlock: 7: movl %edx, %eax addl $8, %esp + cfi_adjust_cfa_offset(-8) popl %ebp + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebp) popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) popl %edi + cfi_adjust_cfa_offset(-4) + cfi_restore(%edi) popl %esi + cfi_adjust_cfa_offset(-4) + cfi_restore(%esi) ret + cfi_adjust_cfa_offset(24) + cfi_offset(%esi, -8) + cfi_offset(%edi, -12) + cfi_offset(%ebx, -16) + cfi_offset(%ebp, -20) 1: #if MUTEX == 0 movl %ebp, %edx @@ -216,4 +240,5 @@ pthread_rwlock_timedrdlock: 19: movl $EINVAL, %edx jmp 9b + cfi_endproc .size pthread_rwlock_timedrdlock,.-pthread_rwlock_timedrdlock diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S index 0cf02e057e..91652467c4 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S @@ -30,11 +30,21 @@ .type pthread_rwlock_timedwrlock,@function .align 16 pthread_rwlock_timedwrlock: + cfi_startproc pushl %esi + cfi_adjust_cfa_offset(4) pushl %edi + cfi_adjust_cfa_offset(4) pushl %ebx + cfi_adjust_cfa_offset(4) pushl %ebp + cfi_adjust_cfa_offset(4) + cfi_offset(%esi, -8) + cfi_offset(%edi, -12) + cfi_offset(%ebx, -16) + cfi_offset(%ebp, -20) subl $8, %esp + cfi_adjust_cfa_offset(8) movl 28(%esp), %ebp movl 32(%esp), %edi @@ -148,12 +158,26 @@ pthread_rwlock_timedwrlock: 7: movl %edx, %eax addl $8, %esp + cfi_adjust_cfa_offset(-8) popl %ebp + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebp) popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) popl %edi + cfi_adjust_cfa_offset(-4) + cfi_restore(%edi) popl %esi + cfi_adjust_cfa_offset(-4) + cfi_restore(%esi) ret + cfi_adjust_cfa_offset(24) + cfi_offset(%esi, -8) + cfi_offset(%edi, -12) + cfi_offset(%ebx, -16) + cfi_offset(%ebp, -20) 1: #if MUTEX == 0 movl %ebp, %edx @@ -209,4 +233,5 @@ pthread_rwlock_timedwrlock: 19: movl $EINVAL, %edx jmp 9b + cfi_endproc .size pthread_rwlock_timedwrlock,.-pthread_rwlock_timedwrlock diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S index bf9c33ea9f..aabb92960b 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S @@ -29,8 +29,13 @@ .type __pthread_rwlock_unlock,@function .align 16 __pthread_rwlock_unlock: + cfi_startproc pushl %ebx + cfi_adjust_cfa_offset(4) pushl %edi + cfi_adjust_cfa_offset(4) + cfi_offset(%ebx, -8) + cfi_offset(%edi, -12) movl 12(%esp), %edi @@ -87,9 +92,16 @@ __pthread_rwlock_unlock: xorl %eax, %eax popl %edi + cfi_adjust_cfa_offset(-4) + cfi_restore(%edi) popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) ret + cfi_adjust_cfa_offset(8) + cfi_offset(%ebx, -8) + cfi_offset(%edi, -12) .align 16 6: LOCK #if MUTEX == 0 @@ -133,7 +145,7 @@ __pthread_rwlock_unlock: movzbl PSHARED(%edi), %ecx call __lll_unlock_wake jmp 8b - + cfi_endproc .size __pthread_rwlock_unlock,.-__pthread_rwlock_unlock .globl pthread_rwlock_unlock diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S index d13bb5132c..100736499b 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S @@ -30,8 +30,13 @@ .type __pthread_rwlock_wrlock,@function .align 16 __pthread_rwlock_wrlock: + cfi_startproc pushl %esi + cfi_adjust_cfa_offset(4) pushl %ebx + cfi_adjust_cfa_offset(4) + cfi_offset(%esi, -8) + cfi_offset(%ebx, -12) xorl %esi, %esi movl 12(%esp), %ebx @@ -111,9 +116,16 @@ __pthread_rwlock_wrlock: movl %edx, %eax popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) popl %esi + cfi_adjust_cfa_offset(-4) + cfi_restore(%esi) ret + cfi_adjust_cfa_offset(8) + cfi_offset(%esi, -8) + cfi_offset(%ebx, -12) 1: #if MUTEX == 0 movl %ebx, %edx @@ -162,6 +174,7 @@ __pthread_rwlock_wrlock: movzbl PSHARED(%ebx), %ecx call __lll_lock_wait jmp 13b + cfi_endproc .size __pthread_rwlock_wrlock,.-__pthread_rwlock_wrlock .globl pthread_rwlock_wrlock diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S index 2edcdde4f0..86992c877e 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S @@ -30,7 +30,10 @@ .type __new_sem_post,@function .align 16 __new_sem_post: + cfi_startproc pushl %ebx + cfi_adjust_cfa_offset(4) + cfi_offset(%ebx, -8) movl 8(%esp), %ebx @@ -64,8 +67,12 @@ __new_sem_post: 2: xorl %eax, %eax popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) ret + cfi_adjust_cfa_offset(4) + cfi_offset(%ebx, -8) 1: #ifdef PIC call __i686.get_pc_thunk.bx @@ -116,14 +123,20 @@ __new_sem_post: orl $-1, %eax popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) ret + cfi_endproc .size __new_sem_post,.-__new_sem_post versioned_symbol(libpthread, __new_sem_post, sem_post, GLIBC_2_1) #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) .global __old_sem_post .type __old_sem_post,@function __old_sem_post: + cfi_startproc pushl %ebx + cfi_adjust_cfa_offset(4) + cfi_offset(%ebx, -8) movl 8(%esp), %ebx LOCK @@ -139,7 +152,10 @@ __old_sem_post: xorl %eax, %eax popl %ebx + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebx) ret + cfi_endproc .size __old_sem_post,.-__old_sem_post compat_symbol(libpthread, __old_sem_post, sem_post, GLIBC_2_0) #endif diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S index 0fa2714426..366c96fc36 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S @@ -33,10 +33,19 @@ .type pthread_rwlock_timedrdlock,@function .align 16 pthread_rwlock_timedrdlock: + cfi_startproc pushq %r12 + cfi_adjust_cfa_offset(8) pushq %r13 + cfi_adjust_cfa_offset(8) pushq %r14 + cfi_adjust_cfa_offset(8) + cfi_offset(%r12, -16) + cfi_offset(%r13, -24) + cfi_offset(%r14, -32) + subq $16, %rsp + cfi_adjust_cfa_offset(16) movq %rdi, %r12 movq %rsi, %r13 @@ -155,11 +164,22 @@ pthread_rwlock_timedrdlock: 7: movq %rdx, %rax addq $16, %rsp + cfi_adjust_cfa_offset(-16) popq %r14 + cfi_adjust_cfa_offset(-8) + cfi_restore(%r14) popq %r13 + cfi_adjust_cfa_offset(-8) + cfi_restore(%r13) popq %r12 + cfi_adjust_cfa_offset(-8) + cfi_restore(%r12) retq + cfi_adjust_cfa_offset(40) + cfi_offset(%r12, -16) + cfi_offset(%r13, -24) + cfi_offset(%r14, -32) 1: movl PSHARED(%rdi), %esi #if MUTEX != 0 addq $MUTEX, %rdi @@ -214,4 +234,5 @@ pthread_rwlock_timedrdlock: 19: movl $EINVAL, %edx jmp 9b + cfi_endproc .size pthread_rwlock_timedrdlock,.-pthread_rwlock_timedrdlock diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S index 1e43933ca9..dde6b58836 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S @@ -33,10 +33,19 @@ .type pthread_rwlock_timedwrlock,@function .align 16 pthread_rwlock_timedwrlock: + cfi_startproc pushq %r12 + cfi_adjust_cfa_offset(8) pushq %r13 + cfi_adjust_cfa_offset(8) pushq %r14 + cfi_adjust_cfa_offset(8) + cfi_offset(%r12, -16) + cfi_offset(%r13, -24) + cfi_offset(%r14, -32) + subq $16, %rsp + cfi_adjust_cfa_offset(16) movq %rdi, %r12 movq %rsi, %r13 @@ -152,11 +161,22 @@ pthread_rwlock_timedwrlock: 7: movq %rdx, %rax addq $16, %rsp + cfi_adjust_cfa_offset(-16) popq %r14 + cfi_adjust_cfa_offset(-8) + cfi_restore(%r14) popq %r13 + cfi_adjust_cfa_offset(-8) + cfi_restore(%r13) popq %r12 + cfi_adjust_cfa_offset(-8) + cfi_restore(%r12) retq + cfi_adjust_cfa_offset(40) + cfi_offset(%r12, -16) + cfi_offset(%r13, -24) + cfi_offset(%r14, -32) 1: movl PSHARED(%rdi), %esi #if MUTEX != 0 addq $MUTEX, %rdi @@ -206,4 +226,5 @@ pthread_rwlock_timedwrlock: 19: movl $EINVAL, %edx jmp 9b + cfi_endproc .size pthread_rwlock_timedwrlock,.-pthread_rwlock_timedwrlock diff --git a/nptl/tst-rwlock2.c b/nptl/tst-rwlock2.c index 6f38682b85..2d2e8e4a3e 100644 --- a/nptl/tst-rwlock2.c +++ b/nptl/tst-rwlock2.c @@ -26,15 +26,41 @@ static int do_test (void) { pthread_rwlock_t r; + pthread_rwlockattr_t at; int e; - if (pthread_rwlock_init (&r, NULL) != 0) + if (pthread_rwlockattr_init (&at) != 0) + { + puts ("rwlockattr_init failed"); + return 1; + } + puts ("rwlockattr_init succeeded"); + +#ifndef TYPE +# define TYPE PTHREAD_RWLOCK_PREFER_READER_NP +#endif + + if (pthread_rwlockattr_setkind_np (&at, TYPE) != 0) + { + puts ("rwlockattr_setkind failed"); + return 1; + } + puts ("rwlockattr_setkind succeeded"); + + if (pthread_rwlock_init (&r, &at) != 0) { puts ("rwlock_init failed"); return 1; } puts ("rwlock_init succeeded"); + if (pthread_rwlockattr_destroy (&at) != 0) + { + puts ("rwlockattr_destroy failed"); + return 1; + } + puts ("rwlockattr_destroy succeeded"); + if (pthread_rwlock_wrlock (&r) != 0) { puts ("1st rwlock_wrlock failed"); diff --git a/nptl/tst-rwlock2a.c b/nptl/tst-rwlock2a.c new file mode 100644 index 0000000000..615de5c015 --- /dev/null +++ b/nptl/tst-rwlock2a.c @@ -0,0 +1,2 @@ +#define TYPE PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP +#include "tst-rwlock2.c" diff --git a/nptl/tst-typesizes.c b/nptl/tst-typesizes.c index 17a1e297d3..545cee6bd1 100644 --- a/nptl/tst-typesizes.c +++ b/nptl/tst-typesizes.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2005. @@ -21,6 +21,25 @@ #include <pthreadP.h> #include <semaphore.h> +static const struct +{ + const char *name; + size_t expected; + size_t is; +} types[] = + { +#define T(t, c) \ + { #t, c, sizeof (t) } + T (pthread_attr_t, __SIZEOF_PTHREAD_ATTR_T), + T (pthread_mutex_t, __SIZEOF_PTHREAD_MUTEX_T), + T (pthread_mutexattr_t, __SIZEOF_PTHREAD_MUTEXATTR_T), + T (pthread_cond_t, __SIZEOF_PTHREAD_COND_T), + T (pthread_condattr_t, __SIZEOF_PTHREAD_CONDATTR_T), + T (pthread_rwlock_t, __SIZEOF_PTHREAD_RWLOCK_T), + T (pthread_rwlockattr_t, __SIZEOF_PTHREAD_RWLOCKATTR_T), + T (pthread_barrier_t, __SIZEOF_PTHREAD_BARRIER_T), + T (pthread_barrierattr_t, __SIZEOF_PTHREAD_BARRIERATTR_T) + }; static int do_test (void) @@ -62,6 +81,14 @@ do_test (void) TEST_TYPE2 (sem_t, struct new_sem); TEST_TYPE2 (sem_t, struct old_sem); + for (size_t i = 0; i < sizeof (types) / sizeof (types[0]); ++i) + if (types[i].expected != types[i].is) + { + printf ("%s: expected %zu, is %zu\n", + types[i].name, types[i].expected, types[i].is); + result = 1; + } + return result; } |