2007-01-17 09:33:32 +00:00
|
|
|
/* Copyright (C) 2002-2006, 2007 Free Software Foundation, Inc.
|
2003-03-11 01:01:24 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with the GNU C Library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
|
|
02111-1307 USA. */
|
|
|
|
|
|
|
|
#include <sysdep.h>
|
2003-03-12 10:28:07 +00:00
|
|
|
#include <pthread-errnos.h>
|
2003-03-11 01:01:24 +00:00
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
#ifndef LOCK
|
|
|
|
# ifdef UP
|
|
|
|
# define LOCK
|
|
|
|
# else
|
|
|
|
# define LOCK lock
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define SYS_futex 202
|
2007-05-23 20:51:45 +00:00
|
|
|
#ifndef FUTEX_WAIT
|
|
|
|
# define FUTEX_WAIT 0
|
|
|
|
# define FUTEX_WAKE 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef LOAD_FUTEX_WAIT
|
|
|
|
# if FUTEX_WAIT == 0
|
|
|
|
# define LOAD_FUTEX_WAIT(reg) \
|
|
|
|
xorl reg, reg
|
|
|
|
# else
|
|
|
|
# define LOAD_FUTEX_WAIT(reg) \
|
|
|
|
movl $FUTEX_WAIT, reg
|
|
|
|
# endif
|
|
|
|
# define LOAD_FUTEX_WAKE(reg) \
|
|
|
|
movl $FUTEX_WAKE, reg
|
|
|
|
#endif
|
|
|
|
|
2003-03-11 01:01:24 +00:00
|
|
|
|
2003-03-15 07:54:39 +00:00
|
|
|
/* For the calculation see asm/vsyscall.h. */
|
|
|
|
#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
|
|
|
|
|
2003-03-11 01:01:24 +00:00
|
|
|
|
2003-09-22 04:41:12 +00:00
|
|
|
.globl __lll_mutex_lock_wait
|
|
|
|
.type __lll_mutex_lock_wait,@function
|
|
|
|
.hidden __lll_mutex_lock_wait
|
2003-03-11 01:01:24 +00:00
|
|
|
.align 16
|
2003-09-22 04:41:12 +00:00
|
|
|
__lll_mutex_lock_wait:
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_startproc
|
2003-03-11 01:01:24 +00:00
|
|
|
pushq %r10
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(8)
|
2003-03-11 01:01:24 +00:00
|
|
|
pushq %rdx
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(8)
|
|
|
|
cfi_offset(%r10, -16)
|
|
|
|
cfi_offset(%rdx, -24)
|
2003-03-11 01:01:24 +00:00
|
|
|
xorq %r10, %r10 /* No timeout. */
|
2003-09-22 04:41:12 +00:00
|
|
|
movl $2, %edx
|
2007-05-23 20:51:45 +00:00
|
|
|
LOAD_FUTEX_WAIT (%esi)
|
2003-03-11 01:01:24 +00:00
|
|
|
|
2004-02-22 19:37:31 +00:00
|
|
|
cmpl %edx, %eax /* NB: %edx == 2 */
|
2004-03-01 06:38:24 +00:00
|
|
|
jne 2f
|
2003-09-22 04:41:12 +00:00
|
|
|
|
2005-03-31 10:02:53 +00:00
|
|
|
1: movl $SYS_futex, %eax
|
2003-03-11 01:01:24 +00:00
|
|
|
syscall
|
|
|
|
|
2004-03-01 06:38:24 +00:00
|
|
|
2: movl %edx, %eax
|
2004-02-22 19:37:31 +00:00
|
|
|
xchgl %eax, (%rdi) /* NB: lock is implied */
|
2003-03-11 01:01:24 +00:00
|
|
|
|
2004-02-22 19:37:31 +00:00
|
|
|
testl %eax, %eax
|
2003-09-22 04:41:12 +00:00
|
|
|
jnz 1b
|
2003-03-11 01:01:24 +00:00
|
|
|
|
2004-03-01 06:38:24 +00:00
|
|
|
popq %rdx
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(-8)
|
|
|
|
cfi_restore(%rdx)
|
2003-03-11 01:01:24 +00:00
|
|
|
popq %r10
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(-8)
|
|
|
|
cfi_restore(%r10)
|
2003-03-11 01:01:24 +00:00
|
|
|
retq
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_endproc
|
2003-09-22 04:41:12 +00:00
|
|
|
.size __lll_mutex_lock_wait,.-__lll_mutex_lock_wait
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef NOT_IN_libc
|
|
|
|
.globl __lll_mutex_timedlock_wait
|
|
|
|
.type __lll_mutex_timedlock_wait,@function
|
|
|
|
.hidden __lll_mutex_timedlock_wait
|
|
|
|
.align 16
|
|
|
|
__lll_mutex_timedlock_wait:
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_startproc
|
2003-09-22 04:41:12 +00:00
|
|
|
/* Check for a valid timeout value. */
|
|
|
|
cmpq $1000000000, 8(%rdx)
|
|
|
|
jae 3f
|
|
|
|
|
2004-03-24 01:56:21 +00:00
|
|
|
pushq %r8
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(8)
|
2004-03-24 01:56:21 +00:00
|
|
|
pushq %r9
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(8)
|
2003-09-22 04:41:12 +00:00
|
|
|
pushq %r12
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(8)
|
2003-09-22 04:41:12 +00:00
|
|
|
pushq %r13
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(8)
|
2003-09-22 04:41:12 +00:00
|
|
|
pushq %r14
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(8)
|
|
|
|
cfi_offset(%r8, -16)
|
|
|
|
cfi_offset(%r9, -24)
|
|
|
|
cfi_offset(%r12, -32)
|
|
|
|
cfi_offset(%r13, -40)
|
|
|
|
cfi_offset(%r14, -48)
|
2003-09-22 04:41:12 +00:00
|
|
|
|
|
|
|
/* Stack frame for the timespec and timeval structs. */
|
|
|
|
subq $16, %rsp
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(16)
|
2003-09-22 04:41:12 +00:00
|
|
|
|
|
|
|
movq %rdi, %r12
|
|
|
|
movq %rdx, %r13
|
|
|
|
|
|
|
|
1:
|
|
|
|
/* Get current time. */
|
|
|
|
movq %rsp, %rdi
|
2005-03-31 10:02:53 +00:00
|
|
|
xorl %esi, %esi
|
2003-09-22 04:41:12 +00:00
|
|
|
movq $VSYSCALL_ADDR_vgettimeofday, %rax
|
2004-10-01 10:33:03 +00:00
|
|
|
/* This is a regular function call, all caller-save registers
|
2003-09-22 04:41:12 +00:00
|
|
|
might be clobbered. */
|
|
|
|
callq *%rax
|
|
|
|
|
|
|
|
/* Compute relative timeout. */
|
|
|
|
movq 8(%rsp), %rax
|
2005-03-31 10:02:53 +00:00
|
|
|
movl $1000, %edi
|
2003-09-22 04:41:12 +00:00
|
|
|
mul %rdi /* Milli seconds to nano seconds. */
|
|
|
|
movq (%r13), %rdi
|
|
|
|
movq 8(%r13), %rsi
|
|
|
|
subq (%rsp), %rdi
|
|
|
|
subq %rax, %rsi
|
|
|
|
jns 4f
|
|
|
|
addq $1000000000, %rsi
|
|
|
|
decq %rdi
|
|
|
|
4: testq %rdi, %rdi
|
|
|
|
js 5f /* Time is already up. */
|
|
|
|
|
|
|
|
/* Futex call. */
|
|
|
|
movq %rdi, (%rsp) /* Store relative timeout. */
|
|
|
|
movq %rsi, 8(%rsp)
|
|
|
|
|
|
|
|
movl $1, %eax
|
|
|
|
movl $2, %edx
|
|
|
|
LOCK
|
|
|
|
cmpxchgl %edx, (%r12)
|
|
|
|
|
|
|
|
testl %eax, %eax
|
|
|
|
je 8f
|
|
|
|
|
|
|
|
movq %rsp, %r10
|
2007-05-23 20:51:45 +00:00
|
|
|
LOAD_FUTEX_WAIT (%esi)
|
2003-09-22 04:41:12 +00:00
|
|
|
movq %r12, %rdi
|
2005-03-31 10:02:53 +00:00
|
|
|
movl $SYS_futex, %eax
|
2003-09-22 04:41:12 +00:00
|
|
|
syscall
|
|
|
|
movq %rax, %rcx
|
|
|
|
|
2004-10-01 10:33:03 +00:00
|
|
|
8: /* NB: %edx == 2 */
|
|
|
|
xorl %eax, %eax
|
2003-09-22 04:41:12 +00:00
|
|
|
LOCK
|
2007-02-10 00:10:39 +00:00
|
|
|
cmpxchgl %edx, (%r12)
|
2003-09-22 04:41:12 +00:00
|
|
|
jnz 7f
|
|
|
|
|
2004-10-01 10:33:03 +00:00
|
|
|
6: addq $16, %rsp
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(-16)
|
2003-09-22 04:41:12 +00:00
|
|
|
popq %r14
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(-8)
|
|
|
|
cfi_restore(%r14)
|
2003-09-22 04:41:12 +00:00
|
|
|
popq %r13
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(-8)
|
|
|
|
cfi_restore(%r13)
|
2003-09-22 04:41:12 +00:00
|
|
|
popq %r12
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(-8)
|
|
|
|
cfi_restore(%r12)
|
2004-03-24 01:56:21 +00:00
|
|
|
popq %r9
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(-8)
|
|
|
|
cfi_restore(%r9)
|
2004-03-24 01:56:21 +00:00
|
|
|
popq %r8
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(-8)
|
|
|
|
cfi_restore(%r8)
|
|
|
|
retq
|
|
|
|
|
|
|
|
3: movl $EINVAL, %eax
|
2003-09-22 04:41:12 +00:00
|
|
|
retq
|
|
|
|
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(56)
|
|
|
|
cfi_offset(%r8, -16)
|
|
|
|
cfi_offset(%r9, -24)
|
|
|
|
cfi_offset(%r12, -32)
|
|
|
|
cfi_offset(%r13, -40)
|
|
|
|
cfi_offset(%r14, -48)
|
2003-09-22 04:41:12 +00:00
|
|
|
/* Check whether the time expired. */
|
|
|
|
7: cmpq $-ETIMEDOUT, %rcx
|
|
|
|
je 5f
|
2004-10-01 10:33:03 +00:00
|
|
|
|
|
|
|
/* Make sure the current holder knows we are going to sleep. */
|
|
|
|
movl %edx, %eax
|
2004-10-01 21:24:29 +00:00
|
|
|
xchgl %eax, (%rdi)
|
2004-10-01 10:33:03 +00:00
|
|
|
testl %eax, %eax
|
|
|
|
jz 6b
|
2003-09-22 04:41:12 +00:00
|
|
|
jmp 1b
|
|
|
|
|
|
|
|
5: movl $ETIMEDOUT, %eax
|
2004-10-01 10:33:03 +00:00
|
|
|
jmp 6b
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_endproc
|
2003-09-22 04:41:12 +00:00
|
|
|
.size __lll_mutex_timedlock_wait,.-__lll_mutex_timedlock_wait
|
|
|
|
#endif
|
2003-03-11 01:01:24 +00:00
|
|
|
|
|
|
|
|
2003-09-22 04:41:12 +00:00
|
|
|
.globl __lll_mutex_unlock_wake
|
|
|
|
.type __lll_mutex_unlock_wake,@function
|
|
|
|
.hidden __lll_mutex_unlock_wake
|
2003-03-11 01:01:24 +00:00
|
|
|
.align 16
|
2003-09-22 04:41:12 +00:00
|
|
|
__lll_mutex_unlock_wake:
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_startproc
|
2003-03-11 01:01:24 +00:00
|
|
|
pushq %rsi
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(8)
|
2003-03-11 01:01:24 +00:00
|
|
|
pushq %rdx
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(8)
|
|
|
|
cfi_offset(%rsi, -16)
|
|
|
|
cfi_offset(%rdx, -24)
|
2003-03-11 01:01:24 +00:00
|
|
|
|
2007-05-30 04:45:03 +00:00
|
|
|
movl $0, (%rdi)
|
2007-05-23 20:51:45 +00:00
|
|
|
LOAD_FUTEX_WAKE (%esi)
|
2003-03-11 01:01:24 +00:00
|
|
|
movl $1, %edx /* Wake one thread. */
|
2005-03-31 10:02:53 +00:00
|
|
|
movl $SYS_futex, %eax
|
2003-03-11 01:01:24 +00:00
|
|
|
syscall
|
|
|
|
|
|
|
|
popq %rdx
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(-8)
|
|
|
|
cfi_restore(%rdx)
|
2003-03-11 01:01:24 +00:00
|
|
|
popq %rsi
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_adjust_cfa_offset(-8)
|
|
|
|
cfi_restore(%rsi)
|
2003-03-11 01:01:24 +00:00
|
|
|
retq
|
2006-03-04 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2006-03-03 Jakub Jelinek <jakub@redhat.com>
Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
lll_robust_mutex_cond_lock, lll_mutex_timedlock,
lll_robust_mutex_timedlock, lll_mutex_unlock,
lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
Add _L_*_ symbols around the subsection.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2006-09-05 14:49:19 +00:00
|
|
|
cfi_endproc
|
2003-09-22 04:41:12 +00:00
|
|
|
.size __lll_mutex_unlock_wake,.-__lll_mutex_unlock_wake
|
2003-03-11 01:01:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef NOT_IN_libc
|
|
|
|
.globl __lll_timedwait_tid
|
|
|
|
.type __lll_timedwait_tid,@function
|
|
|
|
.hidden __lll_timedwait_tid
|
|
|
|
.align 16
|
|
|
|
__lll_timedwait_tid:
|
2007-01-17 09:33:32 +00:00
|
|
|
cfi_startproc
|
2003-03-15 07:54:39 +00:00
|
|
|
pushq %r12
|
2007-01-17 09:33:32 +00:00
|
|
|
cfi_adjust_cfa_offset(8)
|
2003-03-15 07:54:39 +00:00
|
|
|
pushq %r13
|
2007-01-17 09:33:32 +00:00
|
|
|
cfi_adjust_cfa_offset(8)
|
|
|
|
cfi_offset(%r12, -16)
|
|
|
|
cfi_offset(%r13, -24)
|
2003-03-15 07:54:39 +00:00
|
|
|
|
|
|
|
movq %rdi, %r12
|
|
|
|
movq %rsi, %r13
|
2003-03-11 01:01:24 +00:00
|
|
|
|
|
|
|
subq $16, %rsp
|
2007-01-17 09:33:32 +00:00
|
|
|
cfi_adjust_cfa_offset(16)
|
2003-03-11 01:01:24 +00:00
|
|
|
|
|
|
|
/* Get current time. */
|
|
|
|
2: movq %rsp, %rdi
|
2005-03-31 10:02:53 +00:00
|
|
|
xorl %esi, %esi
|
2003-03-15 07:54:39 +00:00
|
|
|
movq $VSYSCALL_ADDR_vgettimeofday, %rax
|
|
|
|
callq *%rax
|
2003-03-11 01:01:24 +00:00
|
|
|
|
|
|
|
/* Compute relative timeout. */
|
2003-03-12 05:45:00 +00:00
|
|
|
movq 8(%rsp), %rax
|
2005-03-31 10:02:53 +00:00
|
|
|
movl $1000, %edi
|
2003-03-11 04:07:00 +00:00
|
|
|
mul %rdi /* Milli seconds to nano seconds. */
|
2003-03-15 07:54:39 +00:00
|
|
|
movq (%r13), %rdi
|
|
|
|
movq 8(%r13), %rsi
|
2003-03-11 01:01:24 +00:00
|
|
|
subq (%rsp), %rdi
|
|
|
|
subq %rax, %rsi
|
|
|
|
jns 5f
|
|
|
|
addq $1000000000, %rsi
|
|
|
|
decq %rdi
|
|
|
|
5: testq %rdi, %rdi
|
|
|
|
js 6f /* Time is already up. */
|
|
|
|
|
|
|
|
movq %rdi, (%rsp) /* Store relative timeout. */
|
|
|
|
movq %rsi, 8(%rsp)
|
|
|
|
|
2003-03-15 07:54:39 +00:00
|
|
|
movl (%r12), %edx
|
2003-03-11 01:01:24 +00:00
|
|
|
testl %edx, %edx
|
|
|
|
jz 4f
|
|
|
|
|
|
|
|
movq %rsp, %r10
|
2007-05-23 20:51:45 +00:00
|
|
|
/* XXX The kernel so far uses global futex for the wakeup at
|
|
|
|
all times. */
|
2005-03-31 10:02:53 +00:00
|
|
|
#if FUTEX_WAIT == 0
|
|
|
|
xorl %esi, %esi
|
|
|
|
#else
|
|
|
|
movl $FUTEX_WAIT, %esi
|
|
|
|
#endif
|
2003-03-15 07:54:39 +00:00
|
|
|
movq %r12, %rdi
|
2005-03-31 10:02:53 +00:00
|
|
|
movl $SYS_futex, %eax
|
2003-03-11 01:01:24 +00:00
|
|
|
syscall
|
|
|
|
|
|
|
|
cmpl $0, (%rdi)
|
|
|
|
jne 1f
|
|
|
|
4: xorl %eax, %eax
|
|
|
|
|
2003-03-15 07:54:39 +00:00
|
|
|
8: addq $16, %rsp
|
2007-01-17 09:33:32 +00:00
|
|
|
cfi_adjust_cfa_offset(-16)
|
2003-03-15 07:54:39 +00:00
|
|
|
popq %r13
|
2007-01-17 09:33:32 +00:00
|
|
|
cfi_adjust_cfa_offset(-8)
|
|
|
|
cfi_restore(%r13)
|
2003-03-15 07:54:39 +00:00
|
|
|
popq %r12
|
2007-01-17 09:33:32 +00:00
|
|
|
cfi_adjust_cfa_offset(-8)
|
|
|
|
cfi_restore(%r12)
|
2003-03-11 01:01:24 +00:00
|
|
|
retq
|
|
|
|
|
2007-01-17 09:33:32 +00:00
|
|
|
cfi_adjust_cfa_offset(32)
|
2003-03-11 01:01:24 +00:00
|
|
|
1: cmpq $-ETIMEDOUT, %rax
|
|
|
|
jne 2b
|
|
|
|
|
|
|
|
6: movl $ETIMEDOUT, %eax
|
2003-03-15 07:54:39 +00:00
|
|
|
jmp 8b
|
2007-01-17 09:33:32 +00:00
|
|
|
cfi_endproc
|
2003-03-11 01:01:24 +00:00
|
|
|
.size __lll_timedwait_tid,.-__lll_timedwait_tid
|
|
|
|
#endif
|