diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2007-11-13 04:05:31 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2007-11-13 04:05:31 +0000 |
commit | 5efcf07228a4532074784c85689dddcbb6b56c77 (patch) | |
tree | 5991b8c3ee489b7c34221390007e3bd67a689d41 /libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h | |
parent | 18b48698abe6cf957ec6ee5fa921b1a12f9bf914 (diff) | |
download | uClibc-alpine-5efcf07228a4532074784c85689dddcbb6b56c77.tar.bz2 uClibc-alpine-5efcf07228a4532074784c85689dddcbb6b56c77.tar.xz |
Begin merging of SuperH NPTL port. See the mailing list for further information.
Diffstat (limited to 'libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h')
-rw-r--r-- | libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h index d9376d45a..05040808d 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h @@ -19,11 +19,11 @@ #ifndef _LOWLEVELLOCK_H #define _LOWLEVELLOCK_H 1 +#include <syscall.h> #include <time.h> #include <sys/param.h> #include <bits/pthreadtypes.h> -#define SYS_futex 240 #define FUTEX_WAIT 0 #define FUTEX_WAKE 1 @@ -195,6 +195,22 @@ typedef int lll_lock_t; : "memory", "t"); \ } while (0) +#define lll_futex_timed_wait(futex, val, timeout) \ + ({ \ + int __status; \ + register unsigned long __r3 asm ("r3") = SYS_futex; \ + register unsigned long __r4 asm ("r4") = (unsigned long) (futex); \ + register unsigned long __r5 asm ("r5") = FUTEX_WAIT; \ + register unsigned long __r6 asm ("r6") = (unsigned long) (val); \ + register unsigned long __r7 asm ("r7") = (timeout); \ + __asm __volatile (SYSCALL_WITH_INST_PAD \ + : "=z" (__status) \ + : "r" (__r3), "r" (__r4), "r" (__r5), \ + "r" (__r6), "r" (__r7) \ + : "memory", "t"); \ + __status; \ + }) + #define lll_futex_wake(futex, nr) \ do { \ |