diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-05-09 03:17:42 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-05-09 03:17:42 +0000 |
commit | 92d83c725e09dbc76acfedc1cf85a01f9f54452d (patch) | |
tree | 039357dd8df0ad0c249d28e098e921ff15fb1eb0 /nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h | |
parent | 29b095a1561f866b995b23621d1e2ee78e473dc4 (diff) | |
download | glibc-92d83c725e09dbc76acfedc1cf85a01f9f54452d.tar glibc-92d83c725e09dbc76acfedc1cf85a01f9f54452d.tar.gz glibc-92d83c725e09dbc76acfedc1cf85a01f9f54452d.tar.bz2 glibc-92d83c725e09dbc76acfedc1cf85a01f9f54452d.zip |
Update.
2003-05-08 Ulrich Drepper <drepper@redhat.com>
* malloc/thread-m.h: Remove special handling of thread_atfork if
HAVE_register_atfork_malloc is defined.
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h index e338cfa811..2318edfcdb 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h @@ -41,6 +41,36 @@ #define LLL_MUTEX_LOCK_INITIALIZER (0) +#define LLL_ENTER_KERNEL "int $0x80\n\t" + +#define lll_futex_wait(futex, val) \ + do { \ + int __ignore; \ + register __typeof (val) _val asm ("edx") = (val); \ + __asm __volatile ("xchgl %2, %%ebx\n\t" \ + LLL_ENTER_KERNEL \ + "xchgl %2, %%ebx" \ + : "=a" (__ignore) \ + : "0" (SYS_futex), "D" (&futex), "S" (0), \ + "c" (FUTEX_WAIT), "d" (_val), \ + "i" (offsetof (tcbhead_t, sysinfo))); \ + } while (0) + + +#define lll_futex_wake(futex, nr) \ + do { \ + int __ignore; \ + register __typeof (nr) _nr asm ("edx") = (nr); \ + __asm __volatile ("xchgl %2, %%ebx\n\t" \ + LLL_ENTER_KERNEL \ + "xchgl %2, %%ebx" \ + : "=a" (__ignore) \ + : "0" (SYS_futex), "D" (&futex), "c" (FUTEX_WAKE), \ + "d" (_nr), "i" (0), \ + "i" (offsetof (tcbhead_t, sysinfo))); \ + } while (0) + + /* Does not preserve %eax and %ecx. */ extern int __lll_mutex_lock_wait (int val, int *__futex) __attribute ((regparm (2))) attribute_hidden; |