From bb3caa357705844d03a633e2d1108e349a929068 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 28 May 2015 15:59:17 +0200 Subject: [PATCH] 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 --- libgomp/ChangeLog | 13 ++++++++---- libgomp/config/linux/x86/futex.h | 36 +++++++++++++++++++------------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index a1ea09933fa..d12d7bae22d 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,9 @@ +2015-05-28 Uros Bizjak + + * 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. + 2015-05-28 Julian Brown * oacc-init.c (resolve_device): Add FAIL_IS_ERROR argument. Update @@ -6,14 +12,14 @@ (acc_init_1, acc_shutdown_1): Update call to resolve_device. Call acc_dev_num_out_of_range as appropriate. (acc_get_num_devices, acc_set_device_type, acc_get_device_type) - (acc_get_device_num, acc_set_device_num): Update calls to resolve_device. + (acc_get_device_num, acc_set_device_num): Update calls to + resolve_device. * testsuite/libgomp.oacc-c-c++-common/lib-4.c: Update expected test output. 2015-05-28 Julian Brown PR libgomp/65742 - * oacc-init.c (plugin/plugin-host.h): Include. (acc_on_device): Check whether we're in an offloaded region for host_nonshm @@ -40,8 +46,7 @@ 2015-05-27 Uros Bizjak - * config/linux/x86/futex.h (sys_futex0) [__PIC__]: Remove - sys_futex0 function. + * config/linux/x86/futex.h (sys_futex0) [__PIC__]: Remove function. 2015-05-27 Chung-Lin Tang diff --git a/libgomp/config/linux/x86/futex.h b/libgomp/config/linux/x86/futex.h index 2592217a890..0fe50e851cc 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 -- 2.30.2