00db10
commit 65810f0ef05e8c9e333f17a44e77808b163ca298
00db10
Author: Torvald Riegel <triegel@redhat.com>
00db10
Date:   Thu Dec 22 10:20:43 2016 +0100
00db10
00db10
    robust mutexes: Fix broken x86 assembly by removing it
00db10
    
00db10
    lll_robust_unlock on i386 and x86_64 first sets the futex word to
00db10
    FUTEX_WAITERS|0 before calling __lll_unlock_wake, which will set the
00db10
    futex word to 0.  If the thread is killed between these steps, then the
00db10
    futex word will be FUTEX_WAITERS|0, and the kernel (at least current
00db10
    upstream) will not set it to FUTEX_OWNER_DIED|FUTEX_WAITERS because 0 is
00db10
    not equal to the TID of the crashed thread.
00db10
    
00db10
    The lll_robust_lock assembly code on i386 and x86_64 is not prepared to
00db10
    deal with this case because the fastpath tries to only CAS 0 to TID and
00db10
    not FUTEX_WAITERS|0 to TID; the slowpath simply waits until it can CAS 0
00db10
    to TID or the futex_word has the FUTEX_OWNER_DIED bit set.
00db10
    
00db10
    This issue is fixed by removing the custom x86 assembly code and using
00db10
    the generic C code instead.  However, instead of adding more duplicate
00db10
    code to the custom x86 lowlevellock.h, the code of the lll_robust* functions
00db10
    is inlined into the single call sites that exist for each of these functions
00db10
    in the pthread_mutex_* functions.  The robust mutex paths in the latter
00db10
    have been slightly reorganized to make them simpler.
00db10
    
00db10
    This patch is meant to be easy to backport, so C11-style atomics are not
00db10
    used.
00db10
00db10
Index: glibc-2.17-c758a686/nptl/Makefile
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/Makefile
00db10
+++ glibc-2.17-c758a686/nptl/Makefile
00db10
@@ -100,7 +100,7 @@ libpthread-routines = nptl-init vars eve
00db10
 		      cleanup_defer_compat unwind \
00db10
 		      pt-longjmp pt-cleanup\
00db10
 		      cancellation \
00db10
-		      lowlevellock lowlevelrobustlock \
00db10
+		      lowlevellock \
00db10
 		      pt-vfork \
00db10
 		      ptw-write ptw-read ptw-close ptw-fcntl ptw-accept \
00db10
 		      ptw-connect ptw-recv ptw-recvfrom ptw-recvmsg ptw-send \
00db10
Index: glibc-2.17-c758a686/nptl/pthread_mutex_lock.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/pthread_mutex_lock.c
00db10
+++ glibc-2.17-c758a686/nptl/pthread_mutex_lock.c
00db10
@@ -34,14 +34,14 @@
00db10
 #define lll_trylock_elision(a,t) lll_trylock(a)
00db10
 #endif
00db10
 
00db10
+/* Some of the following definitions differ when pthread_mutex_cond_lock.c
00db10
+   includes this file.  */
00db10
 #ifndef LLL_MUTEX_LOCK
00db10
 # define LLL_MUTEX_LOCK(mutex) \
00db10
   lll_lock ((mutex)->__data.__lock, PTHREAD_MUTEX_PSHARED (mutex))
00db10
 # define LLL_MUTEX_TRYLOCK(mutex) \
00db10
   lll_trylock ((mutex)->__data.__lock)
00db10
-# define LLL_ROBUST_MUTEX_LOCK(mutex, id) \
00db10
-  lll_robust_lock ((mutex)->__data.__lock, id, \
00db10
-		   PTHREAD_ROBUST_MUTEX_PSHARED (mutex))
00db10
+# define LLL_ROBUST_MUTEX_LOCK_MODIFIER 0
00db10
 # define LLL_MUTEX_LOCK_ELISION(mutex) \
00db10
   lll_lock_elision ((mutex)->__data.__lock, (mutex)->__data.__elision, \
00db10
 		   PTHREAD_MUTEX_PSHARED (mutex))
