support.
* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/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_wait.S: Likewise.
2007-05-25 Ulrich Drepper <drepper@redhat.com>
+ * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
+ support.
+ * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
+ * sysdeps/unix/sysv/linux/i386/i486/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_wait.S: Likewise.
+
* semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
* sem_init.c (__new_sem_init): Rewrite to initialize all three
fields in the structure.
cmpl $0, NWAITERS(%ebx)
je 2f
- movl $SYS_futex, %eax
movl $FUTEX_WAKE, %ecx
+ orl PRIVATE(%ebx), %ecx
movl $1, %edx
+ movl $SYS_futex, %eax
ENTER_KERNEL
testl %eax, %eax
#define SYS_gettimeofday __NR_gettimeofday
#define SYS_futex 240
-#define FUTEX_WAKE 1
+#define FUTEX_WAIT 0
#if VALUE != 0
movl %eax, 8(%esp)
movl 28(%esp), %ebx /* Load semaphore address. */
- xorl %ecx, %ecx
+#if FUTEX_WAIT == 0
+ movl PRIVATE(%ebx), %ecx
+#else
+ movl $FUTEX_WAIT, %ecx
+ orl PRIVATE(%ebx), %ecx
+#endif
movl %esp, %esi
- movl $SYS_futex, %eax
xorl %edx, %edx
+ movl $SYS_futex, %eax
ENTER_KERNEL
movl %eax, %esi
#endif
#define SYS_futex 240
-#define FUTEX_WAKE 1
+#define FUTEX_WAIT 0
#if VALUE != 0
6: call __pthread_enable_asynccancel
movl %eax, (%esp)
+#if FUTEX_WAIT == 0
+ movl PRIVATE(%ebx), %ecx
+#else
+ movl $FUTEX_WAIT, %ecx
+ orl PRIVATE(%ebx), %ecx
+#endif
xorl %esi, %esi
+ xorl %edx, %edx
movl $SYS_futex, %eax
- movl %esi, %ecx
- movl %esi, %edx
ENTER_KERNEL
movl %eax, %esi
movl $SYS_futex, %eax
movl $FUTEX_WAKE, %esi
+ orl PRIVATE(%rdi), %esi
movl $1, %edx
syscall
#else
leaq VALUE(%r12), %rdi
#endif
+#if FUTEX_WAIT == 0
+ movl PRIVATE(%rdi), %esi
+#else
movl $FUTEX_WAIT, %esi
+ orl PRIVATE(%rdi), %esi
+#endif
movl $SYS_futex, %eax
xorl %edx, %edx
syscall
xorq %r10, %r10
movl $SYS_futex, %eax
movq %r13, %rdi
+#if FUTEX_WAIT == 0
+ movl PRIVATE(%rdi), %esi
+#else
movl $FUTEX_WAIT, %esi
+ orl PRIVATE(%rdi), %esi
+#endif
xorl %edx, %edx
syscall
movq %rax, %r12