aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S28
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/Makefile2
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S2
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S2
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S8
5 files changed, 26 insertions, 16 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
index a679ee65e6..b3a49e794a 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
@@ -63,24 +63,24 @@ __condvar_cleanup:
#endif
call __lll_mutex_lock_wait
-1: addl $1, wakeup_seq(%ebx)
- adcl $0, wakeup_seq+4(%ebx)
+1: addl $wakeup_seq, %ebx
+ addl $1, (%ebx)
+ adcl $0, 4(%ebx)
- addl $1, woken_seq(%ebx)
- adcl $0, woken_seq+4(%ebx)
+ addl $1, woken_seq-wakeup_seq(%ebx)
+ adcl $0, woken_seq-wakeup_seq+4(%ebx)
+
+ /* Wake up all waiters to make sure no signal gets lost. */
+ movl $FUTEX_WAKE, %ecx
+ movl $SYS_futex, %eax
+ movl $0x7fffffff, %edx
+ ENTER_KERNEL
LOCK
-#if cond_lock == 0
- subl $1, (%ebx)
-#else
- subl $1, cond_lock(%ebx)
-#endif
+ subl $1, cond_lock-wakeup_seq(%ebx)
je 2f
-#if cond_lock == 0
- movl %ebx, %eax
-#else
- leal cond_lock(%ebx), %eax
-#endif
+
+ leal cond_lock-wakeup_seq(%ebx), %eax
call __lll_mutex_unlock_wake
/* Lock the mutex unless asynchronous cancellation is in effect. */
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile b/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile
index c73c2b6c26..9ecb7b092a 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile
@@ -1,4 +1,6 @@
ifeq ($(subdir),nptl)
+CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions -fno-asynchronous-unwind-tables
+
# We need to make sure that stack memory is allocated in the low 4GB.
CFLAGS-pthread_create.c += -DARCH_MAP_FLAGS=MAP_32BIT
endif
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S
index 2128f1b22e..3621efa4fc 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S
@@ -21,7 +21,7 @@
the application is using threads. */
#ifndef UP
# define LOCK \
- cmpl $0, __libc_multiple_threads_ptr(%rip); \
+ cmpl $0, __libc_multiple_threads(%rip); \
je 0f; \
lock; \
0:
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S b/nptl/sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S
index a4ce9c2fee..e6dc8677a4 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S
@@ -21,7 +21,7 @@
the application is using threads. */
#ifndef UP
# define LOCK \
- cmpl $0, __libc_multiple_threads_ptr(%rip); \
+ cmpl $0, __libc_multiple_threads(%rip); \
je 0f; \
lock; \
0:
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
index 060f35e8a9..c15566fdf0 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
@@ -65,6 +65,14 @@ __condvar_cleanup:
addq $1, woken_seq(%rdi)
+ /* Wake up all waiters to make sure no signal gets lost. */
+ addq $wakeup_seq, %rdi
+ movq $FUTEX_WAKE, %rsi
+ movl $0x7fffffff, %edx
+ movq $SYS_futex, %rax
+ syscall
+ subq $wakeup_seq, %rdi
+
LOCK
#if cond_lock == 0
decl (%rdi)