00db10
@@ -186,11 +186,21 @@ __pthread_mutex_lock_full (pthread_mutex
00db10
       /* This is set to FUTEX_WAITERS iff we might have shared the
00db10
 	 FUTEX_WAITERS flag with other threads, and therefore need to keep it
00db10
 	 set to avoid lost wake-ups.  We have the same requirement in the
00db10
-	 simple mutex algorithm.  */
00db10
-      unsigned int assume_other_futex_waiters = 0;
00db10
-      do
00db10
+	 simple mutex algorithm.
00db10
+	 We start with value zero for a normal mutex, and FUTEX_WAITERS if we
00db10
+	 are building the special case mutexes for use from within condition
00db10
+	 variables.  */
00db10
+      unsigned int assume_other_futex_waiters = LLL_ROBUST_MUTEX_LOCK_MODIFIER;
00db10
+      while (1)
00db10
 	{
00db10
-	again:
00db10
+	  /* Try to acquire the lock through a CAS from 0 (not acquired) to
00db10
+	     our TID | assume_other_futex_waiters.  */
00db10
+	  if (__glibc_likely ((oldval == 0)
00db10
+			      && (atomic_compare_and_exchange_bool_acq
00db10
+				  (&mutex->__data.__lock,
00db10
+				   id | assume_other_futex_waiters, 0) == 0)))
00db10
+	      break;
00db10
+
00db10
 	  if ((oldval & FUTEX_OWNER_DIED) != 0)
00db10
 	    {
00db10
 	      /* The previous owner died.  Try locking the mutex.  */
00db10
@@ -210,7 +220,7 @@ __pthread_mutex_lock_full (pthread_mutex
00db10
 	      if (newval != oldval)
00db10
 		{
00db10
 		  oldval = newval;
00db10
-		  goto again;
00db10
+		  continue;
00db10
 		}
00db10
 
00db10
 	      /* We got the mutex.  */
00db10
@@ -261,24 +271,47 @@ __pthread_mutex_lock_full (pthread_mutex
00db10
 		}
00db10
 	    }
00db10
 
00db10
-	  oldval = LLL_ROBUST_MUTEX_LOCK (mutex,
00db10
-					  id | assume_other_futex_waiters);
00db10
-	  /* See above.  We set FUTEX_WAITERS and might have shared this flag
00db10
-	     with other threads; thus, we need to preserve it.  */
00db10
-	  assume_other_futex_waiters = FUTEX_WAITERS;
00db10
-
00db10
-	  if (__builtin_expect (mutex->__data.__owner
00db10
-				== PTHREAD_MUTEX_NOTRECOVERABLE, 0))
00db10
+	  /* We cannot acquire the mutex nor has its owner died.  Thus, try
00db10
+	     to block using futexes.  Set FUTEX_WAITERS if necessary so that
00db10
+	     other threads are aware that there are potentially threads
00db10
+	     blocked on the futex.  Restart if oldval changed in the
00db10
+	     meantime.  */
00db10
+	  if ((oldval & FUTEX_WAITERS) == 0)
00db10
 	    {
00db10
-	      /* This mutex is now not recoverable.  */
00db10
-	      mutex->__data.__count = 0;
00db10
-	      lll_unlock (mutex->__data.__lock,
00db10
-			  PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
00db10
-	      THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
00db10
-	      return ENOTRECOVERABLE;
00db10
+	      if (atomic_compare_and_exchange_bool_acq (&mutex->__data.__lock,
00db10
+							oldval | FUTEX_WAITERS,
00db10
+							oldval)
00db10
+		  != 0)
00db10
+		{
00db10
+		  oldval = mutex->__data.__lock;
00db10
+		  continue;
00db10
+		}
00db10
+	      oldval |= FUTEX_WAITERS;
00db10
 	    }
00db10
+
00db10
+	  /* It is now possible that we share the FUTEX_WAITERS flag with
00db10
+	     another thread; therefore, update assume_other_futex_waiters so
00db10
+	     that we do not forget about this when handling other cases
00db10
+	     above and thus do not cause lost wake-ups.  */
00db10
+	  assume_other_futex_waiters |= FUTEX_WAITERS;
00db10
+
00db10
+	  /* Block using the futex and reload current lock value.  */
00db10
+	  lll_futex_wait (&mutex->__data.__lock, oldval,
00db10
+			  PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
00db10
+	  oldval = mutex->__data.__lock;
00db10
+	}
00db10
+
00db10
+      /* We have acquired the mutex; check if it is still consistent.  */
00db10
+      if (__builtin_expect (mutex->__data.__owner
00db10
+			    == PTHREAD_MUTEX_NOTRECOVERABLE, 0))
00db10
+	{
00db10
+	  /* This mutex is now not recoverable.  */
00db10
+	  mutex->__data.__count = 0;
00db10
+	  int private = PTHREAD_ROBUST_MUTEX_PSHARED (mutex);
00db10
+	  lll_unlock (mutex->__data.__lock, private);
00db10
+	  THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
00db10
+	  return ENOTRECOVERABLE;
00db10
 	}
00db10
-      while ((oldval & FUTEX_OWNER_DIED) != 0);
00db10
 
00db10
       mutex->__data.__count = 1;
00db10
       ENQUEUE_MUTEX (mutex);
00db10
Index: glibc-2.17-c758a686/nptl/pthread_mutex_timedlock.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/pthread_mutex_timedlock.c
00db10
+++ glibc-2.17-c758a686/nptl/pthread_mutex_timedlock.c
00db10
@@ -147,9 +147,16 @@ pthread_mutex_timedlock (pthread_mutex_t
00db10
 	 set to avoid lost wake-ups.  We have the same requirement in the
00db10
 	 simple mutex algorithm.  */
00db10
       unsigned int assume_other_futex_waiters = 0;
00db10
-      do
00db10
+      while (1)
00db10
 	{
00db10
-	again:
00db10
+	  /* Try to acquire the lock through a CAS from 0 (not acquired) to
00db10
+	     our TID | assume_other_futex_waiters.  */
00db10
+	  if (__glibc_likely ((oldval == 0)
00db10
+			      && (atomic_compare_and_exchange_bool_acq
00db10
+				  (&mutex->__data.__lock,
00db10
+				   id | assume_other_futex_waiters, 0) == 0)))
00db10
+	      break;
00db10
+
00db10
 	  if ((oldval & FUTEX_OWNER_DIED) != 0)
00db10
 	    {
00db10
 	      /* The previous owner died.  Try locking the mutex.  */
00db10
@@ -162,7 +169,7 @@ pthread_mutex_timedlock (pthread_mutex_t
00db10
 	      if (newval != oldval)
00db10
 		{
00db10
 		  oldval = newval;
00db10
-		  goto again;
00db10
+		  continue;
00db10
 		}
00db10
 
00db10
 	      /* We got the mutex.  */
00db10
@@ -209,30 +216,87 @@ pthread_mutex_timedlock (pthread_mutex_t
00db10
 		}
00db10
 	    }
00db10
 
00db10
-	  result = lll_robust_timedlock (mutex->__data.__lock, abstime,
00db10
-					 id | assume_other_futex_waiters,
00db10
-					 PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
00db10
-	  /* See above.  We set FUTEX_WAITERS and might have shared this flag
00db10
-	     with other threads; thus, we need to preserve it.  */
00db10
-	  assume_other_futex_waiters = FUTEX_WAITERS;
00db10
+	  /* We are about to block; check whether the timeout is invalid.  */
00db10
+	  if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
00db10
+	    return EINVAL;
00db10
+	  /* Work around the fact that the kernel rejects negative timeout
00db10
+	     values despite them being valid.  */
00db10
+	  if (__glibc_unlikely (abstime->tv_sec < 0))
00db10
+	    return ETIMEDOUT;
00db10
+#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
00db10
+     || !defined lll_futex_timed_wait_bitset)
00db10
+	  struct timeval tv;
00db10
+	  struct timespec rt;
00db10
+
00db10
+	  /* Get the current time.  */
00db10
+	  (void) __gettimeofday (&tv, NULL);
00db10
+
00db10
+	  /* Compute relative timeout.  */
00db10
+	  rt.tv_sec = abstime->tv_sec - tv.tv_sec;
00db10
+	  rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
00db10
+	  if (rt.tv_nsec < 0)
00db10
+	    {
00db10
+	      rt.tv_nsec += 1000000000;
00db10
+	      --rt.tv_sec;
00db10
+	    }
00db10
 
00db10
-	  if (__builtin_expect (mutex->__data.__owner
00db10
-				== PTHREAD_MUTEX_NOTRECOVERABLE, 0))
00db10
+	  /* Already timed out?  */
00db10
+	  if (rt.tv_sec < 0)
00db10
+	    return ETIMEDOUT;
00db10
+#endif
00db10
+
00db10
+	  /* We cannot acquire the mutex nor has its owner died.  Thus, try
00db10
+	     to block using futexes.  Set FUTEX_WAITERS if necessary so that
00db10
+	     other threads are aware that there are potentially threads
00db10
+	     blocked on the futex.  Restart if oldval changed in the
00db10
+	     meantime.  */
00db10
+	  if ((oldval & FUTEX_WAITERS) == 0)
00db10
 	    {
00db10
-	      /* This mutex is now not recoverable.  */
00db10
-	      mutex->__data.__count = 0;
00db10
-	      lll_unlock (mutex->__data.__lock,
00db10
-			  PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
00db10
-	      THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
00db10
-	      return ENOTRECOVERABLE;
00db10
+	      if (atomic_compare_and_exchange_bool_acq (&mutex->__data.__lock,
00db10
+							oldval | FUTEX_WAITERS,
00db10
+							oldval)
00db10
+		  != 0)
00db10
+		{
00db10
+		  oldval = mutex->__data.__lock;
00db10
+		  continue;
00db10
+		}
00db10
+	      oldval |= FUTEX_WAITERS;
00db10
 	    }
00db10
 
00db10
-	  if (result == ETIMEDOUT || result == EINVAL)
00db10
-	    goto out;
00db10
+	  /* It is now possible that we share the FUTEX_WAITERS flag with
00db10
+	     another thread; therefore, update assume_other_futex_waiters so
00db10
+	     that we do not forget about this when handling other cases
00db10
+	     above and thus do not cause lost wake-ups.  */
00db10
+	  assume_other_futex_waiters |= FUTEX_WAITERS;
00db10
+
00db10
+	  /* Block using the futex.  */
00db10
+#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
00db10
+     || !defined lll_futex_timed_wait_bitset)
00db10
+	  lll_futex_timed wait (&mutex->__data.__lock, oldval,
00db10
+				&rt, PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
00db10
+#else
00db10
+	  int err = lll_futex_timed_wait_bitset (&mutex->__data.__lock,
00db10
+	      oldval, abstime, FUTEX_CLOCK_REALTIME,
00db10
+	      PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
00db10
+	  /* The futex call timed out.  */
00db10
+	  if (err == -ETIMEDOUT)
00db10
+	    return -err;
00db10
+#endif
00db10
+	  /* Reload current lock value.  */
00db10
+	  oldval = mutex->__data.__lock;
00db10
+	}
00db10
 
00db10
-	  oldval = result;
00db10
+      /* We have acquired the mutex; check if it is still consistent.  */
00db10
+      if (__builtin_expect (mutex->__data.__owner
00db10
+			    == PTHREAD_MUTEX_NOTRECOVERABLE, 0))
00db10
+	{
00db10
+	  /* This mutex is now not recoverable.  */
00db10
+	  mutex->__data.__count = 0;
00db10
+	  int private = PTHREAD_ROBUST_MUTEX_PSHARED (mutex);
00db10
+	  lll_unlock (mutex->__data.__lock, private);
00db10
+	  THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
00db10
+	  return ENOTRECOVERABLE;
00db10
 	}
00db10
-      while ((oldval & FUTEX_OWNER_DIED) != 0);
00db10
 
00db10
       mutex->__data.__count = 1;
00db10
       ENQUEUE_MUTEX (mutex);
00db10
Index: glibc-2.17-c758a686/nptl/pthread_mutex_unlock.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/pthread_mutex_unlock.c
00db10
+++ glibc-2.17-c758a686/nptl/pthread_mutex_unlock.c
00db10
@@ -96,6 +96,7 @@ internal_function
00db10
 __pthread_mutex_unlock_full (pthread_mutex_t *mutex, int decr)
00db10
 {
00db10
   int newowner = 0;
00db10
+  int private;
00db10
 
00db10
   switch (PTHREAD_MUTEX_TYPE (mutex))
00db10
     {
00db10
@@ -149,9 +150,14 @@ __pthread_mutex_unlock_full (pthread_mut
00db10
 	/* One less user.  */
00db10
 	--mutex->__data.__nusers;
00db10
 
00db10
-      /* Unlock.  */
00db10
-      lll_robust_unlock (mutex->__data.__lock,
00db10
-			 PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
00db10
+      /* Unlock by setting the lock to 0 (not acquired); if the lock had
00db10
+	 FUTEX_WAITERS set previously, then wake any waiters.
00db10
+         The unlock operation must be the last access to the mutex to not
00db10
+         violate the mutex destruction requirements (see __lll_unlock).  */
00db10
+      private = PTHREAD_ROBUST_MUTEX_PSHARED (mutex);
00db10
+      if (__glibc_unlikely ((atomic_exchange_rel (&mutex->__data.__lock, 0)
00db10
+			     & FUTEX_WAITERS) != 0))
00db10
+	lll_futex_wake (&mutex->__data.__lock, 1, private);
00db10
 
00db10
       THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
00db10
       break;
00db10
@@ -233,9 +239,9 @@ __pthread_mutex_unlock_full (pthread_mut
00db10
 								  tid)))
00db10
 	{
00db10
 	  int robust = mutex->__data.__kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP;
00db10
-	  int private = (robust
00db10
-			 ? PTHREAD_ROBUST_MUTEX_PSHARED (mutex)
00db10
-			 : PTHREAD_MUTEX_PSHARED (mutex));
00db10
+	  private = (robust
00db10
+		     ? PTHREAD_ROBUST_MUTEX_PSHARED (mutex)
00db10
+		     : PTHREAD_MUTEX_PSHARED (mutex));
00db10
 	  INTERNAL_SYSCALL_DECL (__err);
00db10
 	  INTERNAL_SYSCALL (futex, __err, 2, &mutex->__data.__lock,
00db10
 			    __lll_private_flag (FUTEX_UNLOCK_PI, private));
00db10
Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
00db10
+++ /dev/null
00db10
@@ -1,232 +0,0 @@
00db10
-/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
00db10
-   This file is part of the GNU C Library.
00db10
-   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
00db10
-
00db10
-   The GNU C Library is free software; you can redistribute it and/or
00db10
-   modify it under the terms of the GNU Lesser General Public
00db10
-   License as published by the Free Software Foundation; either
00db10
-   version 2.1 of the License, or (at your option) any later version.
00db10
-
00db10
-   The GNU C Library is distributed in the hope that it will be useful,
00db10
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00db10
-   Lesser General Public License for more details.
00db10
-
00db10
-   You should have received a copy of the GNU Lesser General Public
00db10
-   License along with the GNU C Library; if not, see
00db10
-   <http://www.gnu.org/licenses/>.  */
00db10
-
00db10
-#include <sysdep.h>
00db10
-#include <pthread-errnos.h>
00db10
-#include <lowlevellock.h>
00db10
-#include <lowlevelrobustlock.h>
00db10
-#include <kernel-features.h>
00db10
-
00db10
-	.text
00db10
-
00db10
-#define FUTEX_WAITERS		0x80000000
00db10
-#define FUTEX_OWNER_DIED	0x40000000
00db10
-
00db10
-#ifdef __ASSUME_PRIVATE_FUTEX
00db10
-# define LOAD_FUTEX_WAIT(reg) \
00db10
-	xorl	$(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), reg
00db10
-#else
00db10
-# if FUTEX_WAIT == 0
00db10
-#  define LOAD_FUTEX_WAIT(reg) \
00db10
-	xorl	$FUTEX_PRIVATE_FLAG, reg ; \
00db10
-	andl	%gs:PRIVATE_FUTEX, reg
00db10
-# else
00db10
-#  define LOAD_FUTEX_WAIT(reg) \
00db10
-	xorl	$FUTEX_PRIVATE_FLAG, reg ; \
00db10
-	andl	%gs:PRIVATE_FUTEX, reg ; \
00db10
-	orl	$FUTEX_WAIT, reg
00db10
-# endif
00db10
-#endif
00db10
-
00db10
-	.globl	__lll_robust_lock_wait
00db10
-	.type	__lll_robust_lock_wait,@function
00db10
-	.hidden	__lll_robust_lock_wait
00db10
-	.align	16
00db10
-__lll_robust_lock_wait:
00db10
-	cfi_startproc
00db10
-	pushl	%edx
00db10
-	cfi_adjust_cfa_offset(4)
00db10
-	pushl	%ebx
00db10
-	cfi_adjust_cfa_offset(4)
00db10
-	pushl	%esi
00db10
-	cfi_adjust_cfa_offset(4)
00db10
-	cfi_offset(%edx, -8)
00db10
-	cfi_offset(%ebx, -12)
00db10
-	cfi_offset(%esi, -16)
00db10
-
00db10
-	movl	%edx, %ebx
00db10
-	xorl	%esi, %esi	/* No timeout.  */
00db10
-	LOAD_FUTEX_WAIT (%ecx)
00db10
-
00db10
-4:	movl	%eax, %edx
00db10
-	orl	$FUTEX_WAITERS, %edx
00db10
-
00db10
-	testl	$FUTEX_OWNER_DIED, %eax
00db10
-	jnz	3f
00db10
-
00db10
-	cmpl	%edx, %eax	/* NB:	 %edx == 2 */
00db10
-	je	1f
00db10
-
00db10
-	LOCK
00db10
-	cmpxchgl %edx, (%ebx)
00db10
-	jnz	2f
00db10
-
00db10
-1:	movl	$SYS_futex, %eax
00db10
-	ENTER_KERNEL
00db10
-
00db10
-	movl	(%ebx), %eax
00db10
-
00db10
-2:	test	%eax, %eax
00db10
-	jne	4b
00db10
-
00db10
-	movl	%gs:TID, %edx
00db10
-	orl	$FUTEX_WAITERS, %edx
00db10
-	LOCK
00db10
-	cmpxchgl %edx, (%ebx)
00db10
-	jnz	4b
00db10
-	/* NB:	 %eax == 0 */
00db10
-
00db10
-3:	popl	%esi
00db10
-	cfi_adjust_cfa_offset(-4)
00db10
-	cfi_restore(%esi)
00db10
-	popl	%ebx
00db10
-	cfi_adjust_cfa_offset(-4)
00db10
-	cfi_restore(%ebx)
00db10
-	popl	%edx
00db10
-	cfi_adjust_cfa_offset(-4)
00db10
-	cfi_restore(%edx)
00db10
-	ret
00db10
-	cfi_endproc
00db10
-	.size	__lll_robust_lock_wait,.-__lll_robust_lock_wait
00db10
-
00db10
-
00db10
-	.globl	__lll_robust_timedlock_wait
00db10
-	.type	__lll_robust_timedlock_wait,@function
00db10
-	.hidden	__lll_robust_timedlock_wait
00db10
-	.align	16
00db10
-__lll_robust_timedlock_wait:
00db10
-	cfi_startproc
00db10
-	/* Check for a valid timeout value.  */
00db10
-	cmpl	$1000000000, 4(%edx)
00db10
-	jae	3f
00db10
-
00db10
-	pushl	%edi
00db10
-	cfi_adjust_cfa_offset(4)
00db10
-	pushl	%esi
00db10
-	cfi_adjust_cfa_offset(4)
00db10
-	pushl	%ebx
00db10
-	cfi_adjust_cfa_offset(4)
00db10
-	pushl	%ebp
00db10
-	cfi_adjust_cfa_offset(4)
00db10
-	cfi_offset(%edi, -8)
00db10
-	cfi_offset(%esi, -12)
00db10
-	cfi_offset(%ebx, -16)
00db10
-	cfi_offset(%ebp, -20)
00db10
-
00db10
-	/* Stack frame for the timespec and timeval structs.  */
00db10
-	subl	$12, %esp
00db10
-	cfi_adjust_cfa_offset(12)
00db10
-
00db10
-	movl	%ecx, %ebp
00db10
-	movl	%edx, %edi
00db10
-
00db10
-1:	movl	%eax, 8(%esp)
00db10
-
00db10
-	/* Get current time.  */
00db10
-	movl	%esp, %ebx
00db10
-	xorl	%ecx, %ecx
00db10
-	movl	$__NR_gettimeofday, %eax
00db10
-	ENTER_KERNEL
00db10
-
00db10
-	/* Compute relative timeout.  */
00db10
-	movl	4(%esp), %eax
00db10
-	movl	$1000, %edx
00db10
-	mul	%edx		/* Milli seconds to nano seconds.  */
00db10
-	movl	(%edi), %ecx
00db10
-	movl	4(%edi), %edx
00db10
-	subl	(%esp), %ecx
00db10
-	subl	%eax, %edx
00db10
-	jns	4f
00db10
-	addl	$1000000000, %edx
00db10
-	subl	$1, %ecx
00db10
-4:	testl	%ecx, %ecx
00db10
-	js	8f		/* Time is already up.  */
00db10
-
00db10
-	/* Store relative timeout.  */
00db10
-	movl	%ecx, (%esp)
00db10
-	movl	%edx, 4(%esp)
00db10
-
00db10
-	movl	%ebp, %ebx
00db10
-
00db10
-	movl	8(%esp), %edx
00db10
-	movl	%edx, %eax
00db10
-	orl	$FUTEX_WAITERS, %edx
00db10
-
00db10
-	testl	$FUTEX_OWNER_DIED, %eax
00db10
-	jnz	6f
00db10
-
00db10
-	cmpl	%eax, %edx
00db10
-	je	2f
00db10
-
00db10
-	LOCK
00db10
-	cmpxchgl %edx, (%ebx)
00db10
-	movl	$0, %ecx	/* Must use mov to avoid changing cc.  */
00db10
-	jnz	5f
00db10
-
00db10
-2:
00db10
-	/* Futex call.  */
00db10
-	movl	%esp, %esi
00db10
-	movl	20(%esp), %ecx
00db10
-	LOAD_FUTEX_WAIT (%ecx)
00db10
-	movl	$SYS_futex, %eax
00db10
-	ENTER_KERNEL
00db10
-	movl	%eax, %ecx
00db10
-
00db10
-	movl	(%ebx), %eax
00db10
-
00db10
-5:	testl	%eax, %eax
00db10
-	jne	7f
00db10
-
00db10
-	movl	%gs:TID, %edx
00db10
-	orl	$FUTEX_WAITERS, %edx
00db10
-	LOCK
00db10
-	cmpxchgl %edx, (%ebx)
00db10
-	jnz	7f
00db10
-
00db10
-6:	addl	$12, %esp
00db10
-	cfi_adjust_cfa_offset(-12)
00db10
-	popl	%ebp
00db10
-	cfi_adjust_cfa_offset(-4)
00db10
-	cfi_restore(%ebp)
00db10
-	popl	%ebx
00db10
-	cfi_adjust_cfa_offset(-4)
00db10
-	cfi_restore(%ebx)
00db10
-	popl	%esi
00db10
-	cfi_adjust_cfa_offset(-4)
00db10
-	cfi_restore(%esi)
00db10
-	popl	%edi
00db10
-	cfi_adjust_cfa_offset(-4)
00db10
-	cfi_restore(%edi)
00db10
-	ret
00db10
-
00db10
-3:	movl	$EINVAL, %eax
00db10
-	ret
00db10
-
00db10
-	cfi_adjust_cfa_offset(28)
00db10
-	cfi_offset(%edi, -8)
00db10
-	cfi_offset(%esi, -12)
00db10
-	cfi_offset(%ebx, -16)
00db10
-	cfi_offset(%ebp, -20)
00db10
-	/* Check whether the time expired.  */
00db10
-7:	cmpl	$-ETIMEDOUT, %ecx
00db10
-	jne	1b
00db10
-
00db10
-8:	movl	$ETIMEDOUT, %eax
00db10
-	jmp	6b
00db10
-	cfi_endproc
00db10
-	.size	__lll_robust_timedlock_wait,.-__lll_robust_timedlock_wait
00db10
Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S
00db10
+++ /dev/null
00db10
@@ -1,19 +0,0 @@
00db10
-/* Copyright (C) 2002, 2006 Free Software Foundation, Inc.
00db10
-   This file is part of the GNU C Library.
00db10
-   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
00db10
-
00db10
-   The GNU C Library is free software; you can redistribute it and/or
00db10
-   modify it under the terms of the GNU Lesser General Public
00db10
-   License as published by the Free Software Foundation; either
00db10
-   version 2.1 of the License, or (at your option) any later version.
00db10
-
00db10
-   The GNU C Library is distributed in the hope that it will be useful,
00db10
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00db10
-   Lesser General Public License for more details.
00db10
-
00db10
-   You should have received a copy of the GNU Lesser General Public
00db10
-   License along with the GNU C Library; if not, see
00db10
-   <http://www.gnu.org/licenses/>.  */
00db10
-
00db10
-#include "../i486/lowlevelrobustlock.S"
00db10
Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S
00db10
+++ /dev/null
00db10
@@ -1,19 +0,0 @@
00db10
-/* Copyright (C) 2002, 2006 Free Software Foundation, Inc.
00db10
-   This file is part of the GNU C Library.
00db10
-   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
00db10
-
00db10
-   The GNU C Library is free software; you can redistribute it and/or
00db10
-   modify it under the terms of the GNU Lesser General Public
00db10
-   License as published by the Free Software Foundation; either
00db10
-   version 2.1 of the License, or (at your option) any later version.
00db10
-
00db10
-   The GNU C Library is distributed in the hope that it will be useful,
00db10
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00db10
-   Lesser General Public License for more details.
00db10
-
00db10
-   You should have received a copy of the GNU Lesser General Public
00db10
-   License along with the GNU C Library; if not, see
00db10
-   <http://www.gnu.org/licenses/>.  */
00db10
-
00db10
-#include "../i486/lowlevelrobustlock.S"
00db10
Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
00db10
+++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
00db10
@@ -338,27 +338,6 @@ LLL_STUB_UNWIND_INFO_END
00db10
 	 }								      \
00db10
     })
00db10
 
00db10
-#define lll_robust_lock(futex, id, private) \
00db10
-  ({ int result, ignore1, ignore2;					      \
00db10
-     __asm __volatile (LOCK_INSTR "cmpxchgl %1, %2\n\t"			      \
00db10
-		       "jnz _L_robust_lock_%=\n\t"			      \
00db10
-		       ".subsection 1\n\t"				      \
00db10
-		       ".type _L_robust_lock_%=,@function\n"		      \
00db10
-		       "_L_robust_lock_%=:\n"				      \
00db10
-		       "1:\tleal %2, %%edx\n"				      \
00db10
-		       "0:\tmovl %7, %%ecx\n"				      \
00db10
-		       "2:\tcall __lll_robust_lock_wait\n"		      \
00db10
-		       "3:\tjmp 18f\n"					      \
00db10
-		       "4:\t.size _L_robust_lock_%=, 4b-1b\n\t"		      \
00db10
-		       ".previous\n"					      \
00db10
-		       LLL_STUB_UNWIND_INFO_4				      \
00db10
-		       "18:"						      \
00db10
-		       : "=a" (result), "=c" (ignore1), "=m" (futex),	      \
00db10
-			 "=&d" (ignore2)				      \
00db10
-		       : "0" (0), "1" (id), "m" (futex), "g" ((int) (private))\
00db10
-		       : "memory");					      \
00db10
-     result; })
00db10
-
00db10
 
00db10
 /* Special version of lll_lock which causes the unlock function to
00db10
    always wakeup waiters.  */
00db10
@@ -384,30 +363,6 @@ LLL_STUB_UNWIND_INFO_END
00db10
 			 : "memory");					      \
00db10
     })
00db10
 
00db10
-
00db10
-#define lll_robust_cond_lock(futex, id, private) \
00db10
-  ({ int result, ignore1, ignore2;					      \
00db10
-     __asm __volatile (LOCK_INSTR "cmpxchgl %1, %2\n\t"			      \
00db10
-		       "jnz _L_robust_cond_lock_%=\n\t"			      \
00db10
-		       ".subsection 1\n\t"				      \
00db10
-		       ".type _L_robust_cond_lock_%=,@function\n"	      \
00db10
-		       "_L_robust_cond_lock_%=:\n"			      \
00db10
-		       "1:\tleal %2, %%edx\n"				      \
00db10
-		       "0:\tmovl %7, %%ecx\n"				      \
00db10
-		       "2:\tcall __lll_robust_lock_wait\n"		      \
00db10
-		       "3:\tjmp 18f\n"					      \
00db10
-		       "4:\t.size _L_robust_cond_lock_%=, 4b-1b\n\t"	      \
00db10
-		       ".previous\n"					      \
00db10
-		       LLL_STUB_UNWIND_INFO_4				      \
00db10
-		       "18:"						      \
00db10
-		       : "=a" (result), "=c" (ignore1), "=m" (futex),	      \
00db10
-			 "=&d" (ignore2)				      \
00db10
-		       : "0" (0), "1" (id | FUTEX_WAITERS), "m" (futex),      \
00db10
-			 "g" ((int) (private))				      \
00db10
-		       : "memory");					      \
00db10
-     result; })
00db10
-
00db10
-
00db10
 #define lll_timedlock(futex, timeout, private) \
00db10
   ({ int result, ignore1, ignore2, ignore3;				      \
00db10
      __asm __volatile (LOCK_INSTR "cmpxchgl %1, %3\n\t"			      \
00db10
@@ -437,28 +392,6 @@ extern int __lll_timedlock_elision (int
00db10
 #define lll_timedlock_elision(futex, adapt_count, timeout, private)	\
00db10
   __lll_timedlock_elision(&(futex), &(adapt_count), timeout, private)
00db10
 
00db10
-#define lll_robust_timedlock(futex, timeout, id, private) \
00db10
-  ({ int result, ignore1, ignore2, ignore3;				      \
00db10
-     __asm __volatile (LOCK_INSTR "cmpxchgl %1, %3\n\t"			      \
00db10
-		       "jnz _L_robust_timedlock_%=\n\t"			      \
00db10
-		       ".subsection 1\n\t"				      \
00db10
-		       ".type _L_robust_timedlock_%=,@function\n"	      \
00db10
-		       "_L_robust_timedlock_%=:\n"			      \
00db10
-		       "1:\tleal %3, %%ecx\n"				      \
00db10
-		       "0:\tmovl %8, %%edx\n"				      \
00db10
-		       "2:\tcall __lll_robust_timedlock_wait\n"		      \
00db10
-		       "3:\tjmp 18f\n"					      \
00db10
-		       "4:\t.size _L_robust_timedlock_%=, 4b-1b\n\t"	      \
00db10
-		       ".previous\n"					      \
00db10
-		       LLL_STUB_UNWIND_INFO_4				      \
00db10
-		       "18:"						      \
00db10
-		       : "=a" (result), "=c" (ignore1), "=&d" (ignore2),      \
00db10
-			 "=m" (futex), "=S" (ignore3)			      \
00db10
-		       : "0" (0), "1" (id), "m" (futex), "m" (timeout),	      \
00db10
-			 "4" ((int) (private))				      \
00db10
-		       : "memory");					      \
00db10
-     result; })
00db10
-
00db10
 #if !IS_IN (libc) || defined UP
00db10
 # define __lll_unlock_asm LOCK_INSTR "subl $1, %0\n\t"
00db10
 #else
00db10
@@ -510,29 +443,6 @@ extern int __lll_timedlock_elision (int
00db10
 	 }								      \
00db10
     })
00db10
 
00db10
-#define lll_robust_unlock(futex, private) \
00db10
-  (void)								      \
00db10
-    ({ int ignore, ignore2;						      \
00db10
-       __asm __volatile (LOCK_INSTR "andl %3, %0\n\t"			      \
00db10
-			 "jne _L_robust_unlock_%=\n\t"			      \
00db10
-			 ".subsection 1\n\t"				      \
00db10
-			 ".type _L_robust_unlock_%=,@function\n"	      \
00db10
-			 "_L_robust_unlock_%=:\n\t"			      \
00db10
-			 "1:\tleal %0, %%eax\n"				      \
00db10
-			 "0:\tmovl %5, %%ecx\n"				      \
00db10
-			 "2:\tcall __lll_unlock_wake\n"			      \
00db10
-			 "3:\tjmp 18f\n"				      \
00db10
-			 "4:\t.size _L_robust_unlock_%=, 4b-1b\n\t"	      \
00db10
-			 ".previous\n"					      \
00db10
-			 LLL_STUB_UNWIND_INFO_4				      \
00db10
-			 "18:"						      \
00db10
-			 : "=m" (futex), "=&a" (ignore), "=&c" (ignore2)      \
00db10
-			 : "i" (FUTEX_WAITERS), "m" (futex),		      \
00db10
-			   "g" ((int) (private))			      \
00db10
-			 : "memory");					      \
00db10
-    })
00db10
-
00db10
-
00db10
 #define lll_robust_dead(futex, private) \
00db10
   (void)								      \
00db10
     ({ int __ignore;							      \
00db10
Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c
00db10
+++ /dev/null
00db10
@@ -1,127 +0,0 @@
00db10
-/* Copyright (C) 2006-2012 Free Software Foundation, Inc.
00db10
-   This file is part of the GNU C Library.
00db10
-   Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
00db10
-
00db10
-   The GNU C Library is free software; you can redistribute it and/or
00db10
-   modify it under the terms of the GNU Lesser General Public
00db10
-   License as published by the Free Software Foundation; either
00db10
-   version 2.1 of the License, or (at your option) any later version.
00db10
-
00db10
-   The GNU C Library is distributed in the hope that it will be useful,
00db10
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
00db10
-   Lesser General Public License for more details.
00db10
-
00db10
-   You should have received a copy of the GNU Lesser General Public
00db10
-   License along with the GNU C Library; if not, see
00db10
-   <http://www.gnu.org/licenses/>.  */
00db10
-
00db10
-#include <errno.h>
00db10
-#include <sysdep.h>
00db10
-#include <lowlevellock.h>
00db10
-#include <sys/time.h>
00db10
-#include <pthreadP.h>
00db10
-
00db10
-
00db10
-int
00db10
-__lll_robust_lock_wait (int *futex, int private)
00db10
-{
00db10
-  int oldval = *futex;
00db10
-  int tid = THREAD_GETMEM (THREAD_SELF, tid);
00db10
-
00db10
-  /* If the futex changed meanwhile try locking again.  */
00db10
-  if (oldval == 0)
00db10
-    goto try;
00db10
-
00db10
-  do
00db10
-    {
00db10
-      if (__builtin_expect (oldval & FUTEX_OWNER_DIED, 0))
00db10
-	return oldval;
00db10
-
00db10
-      int newval = oldval | FUTEX_WAITERS;
00db10
-      if (oldval != newval
00db10
-	  && atomic_compare_and_exchange_bool_acq (futex, newval, oldval))
00db10
-	continue;
00db10
-
00db10
-      lll_futex_wait (futex, newval, private);
00db10
-
00db10
-    try:
00db10
-      ;
00db10
-    }
00db10
-  while ((oldval = atomic_compare_and_exchange_val_acq (futex,
00db10
-							tid | FUTEX_WAITERS,
00db10
-							0)) != 0);
00db10
-  return 0;
00db10
-}
00db10
-
00db10
-
00db10
-int
00db10
-__lll_robust_timedlock_wait (int *futex, const struct timespec *abstime,
00db10
-			     int private)
00db10
-{
00db10
-  /* Reject invalid timeouts.  */
00db10
-  if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
00db10
-    return EINVAL;
00db10
-
00db10
-  int tid = THREAD_GETMEM (THREAD_SELF, tid);
00db10
-  int oldval = *futex;
00db10
-
00db10
-  /* If the futex changed meanwhile try locking again.  */
00db10
-  if (oldval == 0)
00db10
-    goto try;
00db10
-
00db10
-  /* Work around the fact that the kernel rejects negative timeout values
00db10
-     despite them being valid.  */
00db10
-  if (__builtin_expect (abstime->tv_sec < 0, 0))
00db10
-    return ETIMEDOUT;
00db10
-
00db10
-  do
00db10
-    {
00db10
-#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
00db10
-     || !defined lll_futex_timed_wait_bitset)
00db10
-      struct timeval tv;
00db10
-      struct timespec rt;
00db10
-
00db10
-      /* Get the current time.  */
00db10
-      (void) __gettimeofday (&tv, NULL);
00db10
-
00db10
-      /* Compute relative timeout.  */
00db10
-      rt.tv_sec = abstime->tv_sec - tv.tv_sec;
00db10
-      rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
00db10
-      if (rt.tv_nsec < 0)
00db10
-	{
00db10
-	  rt.tv_nsec += 1000000000;
00db10
-	  --rt.tv_sec;
00db10
-	}
00db10
-
00db10
-      /* Already timed out?  */
00db10
-      if (rt.tv_sec < 0)
00db10
-	return ETIMEDOUT;
00db10
-#endif
00db10
-
00db10
-      /* Wait.  */
00db10
-      if (__builtin_expect (oldval & FUTEX_OWNER_DIED, 0))
00db10
-	return oldval;
00db10
-
00db10
-      int newval = oldval | FUTEX_WAITERS;
00db10
-      if (oldval != newval
00db10
-	  && atomic_compare_and_exchange_bool_acq (futex, newval, oldval))
00db10
-	continue;
00db10
-
00db10
-#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
00db10
-     || !defined lll_futex_timed_wait_bitset)
00db10
-      lll_futex_timed_wait (futex, newval, &rt, private);
00db10
-#else
00db10
-      lll_futex_timed_wait_bitset (futex, newval, abstime,
00db10
-				   FUTEX_CLOCK_REALTIME, private);
00db10
-#endif
00db10
-
00db10
-    try:
00db10
-      ;
00db10
-    }
00db10
-  while ((oldval = atomic_compare_and_exchange_val_acq (futex,
00db10
-							tid | FUTEX_WAITERS,
00db10
-							0)) != 0);
00db10
-
00db10
-  return 0;
00db10
-}
00db10
Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.sym
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.sym
00db10
+++ /dev/null
00db10
@@ -1,6 +0,0 @@
00db10
-#include <stddef.h>
00db10
-#include <pthreadP.h>
00db10
-
00db10
---
00db10
-
00db10
-TID		offsetof (struct pthread, tid)
00db10
Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
00db10
+++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
00db10
@@ -11,9 +11,9 @@
00db10
   lll_cond_trylock ((mutex)->__data.__lock)
00db10
 #define LLL_MUTEX_TRYLOCK_ELISION(mutex) LLL_MUTEX_TRYLOCK(mutex)
00db10
 
00db10
-#define LLL_ROBUST_MUTEX_LOCK(mutex, id) \
00db10
-  lll_robust_cond_lock ((mutex)->__data.__lock, id, \
00db10
-			PTHREAD_ROBUST_MUTEX_PSHARED (mutex))
00db10
+/* We need to assume that there are other threads blocked on the futex.
00db10
+   See __pthread_mutex_lock_full for further details.  */
00db10
+#define LLL_ROBUST_MUTEX_LOCK_MODIFIER FUTEX_WAITERS
00db10
 #define __pthread_mutex_lock internal_function __pthread_mutex_cond_lock
00db10
 #define __pthread_mutex_lock_full __pthread_mutex_cond_lock_full
00db10
 #define NO_INCR
00db10
Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
00db10
+++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
00db10
@@ -349,28 +349,6 @@ LLL_STUB_UNWIND_INFO_END
00db10
 			   : "cx", "r11", "cc", "memory");		      \
00db10
     })									      \
00db10
 
00db10
-#define lll_robust_lock(futex, id, private) \
00db10
-  ({ int result, ignore1, ignore2;					      \
00db10
-    __asm __volatile (LOCK_INSTR "cmpxchgl %4, %2\n\t"			      \
00db10
-		      "jnz 1f\n\t"					      \
00db10
-		      ".subsection 1\n\t"				      \
00db10
-		      ".type _L_robust_lock_%=, @function\n"		      \
00db10
-		      "_L_robust_lock_%=:\n"				      \
00db10
-		      "1:\tlea %2, %%" RDI_LP "\n"			      \
00db10
-		      "2:\tsub $128, %%" RSP_LP "\n"			      \
00db10
-		      "3:\tcallq __lll_robust_lock_wait\n"		      \
00db10
-		      "4:\tadd $128, %%" RSP_LP "\n"			      \
00db10
-		      "5:\tjmp 24f\n"					      \
00db10
-		      "6:\t.size _L_robust_lock_%=, 6b-1b\n\t"		      \
00db10
-		      ".previous\n"					      \
00db10
-		      LLL_STUB_UNWIND_INFO_5				      \
00db10
-		      "24:"						      \
00db10
-		      : "=S" (ignore1), "=D" (ignore2), "=m" (futex),	      \
00db10
-			"=a" (result)					      \
00db10
-		      : "1" (id), "m" (futex), "3" (0), "0" (private)	      \
00db10
-		      : "cx", "r11", "cc", "memory");			      \
00db10
-    result; })
00db10
-
00db10
 #define lll_cond_lock(futex, private) \
00db10
   (void)								      \
00db10
     ({ int ignore1, ignore2, ignore3;					      \
00db10
@@ -394,29 +372,6 @@ LLL_STUB_UNWIND_INFO_END
00db10
 			 : "cx", "r11", "cc", "memory");		      \
00db10
     })
00db10
 
00db10
-#define lll_robust_cond_lock(futex, id, private) \
00db10
-  ({ int result, ignore1, ignore2;					      \
00db10
-    __asm __volatile (LOCK_INSTR "cmpxchgl %4, %2\n\t"			      \
00db10
-		      "jnz 1f\n\t"					      \
00db10
-		      ".subsection 1\n\t"				      \
00db10
-		      ".type _L_robust_cond_lock_%=, @function\n"	      \
00db10
-		      "_L_robust_cond_lock_%=:\n"			      \
00db10
-		      "1:\tlea %2, %%" RDI_LP "\n"			      \
00db10
-		      "2:\tsub $128, %%" RSP_LP "\n"			      \
00db10
-		      "3:\tcallq __lll_robust_lock_wait\n"		      \
00db10
-		      "4:\tadd $128, %%" RSP_LP "\n"			      \
00db10
-		      "5:\tjmp 24f\n"					      \
00db10
-		      "6:\t.size _L_robust_cond_lock_%=, 6b-1b\n\t"	      \
00db10
-		      ".previous\n"					      \
00db10
-		      LLL_STUB_UNWIND_INFO_5				      \
00db10
-		      "24:"						      \
00db10
-		      : "=S" (ignore1), "=D" (ignore2), "=m" (futex),	      \
00db10
-			"=a" (result)					      \
00db10
-		      : "1" (id | FUTEX_WAITERS), "m" (futex), "3" (0),	      \
00db10
-			"0" (private)					      \
00db10
-		      : "cx", "r11", "cc", "memory");			      \
00db10
-    result; })
00db10
-
00db10
 #define lll_timedlock(futex, timeout, private) \
00db10
   ({ int result, ignore1, ignore2, ignore3;				      \
00db10
      __asm __volatile (LOCK_INSTR "cmpxchgl %1, %4\n\t"			      \
00db10
@@ -448,30 +403,6 @@ extern int __lll_timedlock_elision (int
00db10
 #define lll_timedlock_elision(futex, adapt_count, timeout, private)	\
00db10
   __lll_timedlock_elision(&(futex), &(adapt_count), timeout, private)
00db10
 
00db10
-#define lll_robust_timedlock(futex, timeout, id, private) \
00db10
-  ({ int result, ignore1, ignore2, ignore3;				      \
00db10
-     __asm __volatile (LOCK_INSTR "cmpxchgl %1, %4\n\t"			      \
00db10
-		       "jnz 1f\n\t"					      \
00db10
-		       ".subsection 1\n\t"				      \
00db10
-		       ".type _L_robust_timedlock_%=, @function\n"	      \
00db10
-		       "_L_robust_timedlock_%=:\n"			      \
00db10
-		       "1:\tlea %4, %%" RDI_LP "\n"			      \
00db10
-		       "0:\tmov %8, %%" RDX_LP "\n"			      \
00db10
-		       "2:\tsub $128, %%" RSP_LP "\n"			      \
00db10
-		       "3:\tcallq __lll_robust_timedlock_wait\n"	      \
00db10
-		       "4:\tadd $128, %%" RSP_LP "\n"			      \
00db10
-		       "5:\tjmp 24f\n"					      \
00db10
-		       "6:\t.size _L_robust_timedlock_%=, 6b-1b\n\t"	      \
00db10
-		       ".previous\n"					      \
00db10
-		       LLL_STUB_UNWIND_INFO_6				      \
00db10
-		       "24:"						      \
00db10
-		       : "=a" (result), "=D" (ignore1), "=S" (ignore2),       \
00db10
-			 "=&d" (ignore3), "=m" (futex)			      \
00db10
-		       : "0" (0), "1" (id), "m" (futex), "m" (timeout),	      \
00db10
-			 "2" (private)					      \
00db10
-		       : "memory", "cx", "cc", "r10", "r11");		      \
00db10
-     result; })
00db10
-
00db10
 #if !IS_IN (libc) || defined UP
00db10
 # define __lll_unlock_asm_start LOCK_INSTR "decl %0\n\t"		      \
00db10
 				"jne 1f\n\t"
00db10
@@ -524,31 +455,6 @@ extern int __lll_timedlock_elision (int
00db10
 			   : "ax", "cx", "r11", "cc", "memory");	      \
00db10
     })
00db10
 
00db10
-#define lll_robust_unlock(futex, private) \
00db10
-  do									      \
00db10
-    {									      \
00db10
-      int ignore;							      \
00db10
-      __asm __volatile (LOCK_INSTR "andl %2, %0\n\t"			      \
00db10
-			"jne 1f\n\t"					      \
00db10
-			".subsection 1\n\t"				      \
00db10
-			".type _L_robust_unlock_%=, @function\n"	      \
00db10
-			"_L_robust_unlock_%=:\n"			      \
00db10
-			"1:\tlea %0, %%" RDI_LP "\n"			      \
00db10
-			"2:\tsub $128, %%" RSP_LP "\n"			      \
00db10
-			"3:\tcallq __lll_unlock_wake\n"			      \
00db10
-			"4:\tadd $128, %%" RSP_LP "\n"			      \
00db10
-			"5:\tjmp 24f\n"					      \
00db10
-			"6:\t.size _L_robust_unlock_%=, 6b-1b\n\t"	      \
00db10
-			".previous\n"					      \
00db10
-			LLL_STUB_UNWIND_INFO_5				      \
00db10
-			"24:"						      \
00db10
-			: "=m" (futex), "=&D" (ignore)			      \
00db10
-			: "i" (FUTEX_WAITERS), "m" (futex),		      \
00db10
-			  "S" (private)					      \
00db10
-			: "ax", "cx", "r11", "cc", "memory");		      \
00db10
-    }									      \
00db10
-  while (0)
00db10
-
00db10
 #define lll_robust_dead(futex, private) \
00db10
   do									      \
00db10
     {									      \
00db10
Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
00db10
+++ /dev/null
00db10
@@ -1,306 +0,0 @@
00db10
-/* Copyright (C) 2002, 2011=2007, 2009, 2010 Free Software Foundation, Inc.
00db10
-   This file is part of the GNU C Library.
00db10
-   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
00db10
-
00db10
-   The GNU C Library is free software; you can redistribute it and/or
00db10
-   modify it under the terms of the GNU Lesser General Public
00db10
-   License as published by the Free Software Foundation; either
00db10
-   version 2.1 of the License, or (at your option) any later version.
00db10
-
00db10
-   The GNU C Library is distributed in the hope that it will be useful,
00db10
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00db10
-   Lesser General Public License for more details.
00db10
-
00db10
-   You should have received a copy of the GNU Lesser General Public
00db10
-   License along with the GNU C Library; if not, see
00db10
-   <http://www.gnu.org/licenses/>.  */
00db10
-
00db10
-#include <sysdep.h>
00db10
-#include <pthread-errnos.h>
00db10
-#include <lowlevellock.h>
00db10
-#include <lowlevelrobustlock.h>
00db10
-#include <kernel-features.h>
00db10
-
00db10
-	.text
00db10
-
00db10
-#define FUTEX_WAITERS		0x80000000
00db10
-#define FUTEX_OWNER_DIED	0x40000000
00db10
-
00db10
-#ifdef __ASSUME_PRIVATE_FUTEX
00db10
-# define LOAD_FUTEX_WAIT(reg) \
00db10
-	xorl	$(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), reg
00db10
-# define LOAD_FUTEX_WAIT_ABS(reg) \
00db10
-	xorl	$(FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME), reg
00db10
-#else
00db10
-# if FUTEX_WAIT == 0
00db10
-#  define LOAD_FUTEX_WAIT(reg) \
00db10
-	xorl	$FUTEX_PRIVATE_FLAG, reg ; \
00db10
-	andl	%fs:PRIVATE_FUTEX, reg
00db10
-# else
00db10
-#  define LOAD_FUTEX_WAIT(reg) \
00db10
-	xorl	$FUTEX_PRIVATE_FLAG, reg ; \
00db10
-	andl	%fs:PRIVATE_FUTEX, reg ; \
00db10
-	orl	$FUTEX_WAIT, reg
00db10
-# endif
00db10
-# define LOAD_FUTEX_WAIT_ABS(reg) \
00db10
-	xorl	$FUTEX_PRIVATE_FLAG, reg ; \
00db10
-	andl	%fs:PRIVATE_FUTEX, reg ; \
00db10
-	orl	$FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, reg
00db10
-#endif
00db10
-
00db10
-
00db10
-	.globl	__lll_robust_lock_wait
00db10
-	.type	__lll_robust_lock_wait,@function
00db10
-	.hidden	__lll_robust_lock_wait
00db10
-	.align	16
00db10
-__lll_robust_lock_wait:
00db10
-	cfi_startproc
00db10
-	pushq	%r10
00db10
-	cfi_adjust_cfa_offset(8)
00db10
-	pushq	%rdx
00db10
-	cfi_adjust_cfa_offset(8)
00db10
-	cfi_offset(%r10, -16)
00db10
-	cfi_offset(%rdx, -24)
00db10
-
00db10
-	xorq	%r10, %r10	/* No timeout.  */
00db10
-	LOAD_FUTEX_WAIT (%esi)
00db10
-
00db10
-4:	movl	%eax, %edx
00db10
-	orl	$FUTEX_WAITERS, %edx
00db10
-
00db10
-	testl	$FUTEX_OWNER_DIED, %eax
00db10
-	jnz	3f
00db10
-
00db10
-	cmpl	%edx, %eax
00db10
-	je	1f
00db10
-
00db10
-	LOCK
00db10
-	cmpxchgl %edx, (%rdi)
00db10
-	jnz	2f
00db10
-
00db10
-1:	movl	$SYS_futex, %eax
00db10
-	syscall
00db10
-
00db10
-	movl	(%rdi), %eax
00db10
-
00db10
-2:	testl	%eax, %eax
00db10
-	jne	4b
00db10
-
00db10
-	movl	%fs:TID, %edx
00db10
-	orl	$FUTEX_WAITERS, %edx
00db10
-	LOCK
00db10
-	cmpxchgl %edx, (%rdi)
00db10
-	jnz	4b
00db10
-	/* NB:	 %rax == 0 */
00db10
-
00db10
-3:	popq	%rdx
00db10
-	cfi_adjust_cfa_offset(-8)
00db10
-	cfi_restore(%rdx)
00db10
-	popq	%r10
00db10
-	cfi_adjust_cfa_offset(-8)
00db10
-	cfi_restore(%r10)
00db10
-	retq
00db10
-	cfi_endproc
00db10
-	.size	__lll_robust_lock_wait,.-__lll_robust_lock_wait
00db10
-
00db10
-
00db10
-	.globl	__lll_robust_timedlock_wait
00db10
-	.type	__lll_robust_timedlock_wait,@function
00db10
-	.hidden	__lll_robust_timedlock_wait
00db10
-	.align	16
00db10
-__lll_robust_timedlock_wait:
00db10
-	cfi_startproc
00db10
-# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
00db10
-#  ifdef PIC
00db10
-	cmpl	$0, __have_futex_clock_realtime(%rip)
00db10
-#  else
00db10
-	cmpl	$0, __have_futex_clock_realtime
00db10
-#  endif
00db10
-	je	.Lreltmo
00db10
-# endif
00db10
-
00db10
-	cmpq	$0, (%rdx)
00db10
-	js	7f
00db10
-
00db10
-	pushq	%r9
00db10
-	cfi_adjust_cfa_offset(8)
00db10
-	cfi_rel_offset(%r9, 0)
00db10
-	movq	%rdx, %r10
00db10
-	movl	$0xffffffff, %r9d
00db10
-	LOAD_FUTEX_WAIT_ABS (%esi)
00db10
-
00db10
-1:	testl	$FUTEX_OWNER_DIED, %eax
00db10
-	jnz	3f
00db10
-
00db10
-	movl	%eax, %edx
00db10
-	orl	$FUTEX_WAITERS, %edx
00db10
-
00db10
-	cmpl	%eax, %edx
00db10
-	je	5f
00db10
-
00db10
-	LOCK
00db10
-	cmpxchgl %edx, (%rdi)
00db10
-	movq	$0, %rcx	/* Must use mov to avoid changing cc.  */
00db10
-	jnz	6f
00db10
-
00db10
-5:	movl	$SYS_futex, %eax
00db10
-	syscall
00db10
-	movl	%eax, %ecx
00db10
-
00db10
-	movl	(%rdi), %eax
00db10
-
00db10
-6:	testl	%eax, %eax
00db10
-	jne	2f
00db10
-
00db10
-	movl	%fs:TID, %edx
00db10
-	orl	$FUTEX_WAITERS, %edx
00db10
-	LOCK
00db10
-	cmpxchgl %edx, (%rdi)
00db10
-	jnz	2f
00db10
-
00db10
-3:	popq	%r9
00db10
-	cfi_adjust_cfa_offset(-8)
00db10
-	cfi_restore(%r9)
00db10
-	retq
00db10
-
00db10
-	cfi_adjust_cfa_offset(8)
00db10
-	cfi_rel_offset(%r9, 0)
00db10
-	/* Check whether the time expired.  */
00db10
-2:	cmpl	$-ETIMEDOUT, %ecx
00db10
-	je	4f
00db10
-	cmpl	$-EINVAL, %ecx
00db10
-	jne	1b
00db10
-
00db10
-4:	movl	%ecx, %eax
00db10
-	negl	%eax
00db10
-	jmp	3b
00db10
-	cfi_adjust_cfa_offset(-8)
00db10
-	cfi_restore(%r9)
00db10
-
00db10
-7:	movl	$ETIMEDOUT, %eax
00db10
-	retq
00db10
-
00db10
-
00db10
-# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
00db10
-.Lreltmo:
00db10
-	/* Check for a valid timeout value.  */
00db10
-	cmpq	$1000000000, 8(%rdx)
00db10
-	jae	3f
00db10
-
00db10
-	pushq	%r8
00db10
-	cfi_adjust_cfa_offset(8)
00db10
-	pushq	%r9
00db10
-	cfi_adjust_cfa_offset(8)
00db10
-	pushq	%r12
00db10
-	cfi_adjust_cfa_offset(8)
00db10
-	pushq	%r13
00db10
-	cfi_adjust_cfa_offset(8)
00db10
-	cfi_offset(%r8, -16)
00db10
-	cfi_offset(%r9, -24)
00db10
-	cfi_offset(%r12, -32)
00db10
-	cfi_offset(%r13, -40)
00db10
-	pushq	%rsi
00db10
-	cfi_adjust_cfa_offset(8)
00db10
-
00db10
-	/* Stack frame for the timespec and timeval structs.  */
00db10
-	subq	$32, %rsp
00db10
-	cfi_adjust_cfa_offset(32)
00db10
-
00db10
-	movq	%rdi, %r12
00db10
-	movq	%rdx, %r13
00db10
-
00db10
-1:	movq	%rax, 16(%rsp)
00db10
-
00db10
-	/* Get current time.  */
00db10
-	movq	%rsp, %rdi
00db10
-	xorl	%esi, %esi
00db10
-	/* This call works because we directly jump to a system call entry
00db10
-	   which preserves all the registers.  */
00db10
-	call	JUMPTARGET(__gettimeofday)
00db10
-
00db10
-	/* Compute relative timeout.  */
00db10
-	movq	8(%rsp), %rax
00db10
-	movl	$1000, %edi
00db10
-	mul	%rdi		/* Milli seconds to nano seconds.  */
00db10
-	movq	(%r13), %rdi
00db10
-	movq	8(%r13), %rsi
00db10
-	subq	(%rsp), %rdi
00db10
-	subq	%rax, %rsi
00db10
-	jns	4f
00db10
-	addq	$1000000000, %rsi
00db10
-	decq	%rdi
00db10
-4:	testq	%rdi, %rdi
00db10
-	js	8f		/* Time is already up.  */
00db10
-
00db10
-	/* Futex call.  */
00db10
-	movq	%rdi, (%rsp)	/* Store relative timeout.  */
00db10
-	movq	%rsi, 8(%rsp)
00db10
-
00db10
-	movq	16(%rsp), %rdx
00db10
-	movl	%edx, %eax
00db10
-	orl	$FUTEX_WAITERS, %edx
00db10
-
00db10
-	testl	$FUTEX_OWNER_DIED, %eax
00db10
-	jnz	6f
00db10
-
00db10
-	cmpl	%eax, %edx
00db10
-	je	2f
00db10
-
00db10
-	LOCK
00db10
-	cmpxchgl %edx, (%r12)
00db10
-	movq	$0, %rcx	/* Must use mov to avoid changing cc.  */
00db10
-	jnz	5f
00db10
-
00db10
-2:	movq	%rsp, %r10
00db10
-	movl	32(%rsp), %esi
00db10
-	LOAD_FUTEX_WAIT (%esi)
00db10
-	movq	%r12, %rdi
00db10
-	movl	$SYS_futex, %eax
00db10
-	syscall
00db10
-	movq	%rax, %rcx
00db10
-
00db10
-	movl	(%r12), %eax
00db10
-
00db10
-5:	testl	%eax, %eax
00db10
-	jne	7f
00db10
-
00db10
-	movl	%fs:TID, %edx
00db10
-	orl	$FUTEX_WAITERS, %edx
00db10
-	LOCK
00db10
-	cmpxchgl %edx, (%r12)
00db10
-	jnz	7f
00db10
-
00db10
-6:	addq	$40, %rsp
00db10
-	cfi_adjust_cfa_offset(-40)
00db10
-	popq	%r13
00db10
-	cfi_adjust_cfa_offset(-8)
00db10
-	cfi_restore(%r13)
00db10
-	popq	%r12
00db10
-	cfi_adjust_cfa_offset(-8)
00db10
-	cfi_restore(%r12)
00db10
-	popq	%r9
00db10
-	cfi_adjust_cfa_offset(-8)
00db10
-	cfi_restore(%r9)
00db10
-	popq	%r8
00db10
-	cfi_adjust_cfa_offset(-8)
00db10
-	cfi_restore(%r8)
00db10
-	retq
00db10
-
00db10
-3:	movl	$EINVAL, %eax
00db10
-	retq
00db10
-
00db10
-	cfi_adjust_cfa_offset(72)
00db10
-	cfi_offset(%r8, -16)
00db10
-	cfi_offset(%r9, -24)
00db10
-	cfi_offset(%r12, -32)
00db10
-	cfi_offset(%r13, -40)
00db10
-	/* Check whether the time expired.  */
00db10
-7:	cmpl	$-ETIMEDOUT, %ecx
00db10
-	jne	1b
00db10
-
00db10
-8:	movl	$ETIMEDOUT, %eax
00db10
-	jmp	6b
00db10
-#endif
00db10
-	cfi_endproc
00db10
-	.size	__lll_robust_timedlock_wait,.-__lll_robust_timedlock_wait
00db10
Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S
00db10
+++ /dev/null
00db10
@@ -1,278 +0,0 @@
00db10
-/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
00db10
-   This file is part of the GNU C Library.
00db10
-
00db10
-   The GNU C Library is free software; you can redistribute it and/or
00db10
-   modify it under the terms of the GNU Lesser General Public
00db10
-   License as published by the Free Software Foundation; either
00db10
-   version 2.1 of the License, or (at your option) any later version.
00db10
-
00db10
-   The GNU C Library is distributed in the hope that it will be useful,
00db10
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00db10
-   Lesser General Public License for more details.
00db10
-
00db10
-   You should have received a copy of the GNU Lesser General Public
00db10
-   License along with the GNU C Library; if not, see
00db10
-   <http://www.gnu.org/licenses/>.  */
00db10
-
00db10
-#include <sysdep.h>
00db10
-#include <pthread-errnos.h>
00db10
-#include <lowlevellock.h>
00db10
-#include <lowlevelrobustlock.h>
00db10
-#include <kernel-features.h>
00db10
-#include "lowlevel-atomic.h"
00db10
-
00db10
-	.text
00db10
-
00db10
-#define FUTEX_WAITERS		0x80000000
00db10
-#define FUTEX_OWNER_DIED	0x40000000
00db10
-
00db10
-#ifdef __ASSUME_PRIVATE_FUTEX
00db10
-# define LOAD_FUTEX_WAIT(reg,tmp,tmp2) \
00db10
-	mov	#(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), tmp; \
00db10
-	extu.b	tmp, tmp; \
00db10
-	xor	tmp, reg
00db10
-#else
00db10
-# if FUTEX_WAIT == 0
00db10
-#  define LOAD_FUTEX_WAIT(reg,tmp,tmp2) \
00db10
-	stc	gbr, tmp	; \
00db10
-	mov.w	99f, tmp2	; \
00db10
-	add	tmp2, tmp 	; \
00db10
-	mov.l	@tmp, tmp2	; \
00db10
-	bra	98f		; \
00db10
-	 mov	#FUTEX_PRIVATE_FLAG, tmp ; \
00db10
-99:	.word	PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
00db10
-98:	extu.b	tmp, tmp	; \
00db10
-	xor	tmp, reg	; \
00db10
-	and	tmp2, reg
00db10
-# else
00db10
-#  define LOAD_FUTEX_WAIT(reg,tmp,tmp2) \
00db10
-	stc	gbr, tmp	; \
00db10
-	mov.w	99f, tmp2	; \
00db10
-	add	tmp2, tmp 	; \
00db10
-	mov.l	@tmp, tmp2	; \
00db10
-	bra	98f		; \
00db10
-	 mov	#FUTEX_PRIVATE_FLAG, tmp ; \
00db10
-99:	.word	PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
00db10
-98:	extu.b	tmp, tmp	; \
00db10
-	xor	tmp, reg	; \
00db10
-	and	tmp2, reg	; \
00db10
-	mov	#FUTEX_WAIT, tmp ; \
00db10
-	or	tmp, reg
00db10
-# endif
00db10
-#endif
00db10
-
00db10
-	.globl	__lll_robust_lock_wait
00db10
-	.type	__lll_robust_lock_wait,@function
00db10
-	.hidden	__lll_robust_lock_wait
00db10
-	.align	5
00db10
-	cfi_startproc
00db10
-__lll_robust_lock_wait:
00db10
-	mov.l	r8, @-r15
00db10
-	cfi_adjust_cfa_offset(4)
00db10
-	cfi_rel_offset (r8, 0)
00db10
-	mov	r5, r8
00db10
-	mov	#0, r7		/* No timeout.  */
00db10
-	mov	r6, r5
00db10
-	LOAD_FUTEX_WAIT (r5, r0, r1)
00db10
-
00db10
-4:
00db10
-	mov	r4, r6
00db10
-	mov.l	.L_FUTEX_WAITERS, r0
00db10
-	or	r0, r6
00db10
-	shlr	r0		/* r0 = FUTEX_OWNER_DIED */
00db10
-	tst	r0, r4
00db10
-	bf/s	3f
00db10
-	 cmp/eq	r4, r6
00db10
-	bt	1f
00db10
-
00db10
-	CMPXCHG (r4, @r8, r6, r2)
00db10
-	bf	2f
00db10
-
00db10
-1:
00db10
-	mov	r8, r4
00db10
-	mov	#SYS_futex, r3
00db10
-	extu.b	r3, r3
00db10
-	trapa	#0x14
00db10
-	SYSCALL_INST_PAD
00db10
-
00db10
-	mov.l	@r8, r2
00db10
-
00db10
-2:
00db10
-	tst	r2, r2
00db10
-	bf/s	4b
00db10
-	 mov	r2, r4
00db10
-
00db10
-	stc	gbr, r1
00db10
-	mov.w	.Ltidoff, r2
00db10
-	add	r2, r1
00db10
-	mov.l	@r1, r6
00db10
-	mov	#0, r3
00db10
-	CMPXCHG (r3, @r8, r6, r4)
00db10
-	bf	4b
00db10
-	mov	#0, r4
00db10
-
00db10
-3:
00db10
-	mov.l	@r15+, r8
00db10
-	cfi_adjust_cfa_offset (-4)
00db10
-	cfi_restore (r8)
00db10
-	ret
00db10
-	 mov	r4, r0
00db10
-	cfi_endproc
00db10
-	.align	2
00db10
-.L_FUTEX_WAITERS:
00db10
-	.long	FUTEX_WAITERS
00db10
-.Ltidoff:
00db10
-	.word	TID - TLS_PRE_TCB_SIZE
00db10
-	.size	__lll_robust_lock_wait,.-__lll_robust_lock_wait
00db10
-
00db10
-
00db10
-	.globl	__lll_robust_timedlock_wait
00db10
-	.type	__lll_robust_timedlock_wait,@function
00db10
-	.hidden	__lll_robust_timedlock_wait
00db10
-	.align	5
00db10
-	cfi_startproc
00db10
-__lll_robust_timedlock_wait:
00db10
-	/* Check for a valid timeout value.  */
00db10
-	mov.l	@(4,r6), r1
00db10
-	mov.l	.L1g, r0
00db10
-	cmp/hs	r0, r1
00db10
-	bt	3f
00db10
-
00db10
-	cfi_remember_state
00db10
-
00db10
-	mov.l	r11, @-r15
00db10
-	cfi_adjust_cfa_offset(4)
00db10
-	cfi_rel_offset (r11, 0)
00db10
-	mov.l	r10, @-r15
00db10
-	cfi_adjust_cfa_offset(4)
00db10
-	cfi_rel_offset (r10, 0)
00db10
-	mov.l	r9, @-r15
00db10
-	cfi_adjust_cfa_offset(4)
00db10
-	cfi_rel_offset (r9, 0)
00db10
-	mov.l	r8, @-r15
00db10
-	cfi_adjust_cfa_offset(4)
00db10
-	cfi_rel_offset (r8, 0)
00db10
-	mov	r7, r11
00db10
-	mov	r4, r10
00db10
-	mov	r6, r9
00db10
-	mov	r5, r8
00db10
-
00db10
-	/* Stack frame for the timespec and timeval structs.  */
00db10
-	add	#-8, r15
00db10
-	cfi_adjust_cfa_offset(8)
00db10
-
00db10
-1:
00db10
-	/* Get current time.  */
00db10
-	mov	r15, r4
00db10
-	mov	#0, r5
00db10
-	mov	#__NR_gettimeofday, r3
00db10
-	trapa	#0x12
00db10
-	SYSCALL_INST_PAD
00db10
-
00db10
-	/* Compute relative timeout.  */
00db10
-	mov.l	@(4,r15), r0
00db10
-	mov.w	.L1k, r1
00db10
-	dmulu.l	r0, r1		/* Micro seconds to nano seconds.  */
00db10
-	mov.l	@r9, r2
00db10
-	mov.l	@(4,r9), r3
00db10
-	mov.l	@r15, r0
00db10
-	sts	macl, r1
00db10
-	sub	r0, r2
00db10
-	clrt
00db10
-	subc	r1, r3
00db10
-	bf	4f
00db10
-	mov.l	.L1g, r1
00db10
-	add	r1, r3
00db10
-	add	#-1, r2
00db10
-4:
00db10
-	cmp/pz	r2
00db10
-	bf	8f		/* Time is already up.  */
00db10
-
00db10
-	mov.l	r2, @r15	/* Store relative timeout.  */
00db10
-	mov.l	r3, @(4,r15)
00db10
-
00db10
-	mov	r10, r6
00db10
-	mov.l	.L_FUTEX_WAITERS2, r0
00db10
-	or	r0, r6
00db10
-	shlr	r0		/* r0 = FUTEX_OWNER_DIED */
00db10
-	tst	r0, r4
00db10
-	bf/s	6f
00db10
-	 cmp/eq	r4, r6
00db10
-	bt	2f
00db10
-
00db10
-	CMPXCHG (r4, @r8, r6, r2)
00db10
-	bf/s	5f
00db10
-	 mov	#0, r5
00db10
-
00db10
-2:
00db10
-	mov	r8, r4
00db10
-	mov	r11, r5
00db10
-	LOAD_FUTEX_WAIT (r5, r0, r1)
00db10
-	mov	r10, r6
00db10
-	mov	r15, r7
00db10
-	mov	#SYS_futex, r3
00db10
-	extu.b	r3, r3
00db10
-	trapa	#0x14
00db10
-	SYSCALL_INST_PAD
00db10
-	mov	r0, r5
00db10
-
00db10
-	mov.l	@r8, r2
00db10
-
00db10
-5:
00db10
-	tst	r2, r2
00db10
-	bf/s	7f
00db10
-	 mov	r2, r10
00db10
-
00db10
-	stc	gbr, r1
00db10
-	mov.w	.Ltidoff2, r2
00db10
-	add	r2, r1
00db10
-	mov.l	@r1, r4
00db10
-	mov	#0, r3
00db10
-	CMPXCHG (r3, @r8, r4, r10)
00db10
-	bf	7f
00db10
-	mov	#0, r0
00db10
-
00db10
-6:
00db10
-	cfi_remember_state
00db10
-	add	#8, r15
00db10
-	cfi_adjust_cfa_offset (-8)
00db10
-	mov.l	@r15+, r8
00db10
-	cfi_adjust_cfa_offset (-4)
00db10
-	cfi_restore (r8)
00db10
-	mov.l	@r15+, r9
00db10
-	cfi_adjust_cfa_offset (-4)
00db10
-	cfi_restore (r9)
00db10
-	mov.l	@r15+, r10
00db10
-	cfi_adjust_cfa_offset (-4)
00db10
-	cfi_restore (r10)
00db10
-	rts
00db10
-	 mov.l	@r15+, r11
00db10
-	/* Omit CFI for restore in delay slot.  */
00db10
-	cfi_restore_state
00db10
-
00db10
-7:
00db10
-	/* Check whether the time expired.  */
00db10
-	mov	#-ETIMEDOUT, r1
00db10
-	cmp/eq	r5, r1
00db10
-	bf	1b
00db10
-
00db10
-8:
00db10
-	bra	6b
00db10
-	 mov	#ETIMEDOUT, r0
00db10
-
00db10
-	cfi_restore_state
00db10
-3:
00db10
-	rts
00db10
-	 mov	#EINVAL, r0
00db10
-	cfi_endproc
00db10
-	.align	2
00db10
-.L_FUTEX_WAITERS2:
00db10
-	.long	FUTEX_WAITERS
00db10
-.L1g:
00db10
-	.long	1000000000
00db10
-.Ltidoff2:
00db10
-	.word	TID - TLS_PRE_TCB_SIZE
00db10
-.L1k:
00db10
-	.word	1000
00db10
-	.size	__lll_robust_timedlock_wait,.-__lll_robust_timedlock_wait
00db10
Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/Makefile
00db10
===================================================================
00db10
--- glibc-2.17-c758a686.orig/nptl/sysdeps/unix/sysv/linux/Makefile
00db10
+++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/Makefile
00db10
@@ -24,7 +24,7 @@ libpthread-sysdep_routines += pt-fork pt
00db10
 
00db10
 gen-as-const-headers += lowlevelcond.sym lowlevelrwlock.sym \
00db10
 			lowlevelbarrier.sym unwindbuf.sym \
00db10
-			lowlevelrobustlock.sym pthread-pi-defines.sym
00db10
+			pthread-pi-defines.sym
00db10
 endif
00db10
 
00db10
 ifeq ($(subdir),posix)