diff options
Diffstat (limited to 'src/xshmfenceint.h')
-rw-r--r-- | src/xshmfenceint.h | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/src/xshmfenceint.h b/src/xshmfenceint.h index 66862d0..3452a55 100644 --- a/src/xshmfenceint.h +++ b/src/xshmfenceint.h @@ -23,50 +23,10 @@ #ifndef _XSHMFENCEINT_H_ #define _XSHMFENCEINT_H_ -#include <stdint.h> -#include <stdio.h> -#include <stddef.h> #include <stdlib.h> -#include <linux/futex.h> -#include <sys/time.h> #include <unistd.h> -#include <sys/syscall.h> #include <sys/mman.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <errno.h> -#include <values.h> #include "xshmfence.h" +#include "xshmfence_futex.h" -static inline long sys_futex(void *addr1, int op, int val1, struct timespec *timeout, void *addr2, int val3) -{ - return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3); -} - -static inline int futex_wake(int32_t *addr) { - return sys_futex(addr, FUTEX_WAKE, MAXINT, NULL, NULL, 0); -} - -static inline int futex_wait(int32_t *addr, int32_t value) { - return sys_futex(addr, FUTEX_WAIT, value, NULL, NULL, 0); -} - -#define barrier() __asm__ __volatile__("": : :"memory") - -static inline void atomic_store(int32_t *f, int32_t v) -{ - barrier(); - *f = v; - barrier(); -} - -static inline int32_t atomic_fetch(int32_t *a) -{ - int32_t v; - barrier(); - v = *a; - barrier(); - return v; -} - #endif /* _XSHMFENCEINT_H_ */ |