summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f541831)
Now that the membarrier system call is allocated on x86 32/64, allocate
its number in our architecture header if the system headers don't
allocate it. This allows using the membarrier system call as soon as
implemented in the kernel, even if the distribution has old kernel
headers.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 files changed:
#include <unistd.h>
#include <sys/mman.h>
#include <unistd.h>
#include <sys/mman.h>
#include "urcu/wfcqueue.h"
#include "urcu/map/urcu-bp.h"
#include "urcu/static/urcu-bp.h"
#include "urcu/wfcqueue.h"
#include "urcu/map/urcu-bp.h"
#include "urcu/static/urcu-bp.h"
static
int rcu_bp_refcount;
static
int rcu_bp_refcount;
-/*
- * RCU_MEMBARRIER is only possibly available on Linux.
- */
-#ifdef __linux__
-#include <urcu/syscall-compat.h>
-#endif
-
-/* If the headers do not support SYS_membarrier, fall back on RCU_MB */
-#ifdef SYS_membarrier
-# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__)
+/* If the headers do not support membarrier system call, fall back smp_mb. */
+#ifdef __NR_membarrier
+# define membarrier(...) syscall(__NR_membarrier, __VA_ARGS__)
#else
# define membarrier(...) -ENOSYS
#endif
#else
# define membarrier(...) -ENOSYS
#endif
#include <errno.h>
#include <poll.h>
#include <errno.h>
#include <poll.h>
#include "urcu/wfcqueue.h"
#include "urcu/map/urcu.h"
#include "urcu/static/urcu.h"
#include "urcu/wfcqueue.h"
#include "urcu/map/urcu.h"
#include "urcu/static/urcu.h"
*/
#define RCU_QS_ACTIVE_ATTEMPTS 100
*/
#define RCU_QS_ACTIVE_ATTEMPTS 100
-/*
- * RCU_MEMBARRIER is only possibly available on Linux.
- */
-#if defined(RCU_MEMBARRIER) && defined(__linux__)
-#include <urcu/syscall-compat.h>
-#endif
-
-/* If the headers do not support SYS_membarrier, fall back on RCU_MB */
-#ifdef SYS_membarrier
-# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__)
+/* If the headers do not support membarrier system call, fall back on RCU_MB */
+#ifdef __NR_membarrier
+# define membarrier(...) syscall(__NR_membarrier, __VA_ARGS__)
#else
# define membarrier(...) -ENOSYS
#endif
#else
# define membarrier(...) -ENOSYS
#endif
#include <urcu/compiler.h>
#include <urcu/config.h>
#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
#include <urcu/compiler.h>
#include <urcu/config.h>
#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
#include <urcu/compiler.h>
#include <urcu/config.h>
#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
#include <urcu/compiler.h>
#include <urcu/config.h>
#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
#include <urcu/compiler.h>
#include <urcu/config.h>
#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
#include <urcu/compiler.h>
#include <urcu/config.h>
#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
#include <urcu/compiler.h>
#include <urcu/config.h>
#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
#include <urcu/compiler.h>
#include <urcu/config.h>
#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
#include <urcu/compiler.h>
#include <urcu/config.h>
#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
#include <urcu/compiler.h>
#include <urcu/config.h>
#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
+/*
+ * Define the membarrier system call number if not yet available in the
+ * system headers.
+ */
+#if (CAA_BITS_PER_LONG == 32)
+#ifndef __NR_membarrier
+#define __NR_membarrier 375
+#endif
+#else
+#ifndef __NR_membarrier
+#define __NR_membarrier 324
+#endif
+#endif
+
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
}
#endif
#include <unistd.h>
#include <errno.h>
#include <urcu/compiler.h>
#include <unistd.h>
#include <errno.h>
#include <urcu/compiler.h>
-#include <urcu/syscall-compat.h>
static inline int futex(int32_t *uaddr, int op, int32_t val,
const struct timespec *timeout, int32_t *uaddr2, int32_t val3)
static inline int futex(int32_t *uaddr, int op, int32_t val,
const struct timespec *timeout, int32_t *uaddr2, int32_t val3)