mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Update.
* sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead of int $0x80. * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise. * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using sysenter. * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise. * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
This commit is contained in:
@ -1,5 +1,22 @@
|
|||||||
2002-12-19 Ulrich Drepper <drepper@redhat.com>
|
2002-12-19 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
|
||||||
|
of int $0x80.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
|
||||||
|
sysenter.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
|
||||||
|
|
||||||
|
* sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
|
||||||
|
|
||||||
* allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
|
* allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
|
||||||
in new TCB.
|
in new TCB.
|
||||||
* sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
|
* sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#ifndef _TLS_H
|
#ifndef _TLS_H
|
||||||
#define _TLS_H 1
|
#define _TLS_H 1
|
||||||
|
|
||||||
|
#include <dl-sysdep.h>
|
||||||
#ifndef __ASSEMBLER__
|
#ifndef __ASSEMBLER__
|
||||||
# include <stddef.h>
|
# include <stddef.h>
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
|
@ -45,7 +45,7 @@ __lll_lock_wait:
|
|||||||
1:
|
1:
|
||||||
leal -1(%eax), %edx /* account for the preceeded xadd. */
|
leal -1(%eax), %edx /* account for the preceeded xadd. */
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
orl $-1, %eax /* Load -1. */
|
orl $-1, %eax /* Load -1. */
|
||||||
#ifndef UP
|
#ifndef UP
|
||||||
@ -109,7 +109,7 @@ __lll_unlock_wake:
|
|||||||
xorl %esi, %esi
|
xorl %esi, %esi
|
||||||
movl %edx, (%ebx) /* Stores '$1'. */
|
movl %edx, (%ebx) /* Stores '$1'. */
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
popl %edx
|
popl %edx
|
||||||
popl %ecx
|
popl %ecx
|
||||||
@ -136,7 +136,7 @@ __lll_timedwait_tid:
|
|||||||
2: movl %esp, %ebx
|
2: movl %esp, %ebx
|
||||||
xorl %ecx, %ecx
|
xorl %ecx, %ecx
|
||||||
movl $SYS_gettimeofday, %eax
|
movl $SYS_gettimeofday, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
/* Compute relative timeout. */
|
/* Compute relative timeout. */
|
||||||
movl 4(%esp), %eax
|
movl 4(%esp), %eax
|
||||||
@ -163,7 +163,7 @@ __lll_timedwait_tid:
|
|||||||
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
||||||
movl %ebp, %ebx
|
movl %ebp, %ebx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
movl %eax, %edx
|
movl %eax, %edx
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ __lll_mutex_lock_wait:
|
|||||||
1:
|
1:
|
||||||
leal 1(%eax), %edx /* account for the preceeded xadd. */
|
leal 1(%eax), %edx /* account for the preceeded xadd. */
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
movl $1, %eax
|
movl $1, %eax
|
||||||
#ifndef UP
|
#ifndef UP
|
||||||
@ -94,7 +94,7 @@ __lll_mutex_timedlock_wait:
|
|||||||
movl %esp, %ebx
|
movl %esp, %ebx
|
||||||
xorl %ecx, %ecx
|
xorl %ecx, %ecx
|
||||||
movl $SYS_gettimeofday, %eax
|
movl $SYS_gettimeofday, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
/* Compute relative timeout. */
|
/* Compute relative timeout. */
|
||||||
movl 4(%esp), %eax
|
movl 4(%esp), %eax
|
||||||
@ -118,7 +118,7 @@ __lll_mutex_timedlock_wait:
|
|||||||
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
||||||
movl %ebp, %ebx
|
movl %ebp, %ebx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
movl $1, %esi
|
movl $1, %esi
|
||||||
#ifndef UP
|
#ifndef UP
|
||||||
@ -170,7 +170,7 @@ __lll_mutex_unlock_wake:
|
|||||||
movl $0, (%ebx)
|
movl $0, (%ebx)
|
||||||
movl $1, %edx /* Wake one thread. */
|
movl $1, %edx /* Wake one thread. */
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
popl %edx
|
popl %edx
|
||||||
popl %ecx
|
popl %ecx
|
||||||
|
@ -63,7 +63,7 @@ __lll_cond_wait:
|
|||||||
|
|
||||||
3: xorl %ecx, %ecx
|
3: xorl %ecx, %ecx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
movl $1, %eax
|
movl $1, %eax
|
||||||
LOCK
|
LOCK
|
||||||
@ -121,7 +121,7 @@ __lll_cond_timedwait:
|
|||||||
7: movl %esp, %ebx
|
7: movl %esp, %ebx
|
||||||
xorl %ecx, %ecx
|
xorl %ecx, %ecx
|
||||||
movl $SYS_gettimeofday, %eax
|
movl $SYS_gettimeofday, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
/* Compute relative timeout. */
|
/* Compute relative timeout. */
|
||||||
movl 4(%esp), %eax
|
movl 4(%esp), %eax
|
||||||
@ -144,7 +144,7 @@ __lll_cond_timedwait:
|
|||||||
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
||||||
movl %ebp, %ebx
|
movl %ebp, %ebx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
movl %eax, %edx
|
movl %eax, %edx
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ __lll_cond_wake:
|
|||||||
xorl %esi, %esi
|
xorl %esi, %esi
|
||||||
movl %ecx, %edx /* movl $1, %edx */
|
movl %ecx, %edx /* movl $1, %edx */
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
3: LOCK
|
3: LOCK
|
||||||
decl cond_lock-cond_nr_wakers(%ebx)
|
decl cond_lock-cond_nr_wakers(%ebx)
|
||||||
@ -260,7 +260,7 @@ __lll_cond_broadcast:
|
|||||||
6: movl $FUTEX_WAKE, %ecx
|
6: movl $FUTEX_WAKE, %ecx
|
||||||
xorl %esi, %esi
|
xorl %esi, %esi
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
3: LOCK
|
3: LOCK
|
||||||
decl cond_lock-cond_nr_wakers(%ebx)
|
decl cond_lock-cond_nr_wakers(%ebx)
|
||||||
|
@ -50,7 +50,7 @@ __lll_lock_wait:
|
|||||||
1:
|
1:
|
||||||
leal -1(%eax), %edx /* account for the preceeded xadd. */
|
leal -1(%eax), %edx /* account for the preceeded xadd. */
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
orl $-1, %eax /* Load -1. */
|
orl $-1, %eax /* Load -1. */
|
||||||
LOCK
|
LOCK
|
||||||
@ -104,7 +104,7 @@ __lll_unlock_wake:
|
|||||||
xorl %esi, %esi
|
xorl %esi, %esi
|
||||||
movl %edx, (%ebx) /* Stores '$1'. */
|
movl %edx, (%ebx) /* Stores '$1'. */
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
popl %edx
|
popl %edx
|
||||||
popl %ecx
|
popl %ecx
|
||||||
@ -131,7 +131,7 @@ __lll_timedwait_tid:
|
|||||||
2: movl %esp, %ebx
|
2: movl %esp, %ebx
|
||||||
xorl %ecx, %ecx
|
xorl %ecx, %ecx
|
||||||
movl $SYS_gettimeofday, %eax
|
movl $SYS_gettimeofday, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
/* Compute relative timeout. */
|
/* Compute relative timeout. */
|
||||||
movl 4(%esp), %eax
|
movl 4(%esp), %eax
|
||||||
@ -158,7 +158,7 @@ __lll_timedwait_tid:
|
|||||||
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
||||||
movl %ebp, %ebx
|
movl %ebp, %ebx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
movl %eax, %edx
|
movl %eax, %edx
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ __lll_mutex_lock_wait:
|
|||||||
1:
|
1:
|
||||||
leal 1(%eax), %edx /* account for the preceeded xadd. */
|
leal 1(%eax), %edx /* account for the preceeded xadd. */
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
movl $1, %eax
|
movl $1, %eax
|
||||||
LOCK
|
LOCK
|
||||||
@ -95,7 +95,7 @@ __lll_mutex_timedlock_wait:
|
|||||||
movl %esp, %ebx
|
movl %esp, %ebx
|
||||||
xorl %ecx, %ecx
|
xorl %ecx, %ecx
|
||||||
movl $SYS_gettimeofday, %eax
|
movl $SYS_gettimeofday, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
/* Compute relative timeout. */
|
/* Compute relative timeout. */
|
||||||
movl 4(%esp), %eax
|
movl 4(%esp), %eax
|
||||||
@ -119,7 +119,7 @@ __lll_mutex_timedlock_wait:
|
|||||||
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
|
||||||
movl %ebp, %ebx
|
movl %ebp, %ebx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
movl $1, %esi
|
movl $1, %esi
|
||||||
LOCK
|
LOCK
|
||||||
@ -166,7 +166,7 @@ __lll_mutex_unlock_wake:
|
|||||||
movl $0, (%ebx)
|
movl $0, (%ebx)
|
||||||
movl $1, %edx /* Wake one thread. */
|
movl $1, %edx /* Wake one thread. */
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
popl %edx
|
popl %edx
|
||||||
popl %ecx
|
popl %ecx
|
||||||
|
@ -83,7 +83,7 @@ __pthread_rwlock_rdlock:
|
|||||||
11: addl $READERS_WAKEUP-MUTEX, %ebx
|
11: addl $READERS_WAKEUP-MUTEX, %ebx
|
||||||
movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
|
movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
subl $READERS_WAKEUP-MUTEX, %ebx
|
subl $READERS_WAKEUP-MUTEX, %ebx
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ pthread_rwlock_timedrdlock:
|
|||||||
movl %esp, %ebx
|
movl %esp, %ebx
|
||||||
xorl %ecx, %ecx
|
xorl %ecx, %ecx
|
||||||
movl $SYS_gettimeofday, %eax
|
movl $SYS_gettimeofday, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
/* Compute relative timeout. */
|
/* Compute relative timeout. */
|
||||||
movl 4(%esp), %eax
|
movl 4(%esp), %eax
|
||||||
@ -212,7 +212,7 @@ pthread_rwlock_timedrdlock:
|
|||||||
movl %ecx, %edx
|
movl %ecx, %edx
|
||||||
leal READERS_WAKEUP(%ebp), %ebx
|
leal READERS_WAKEUP(%ebp), %ebx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
movl %eax, %edx
|
movl %eax, %edx
|
||||||
17:
|
17:
|
||||||
|
|
||||||
@ -320,7 +320,7 @@ __pthread_rwlock_wrlock:
|
|||||||
11: addl $WRITERS_WAKEUP-MUTEX, %ebx
|
11: addl $WRITERS_WAKEUP-MUTEX, %ebx
|
||||||
movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
|
movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
subl $WRITERS_WAKEUP-MUTEX, %ebx
|
subl $WRITERS_WAKEUP-MUTEX, %ebx
|
||||||
|
|
||||||
@ -415,7 +415,7 @@ pthread_rwlock_timedwrlock:
|
|||||||
movl %esp, %ebx
|
movl %esp, %ebx
|
||||||
xorl %ecx, %ecx
|
xorl %ecx, %ecx
|
||||||
movl $SYS_gettimeofday, %eax
|
movl $SYS_gettimeofday, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
/* Compute relative timeout. */
|
/* Compute relative timeout. */
|
||||||
movl 4(%esp), %eax
|
movl 4(%esp), %eax
|
||||||
@ -439,7 +439,7 @@ pthread_rwlock_timedwrlock:
|
|||||||
movl %ecx, %edx
|
movl %ecx, %edx
|
||||||
leal WRITERS_WAKEUP(%ebp), %ebx
|
leal WRITERS_WAKEUP(%ebp), %ebx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
movl %eax, %edx
|
movl %eax, %edx
|
||||||
17:
|
17:
|
||||||
|
|
||||||
@ -547,7 +547,7 @@ __pthread_rwlock_unlock:
|
|||||||
0:
|
0:
|
||||||
#endif
|
#endif
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
6: LOCK
|
6: LOCK
|
||||||
decl MUTEX(%edi)
|
decl MUTEX(%edi)
|
||||||
|
@ -66,7 +66,7 @@ __new_sem_wait:
|
|||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
movl %esi, %ecx
|
movl %esi, %ecx
|
||||||
movl %esi, %edx
|
movl %esi, %edx
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
testl %eax, %eax
|
testl %eax, %eax
|
||||||
je 3b
|
je 3b
|
||||||
@ -171,7 +171,7 @@ sem_timedwait:
|
|||||||
movl %esp, %ebx
|
movl %esp, %ebx
|
||||||
movl %ecx, %edx
|
movl %ecx, %edx
|
||||||
movl $SYS_gettimeofday, %eax
|
movl $SYS_gettimeofday, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
/* Compute relative timeout. */
|
/* Compute relative timeout. */
|
||||||
movl 4(%esp), %eax
|
movl 4(%esp), %eax
|
||||||
@ -194,7 +194,7 @@ sem_timedwait:
|
|||||||
xorl %ecx, %ecx
|
xorl %ecx, %ecx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
xorl %edx, %edx
|
xorl %edx, %edx
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
testl %eax, %eax
|
testl %eax, %eax
|
||||||
je,pt 9f
|
je,pt 9f
|
||||||
@ -255,7 +255,7 @@ __new_sem_post:
|
|||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
movl $FUTEX_WAKE, %ecx
|
movl $FUTEX_WAKE, %ecx
|
||||||
incl %edx
|
incl %edx
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
testl %eax, %eax
|
testl %eax, %eax
|
||||||
js 1f
|
js 1f
|
||||||
|
@ -70,7 +70,7 @@ pthread_barrier_wait:
|
|||||||
if the CURR_EVENT memory has meanwhile been changed. */
|
if the CURR_EVENT memory has meanwhile been changed. */
|
||||||
7: movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
|
7: movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
|
||||||
8: movl $SYS_futex, %eax
|
8: movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
/* Don't return on spurious wakeups. The syscall does not change
|
/* Don't return on spurious wakeups. The syscall does not change
|
||||||
any register except %eax so there is no need to reload any of
|
any register except %eax so there is no need to reload any of
|
||||||
@ -95,7 +95,7 @@ pthread_barrier_wait:
|
|||||||
movl $0x7fffffff, %edx
|
movl $0x7fffffff, %edx
|
||||||
movl $FUTEX_WAKE, %ecx
|
movl $FUTEX_WAKE, %ecx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
/* Release the mutex. */
|
/* Release the mutex. */
|
||||||
LOCK
|
LOCK
|
||||||
|
@ -257,6 +257,17 @@ extern int __libc_locking_needed attribute_hidden;
|
|||||||
# define LLL_TID_EBX_LOAD
|
# define LLL_TID_EBX_LOAD
|
||||||
# define LLL_TID_EBX_REG "b"
|
# define LLL_TID_EBX_REG "b"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef I386_USE_SYSENTER
|
||||||
|
# ifdef SHARED
|
||||||
|
# define LLL_TID_ENTER_KERNEL "call *%%gs:%P6\n\t"
|
||||||
|
# else
|
||||||
|
# define LLL_TID_ENTER_KERNEL "call *_dl_sysinfo\n\t"
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# define LLL_TID_ENTER_KERNEL "int $0x80\n\t"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define lll_wait_tid(tid) \
|
#define lll_wait_tid(tid) \
|
||||||
do { \
|
do { \
|
||||||
int __ignore; \
|
int __ignore; \
|
||||||
@ -264,13 +275,14 @@ extern int __libc_locking_needed attribute_hidden;
|
|||||||
if (_tid != 0) \
|
if (_tid != 0) \
|
||||||
__asm __volatile (LLL_TID_EBX_LOAD \
|
__asm __volatile (LLL_TID_EBX_LOAD \
|
||||||
"1:\tmovl %1, %%eax\n\t" \
|
"1:\tmovl %1, %%eax\n\t" \
|
||||||
"int $0x80\n\t" \
|
LLL_TID_ENTER_KERNEL \
|
||||||
"cmpl $0, (%%ebx)\n\t" \
|
"cmpl $0, (%%ebx)\n\t" \
|
||||||
"jne,pn 1b\n\t" \
|
"jne,pn 1b\n\t" \
|
||||||
LLL_TID_EBX_LOAD \
|
LLL_TID_EBX_LOAD \
|
||||||
: "=&a" (__ignore) \
|
: "=&a" (__ignore) \
|
||||||
: "i" (SYS_futex), LLL_TID_EBX_REG (&tid), "S" (0), \
|
: "i" (SYS_futex), LLL_TID_EBX_REG (&tid), "S" (0), \
|
||||||
"c" (FUTEX_WAIT), "d" (_tid)); \
|
"c" (FUTEX_WAIT), "d" (_tid), \
|
||||||
|
"i" (offsetof (tcbhead_t, sysinfo))); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
extern int __lll_timedwait_tid (int *tid, const struct timespec *abstime)
|
extern int __lll_timedwait_tid (int *tid, const struct timespec *abstime)
|
||||||
@ -293,11 +305,12 @@ extern int __lll_timedwait_tid (int *tid, const struct timespec *abstime)
|
|||||||
int __ignore; \
|
int __ignore; \
|
||||||
(tid) = 0; \
|
(tid) = 0; \
|
||||||
__asm __volatile (LLL_TID_EBX_LOAD \
|
__asm __volatile (LLL_TID_EBX_LOAD \
|
||||||
"\tint $0x80\n\t" \
|
LLL_TID_ENTER_KERNEL \
|
||||||
LLL_TID_EBX_LOAD \
|
LLL_TID_EBX_LOAD \
|
||||||
: "=a" (__ignore) \
|
: "=a" (__ignore) \
|
||||||
: "0" (SYS_futex), LLL_TID_EBX_REG (&(tid)), "S" (0), \
|
: "0" (SYS_futex), LLL_TID_EBX_REG (&(tid)), "S" (0), \
|
||||||
"c" (FUTEX_WAKE), "d" (0x7fffffff)); \
|
"c" (FUTEX_WAKE), "d" (0x7fffffff) \
|
||||||
|
"i" (offsetof (tcbhead_t, sysinfo))); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,6 +20,9 @@
|
|||||||
#ifndef _LOWLEVELSEM_H
|
#ifndef _LOWLEVELSEM_H
|
||||||
#define _LOWLEVELSEM_H 1
|
#define _LOWLEVELSEM_H 1
|
||||||
|
|
||||||
|
#include <dl-sysdep.h>
|
||||||
|
#include <tls.h>
|
||||||
|
|
||||||
#ifndef LOCK
|
#ifndef LOCK
|
||||||
# ifdef UP
|
# ifdef UP
|
||||||
# define LOCK /* nothing */
|
# define LOCK /* nothing */
|
||||||
@ -31,6 +34,16 @@
|
|||||||
#define SYS_futex 240
|
#define SYS_futex 240
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef I386_USE_SYSENTER
|
||||||
|
# ifdef SHARED
|
||||||
|
# define LLL_SEM_ENTER_KERNEL(arg) "call *%%gs:%P" #arg "\n\t"
|
||||||
|
# else
|
||||||
|
# define LLL_SEM_ENTER_KERNEL(arg) "call *_dl_sysinfo\n\t"
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# define LLL_SEM_ENTER_KERNEL(arg) "int $0x80\n\t"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define lll_sem_wait(sem) \
|
#define lll_sem_wait(sem) \
|
||||||
({ int result, ignore1, ignore2; \
|
({ int result, ignore1, ignore2; \
|
||||||
__asm __volatile ("1:\tincl 8(%4)\n\t" \
|
__asm __volatile ("1:\tincl 8(%4)\n\t" \
|
||||||
@ -46,7 +59,7 @@
|
|||||||
"movl %%esi, %%edx\n\t" \
|
"movl %%esi, %%edx\n\t" \
|
||||||
"leal 4(%4), %%ebx\n\t" \
|
"leal 4(%4), %%ebx\n\t" \
|
||||||
"movl %5, %%eax\n\t" \
|
"movl %5, %%eax\n\t" \
|
||||||
"int $0x80\n\t" \
|
LLL_SEM_ENTER_KERNEL (9) \
|
||||||
"movl %%eax, %%edx\n\t" \
|
"movl %%eax, %%edx\n\t" \
|
||||||
"popl %%ebx\n\t" \
|
"popl %%ebx\n\t" \
|
||||||
"orl $-1, %%eax\n\t" \
|
"orl $-1, %%eax\n\t" \
|
||||||
@ -68,7 +81,8 @@
|
|||||||
: "=a" (result), "=c" (ignore1), "=d" (ignore2), \
|
: "=a" (result), "=c" (ignore1), "=d" (ignore2), \
|
||||||
"=m" (*sem) \
|
"=m" (*sem) \
|
||||||
: "D" (sem), "i" (SYS_futex), "S" (0), \
|
: "D" (sem), "i" (SYS_futex), "S" (0), \
|
||||||
"i" (-EINTR), "i" (EINTR)); \
|
"i" (-EINTR), "i" (EINTR), \
|
||||||
|
"i" (offsetof (tcbhead_t, sysinfo))); \
|
||||||
result; })
|
result; })
|
||||||
|
|
||||||
|
|
||||||
@ -91,11 +105,12 @@ extern int __lll_sem_timedwait (struct sem *sem, const struct timespec *ts)
|
|||||||
"movl %5, %%eax\n\t" \
|
"movl %5, %%eax\n\t" \
|
||||||
/* movl $FUTEX_WAKE, %ecx */ \
|
/* movl $FUTEX_WAKE, %ecx */ \
|
||||||
"movl $1, %%ecx\n\t" \
|
"movl $1, %%ecx\n\t" \
|
||||||
"int $0x80\n\t" \
|
LLL_SEM_ENTER_KERNEL (6) \
|
||||||
"popl %%ebx\n\t" \
|
"popl %%ebx\n\t" \
|
||||||
"popl %%esi" \
|
"popl %%esi" \
|
||||||
: "=&a" (ignore1), "=c" (ignore2), \
|
: "=&a" (ignore1), "=c" (ignore2), \
|
||||||
"=m" (*sem), "=d" (ignore3) \
|
"=m" (*sem), "=d" (ignore3) \
|
||||||
: "r" (sem), "i" (SYS_futex)); })
|
: "r" (sem), "i" (SYS_futex), \
|
||||||
|
"i" (offsetof (tcbhead_t, sysinfo))); })
|
||||||
|
|
||||||
#endif /* lowlevelsem.h */
|
#endif /* lowlevelsem.h */
|
||||||
|
@ -86,7 +86,7 @@ __pthread_once:
|
|||||||
/* Somebody else got here first. Wait. */
|
/* Somebody else got here first. Wait. */
|
||||||
movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
|
movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
jmp 6b
|
jmp 6b
|
||||||
|
|
||||||
3: /* Call the initializer function after setting up the
|
3: /* Call the initializer function after setting up the
|
||||||
@ -125,7 +125,7 @@ __pthread_once:
|
|||||||
movl $0x7fffffff, %edx
|
movl $0x7fffffff, %edx
|
||||||
movl $FUTEX_WAKE, %ecx
|
movl $FUTEX_WAKE, %ecx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
4: popl %esi
|
4: popl %esi
|
||||||
popl %ebx
|
popl %ebx
|
||||||
@ -154,7 +154,7 @@ clear_once_control:
|
|||||||
movl $0x7fffffff, %edx
|
movl $0x7fffffff, %edx
|
||||||
movl $FUTEX_WAKE, %ecx
|
movl $FUTEX_WAKE, %ecx
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
|
|
||||||
popl %ebx
|
popl %ebx
|
||||||
popl %esi
|
popl %esi
|
||||||
|
@ -27,11 +27,13 @@ _exit:
|
|||||||
/* Try the new syscall first. */
|
/* Try the new syscall first. */
|
||||||
#ifdef __NR_exit_group
|
#ifdef __NR_exit_group
|
||||||
movl $__NR_exit_group, %eax
|
movl $__NR_exit_group, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Not available. Now the old one. */
|
/* Not available. Now the old one. */
|
||||||
movl $__NR_exit, %eax
|
movl $__NR_exit, %eax
|
||||||
|
/* Don't bother using ENTER_KERNEL here. If the exit_group
|
||||||
|
syscall is not available AT_SYSINFO isn't either. */
|
||||||
int $0x80
|
int $0x80
|
||||||
|
|
||||||
/* This must not fail. Be sure we don't return. */
|
/* This must not fail. Be sure we don't return. */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Save current context.
|
/* Save current context.
|
||||||
Copyright (C) 2001 Free Software Foundation, Inc.
|
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ ENTRY(__getcontext)
|
|||||||
xorl %ecx, %ecx
|
xorl %ecx, %ecx
|
||||||
movl $SIG_BLOCK, %ebx
|
movl $SIG_BLOCK, %ebx
|
||||||
movl $__NR_sigprocmask, %eax
|
movl $__NR_sigprocmask, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
popl %ebx
|
popl %ebx
|
||||||
cmpl $-4095, %eax /* Check %eax for error. */
|
cmpl $-4095, %eax /* Check %eax for error. */
|
||||||
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
|
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Install given context.
|
/* Install given context.
|
||||||
Copyright (C) 2001 Free Software Foundation, Inc.
|
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ ENTRY(__setcontext)
|
|||||||
leal oSIGMASK(%eax), %ecx
|
leal oSIGMASK(%eax), %ecx
|
||||||
movl $SIG_SETMASK, %ebx
|
movl $SIG_SETMASK, %ebx
|
||||||
movl $__NR_sigprocmask, %eax
|
movl $__NR_sigprocmask, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
popl %ebx
|
popl %ebx
|
||||||
cmpl $-4095, %eax /* Check %eax for error. */
|
cmpl $-4095, %eax /* Check %eax for error. */
|
||||||
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
|
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Save current context and install the given one.
|
/* Save current context and install the given one.
|
||||||
Copyright (C) 2001 Free Software Foundation, Inc.
|
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ ENTRY(__swapcontext)
|
|||||||
leal oSIGMASK(%ecx), %ecx
|
leal oSIGMASK(%ecx), %ecx
|
||||||
movl $SIG_SETMASK, %ebx
|
movl $SIG_SETMASK, %ebx
|
||||||
movl $__NR_sigprocmask, %eax
|
movl $__NR_sigprocmask, %eax
|
||||||
int $0x80
|
ENTER_KERNEL
|
||||||
popl %ebx
|
popl %ebx
|
||||||
cmpl $-4095, %eax /* Check %eax for error. */
|
cmpl $-4095, %eax /* Check %eax for error. */
|
||||||
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
|
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
|
||||||
|
Reference in New Issue
Block a user