diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2015-05-28 15:59:17 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2015-05-28 15:59:17 +0200 |
commit | bb3caa357705844d03a633e2d1108e349a929068 (patch) | |
tree | cedae58782a74267ac41796b7776e68cc7b4f703 /libgomp/config/linux | |
parent | de0e921c9df40eb12823ae1b68c271e73507b280 (diff) | |
download | gcc-bb3caa357705844d03a633e2d1108e349a929068.zip gcc-bb3caa357705844d03a633e2d1108e349a929068.tar.gz gcc-bb3caa357705844d03a633e2d1108e349a929068.tar.bz2 |
futex.h (sys_futex0): Remove function.
* config/linux/x86/futex.h (sys_futex0) [!__x86_64__]: Remove function.
(futex_wait) [!__x86_64__]: Use __asm operand instead of sys_futex0.
(futex_wake) [!__x86_64__]: Ditto.
From-SVN: r223821
Diffstat (limited to 'libgomp/config/linux')
-rw-r--r-- | libgomp/config/linux/x86/futex.h | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/libgomp/config/linux/x86/futex.h b/libgomp/config/linux/x86/futex.h index 2592217..0fe50e8 100644 --- a/libgomp/config/linux/x86/futex.h +++ b/libgomp/config/linux/x86/futex.h @@ -81,43 +81,49 @@ futex_wake (int *addr, int count) # define SYS_futex 240 # endif -static inline long -sys_futex0 (int *addr, int op, int val) +static inline void +futex_wait (int *addr, int val) { long res; __asm volatile ("int $0x80" : "=a" (res) - : "0"(SYS_futex), "b" (addr), "c"(op), - "d"(val), "S"(0) + : "0" (SYS_futex), "b" (addr), "c" (gomp_futex_wait), + "d" (val), "S" (0) : "memory"); - return res; -} - -static inline void -futex_wait (int *addr, int val) -{ - long res = sys_futex0 (addr, gomp_futex_wait, val); if (__builtin_expect (res == -ENOSYS, 0)) { gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; - sys_futex0 (addr, gomp_futex_wait, val); + __asm volatile ("int $0x80" + : "=a" (res) + : "0" (SYS_futex), "b" (addr), "c" (gomp_futex_wait), + "d" (val), "S" (0) + : "memory"); } } static inline void futex_wake (int *addr, int count) { - long res = sys_futex0 (addr, gomp_futex_wake, count); + long res; + + __asm volatile ("int $0x80" + : "=a" (res) + : "0" (SYS_futex), "b" (addr), "c" (gomp_futex_wake), + "d" (count) + : "memory"); if (__builtin_expect (res == -ENOSYS, 0)) { gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; - sys_futex0 (addr, gomp_futex_wake, count); + __asm volatile ("int $0x80" + : "=a" (res) + : "0" (SYS_futex), "b" (addr), "c" (gomp_futex_wake), + "d" (count) + : "memory"); } } - #endif /* __x86_64__ */ static inline void |