mirror of git://sourceware.org/git/glibc.git
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
This commit is contained in:
parent
e59660bc25
commit
50f1dec5d3
|
|
@ -25,6 +25,13 @@
|
||||||
Likewise.
|
Likewise.
|
||||||
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
|
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
|
||||||
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
|
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
|
||||||
|
Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
|
||||||
|
Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
|
||||||
|
|
||||||
2007-05-26 Ulrich Drepper <drepper@redhat.com>
|
2007-05-26 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||||
|
|
||||||
|
|
@ -77,8 +77,20 @@ __pthread_rwlock_rdlock:
|
||||||
#endif
|
#endif
|
||||||
jne 10f
|
jne 10f
|
||||||
|
|
||||||
11: addl $READERS_WAKEUP, %ebx
|
11:
|
||||||
movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
|
#if __ASSUME_PRIVATE_FUTEX
|
||||||
|
movl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %ecx
|
||||||
|
xorl PSHARED(%ebx), %ecx
|
||||||
|
#else
|
||||||
|
# if FUTEX_WAIT == 0
|
||||||
|
movl PSHARED(%ebx), %ecx
|
||||||
|
# else
|
||||||
|
movl $FUTEX_WAIT, %ecx
|
||||||
|
orl PSHARED(%ebx), %ecx
|
||||||
|
# endif
|
||||||
|
xorl %gs:PRIVATE_FUTEX, %ecx
|
||||||
|
#endif
|
||||||
|
addl $READERS_WAKEUP, %ebx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
ENTER_KERNEL
|
ENTER_KERNEL
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||||
|
|
||||||
|
|
@ -108,8 +108,20 @@ pthread_rwlock_timedrdlock:
|
||||||
/* Futex call. */
|
/* Futex call. */
|
||||||
movl %ecx, (%esp) /* Store relative timeout. */
|
movl %ecx, (%esp) /* Store relative timeout. */
|
||||||
movl %edx, 4(%esp)
|
movl %edx, 4(%esp)
|
||||||
|
|
||||||
movl %esi, %edx
|
movl %esi, %edx
|
||||||
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
#if __ASSUME_PRIVATE_FUTEX
|
||||||
|
movl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %ecx
|
||||||
|
xorl PSHARED(%ebp), %ecx
|
||||||
|
#else
|
||||||
|
# if FUTEX_WAIT == 0
|
||||||
|
movl PSHARED(%ebp), %ecx
|
||||||
|
# else
|
||||||
|
movl $FUTEX_WAIT, %ecx
|
||||||
|
orl PSHARED(%ebp), %ecx
|
||||||
|
# endif
|
||||||
|
xorl %gs:PRIVATE_FUTEX, %ecx
|
||||||
|
#endif
|
||||||
movl %esp, %esi
|
movl %esp, %esi
|
||||||
leal READERS_WAKEUP(%ebp), %ebx
|
leal READERS_WAKEUP(%ebp), %ebx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||||
|
|
||||||
|
|
@ -106,8 +106,20 @@ pthread_rwlock_timedwrlock:
|
||||||
/* Futex call. */
|
/* Futex call. */
|
||||||
movl %ecx, (%esp) /* Store relative timeout. */
|
movl %ecx, (%esp) /* Store relative timeout. */
|
||||||
movl %edx, 4(%esp)
|
movl %edx, 4(%esp)
|
||||||
|
|
||||||
movl %esi, %edx
|
movl %esi, %edx
|
||||||
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
#if __ASSUME_PRIVATE_FUTEX
|
||||||
|
movl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %ecx
|
||||||
|
xorl PSHARED(%ebp), %ecx
|
||||||
|
#else
|
||||||
|
# if FUTEX_WAIT == 0
|
||||||
|
movl PSHARED(%ebp), %ecx
|
||||||
|
# else
|
||||||
|
movl $FUTEX_WAIT, %ecx
|
||||||
|
orl PSHARED(%ebp), %ecx
|
||||||
|
# endif
|
||||||
|
xorl %gs:PRIVATE_FUTEX, %ecx
|
||||||
|
#endif
|
||||||
movl %esp, %esi
|
movl %esp, %esi
|
||||||
leal WRITERS_WAKEUP(%ebp), %ebx
|
leal WRITERS_WAKEUP(%ebp), %ebx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||||
|
|
||||||
|
|
@ -61,9 +61,8 @@ __pthread_rwlock_unlock:
|
||||||
|
|
||||||
5: movl $0, WRITER(%edi)
|
5: movl $0, WRITER(%edi)
|
||||||
|
|
||||||
movl $1, %ecx
|
movl $1, %edx
|
||||||
leal WRITERS_WAKEUP(%edi), %ebx
|
leal WRITERS_WAKEUP(%edi), %ebx
|
||||||
movl %ecx, %edx
|
|
||||||
cmpl $0, WRITERS_QUEUED(%edi)
|
cmpl $0, WRITERS_QUEUED(%edi)
|
||||||
jne 0f
|
jne 0f
|
||||||
|
|
||||||
|
|
@ -83,7 +82,16 @@ __pthread_rwlock_unlock:
|
||||||
#endif
|
#endif
|
||||||
jne 7f
|
jne 7f
|
||||||
|
|
||||||
8: movl $SYS_futex, %eax
|
8:
|
||||||
|
#if __ASSUME_PRIVATE_FUTEX
|
||||||
|
movl $FUTEX_PRIVATE_FLAG|FUTEX_WAKE, %ecx
|
||||||
|
xorl PSHARED(%edi), %ecx
|
||||||
|
#else
|
||||||
|
movl $FUTEX_WAKE, %ecx
|
||||||
|
orl PSHARED(%edi), %ecx
|
||||||
|
xorl %gs:PRIVATE_FUTEX, %ecx
|
||||||
|
#endif
|
||||||
|
movl $SYS_futex, %eax
|
||||||
ENTER_KERNEL
|
ENTER_KERNEL
|
||||||
|
|
||||||
xorl %eax, %eax
|
xorl %eax, %eax
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||||
|
|
||||||
|
|
@ -75,8 +75,20 @@ __pthread_rwlock_wrlock:
|
||||||
#endif
|
#endif
|
||||||
jne 10f
|
jne 10f
|
||||||
|
|
||||||
11: addl $WRITERS_WAKEUP, %ebx
|
11:
|
||||||
movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
|
#if __ASSUME_PRIVATE_FUTEX
|
||||||
|
movl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %ecx
|
||||||
|
xorl PSHARED(%ebx), %ecx
|
||||||
|
#else
|
||||||
|
# if FUTEX_WAIT == 0
|
||||||
|
movl PSHARED(%ebx), %ecx
|
||||||
|
# else
|
||||||
|
movl $FUTEX_WAIT, %ecx
|
||||||
|
orl PSHARED(%ebx), %ecx
|
||||||
|
# endif
|
||||||
|
xorl %gs:PRIVATE_FUTEX, %ecx
|
||||||
|
#endif
|
||||||
|
addl $WRITERS_WAKEUP, %ebx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
ENTER_KERNEL
|
ENTER_KERNEL
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||||
|
|
||||||
|
|
@ -20,11 +20,13 @@
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
#include <lowlevelrwlock.h>
|
#include <lowlevelrwlock.h>
|
||||||
#include <pthread-errnos.h>
|
#include <pthread-errnos.h>
|
||||||
|
#include <kernel-features.h>
|
||||||
|
|
||||||
|
|
||||||
#define SYS_futex 202
|
#define SYS_futex 202
|
||||||
#define FUTEX_WAIT 0
|
#define FUTEX_WAIT 0
|
||||||
#define FUTEX_WAKE 1
|
#define FUTEX_WAKE 1
|
||||||
|
#define FUTEX_PRIVATE_FLAG 128
|
||||||
|
|
||||||
#ifndef UP
|
#ifndef UP
|
||||||
# define LOCK lock
|
# define LOCK lock
|
||||||
|
|
@ -73,12 +75,20 @@ __pthread_rwlock_rdlock:
|
||||||
#endif
|
#endif
|
||||||
jne 10f
|
jne 10f
|
||||||
|
|
||||||
11: addq $READERS_WAKEUP, %rdi
|
11:
|
||||||
#if FUTEX_WAIT == 0
|
#if __ASSUME_PRIVATE_FUTEX
|
||||||
xorl %esi, %esi
|
movl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %esi
|
||||||
|
xorl PSHARED(%rdi), %esi
|
||||||
#else
|
#else
|
||||||
|
# if FUTEX_WAIT == 0
|
||||||
|
movl PSHARED(%rdi), %esi
|
||||||
|
# else
|
||||||
movl $FUTEX_WAIT, %esi
|
movl $FUTEX_WAIT, %esi
|
||||||
|
orl PSHARED(%rdi), %esi
|
||||||
|
# endif
|
||||||
|
xorl %fs:PRIVATE_FUTEX, %esi
|
||||||
#endif
|
#endif
|
||||||
|
addq $READERS_WAKEUP, %rdi
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
syscall
|
syscall
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
/* Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||||
|
|
||||||
|
|
@ -112,10 +112,17 @@ pthread_rwlock_timedrdlock:
|
||||||
movq %rcx, (%rsp) /* Store relative timeout. */
|
movq %rcx, (%rsp) /* Store relative timeout. */
|
||||||
movq %rdi, 8(%rsp)
|
movq %rdi, 8(%rsp)
|
||||||
|
|
||||||
#if FUTEX_WAIT == 0
|
#if __ASSUME_PRIVATE_FUTEX
|
||||||
xorl %esi, %esi
|
movl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %esi
|
||||||
|
xorl PSHARED(%rdi), %esi
|
||||||
#else
|
#else
|
||||||
|
# if FUTEX_WAIT == 0
|
||||||
|
movl PSHARED(%r12), %esi
|
||||||
|
# else
|
||||||
movl $FUTEX_WAIT, %esi
|
movl $FUTEX_WAIT, %esi
|
||||||
|
orl PSHARED(%r12), %esi
|
||||||
|
# endif
|
||||||
|
xorl %fs:PRIVATE_FUTEX, %esi
|
||||||
#endif
|
#endif
|
||||||
movq %rsp, %r10
|
movq %rsp, %r10
|
||||||
movl %r14d, %edx
|
movl %r14d, %edx
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||||
|
|
||||||
|
|
@ -108,10 +108,17 @@ pthread_rwlock_timedwrlock:
|
||||||
movq %rcx, (%rsp) /* Store relative timeout. */
|
movq %rcx, (%rsp) /* Store relative timeout. */
|
||||||
movq %rdi, 8(%rsp)
|
movq %rdi, 8(%rsp)
|
||||||
|
|
||||||
#if FUTEX_WAIT == 0
|
#if __ASSUME_PRIVATE_FUTEX
|
||||||
xorl %esi, %esi
|
movl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %esi
|
||||||
|
xorl PSHARED(%rdi), %esi
|
||||||
#else
|
#else
|
||||||
|
# if FUTEX_WAIT == 0
|
||||||
|
movl PSHARED(%r12), %esi
|
||||||
|
# else
|
||||||
movl $FUTEX_WAIT, %esi
|
movl $FUTEX_WAIT, %esi
|
||||||
|
orl PSHARED(%r12), %esi
|
||||||
|
# endif
|
||||||
|
xorl %fs:PRIVATE_FUTEX, %esi
|
||||||
#endif
|
#endif
|
||||||
movq %rsp, %r10
|
movq %rsp, %r10
|
||||||
movl %r14d, %edx
|
movl %r14d, %edx
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@ __pthread_rwlock_unlock:
|
||||||
|
|
||||||
5: movl $0, WRITER(%rdi)
|
5: movl $0, WRITER(%rdi)
|
||||||
|
|
||||||
|
movl $1, %edx
|
||||||
leaq WRITERS_WAKEUP(%rdi), %r10
|
leaq WRITERS_WAKEUP(%rdi), %r10
|
||||||
movq %rsi, %rdx
|
|
||||||
cmpl $0, WRITERS_QUEUED(%rdi)
|
cmpl $0, WRITERS_QUEUED(%rdi)
|
||||||
jne 0f
|
jne 0f
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||||
|
|
||||||
|
|
@ -71,12 +71,20 @@ __pthread_rwlock_wrlock:
|
||||||
#endif
|
#endif
|
||||||
jne 10f
|
jne 10f
|
||||||
|
|
||||||
11: addq $WRITERS_WAKEUP, %rdi
|
11:
|
||||||
#if FUTEX_WAIT == 0
|
#if __ASSUME_PRIVATE_FUTEX
|
||||||
xorl %esi, %esi
|
movl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %esi
|
||||||
|
xorl PSHARED(%rdi), %esi
|
||||||
#else
|
#else
|
||||||
|
# if FUTEX_WAIT == 0
|
||||||
|
movl PSHARED(%rdi), %esi
|
||||||
|
# else
|
||||||
movl $FUTEX_WAIT, %esi
|
movl $FUTEX_WAIT, %esi
|
||||||
|
orl PSHARED(%rdi), %esi
|
||||||
|
# endif
|
||||||
|
xorl %fs:PRIVATE_FUTEX, %esi
|
||||||
#endif
|
#endif
|
||||||
|
addq $WRITERS_WAKEUP, %rdi
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
syscall
|
syscall
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue