#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
-#endif
+#endif
#define CAA_CACHE_LINE_SIZE 128
#define caa_cpu_relax() __asm__ __volatile__ ("rep; nop" : : : "memory")
+#define HAS_CAA_GET_CYCLES
+
#define rdtscll(val) \
do { \
unsigned int __a, __d; \
return ret;
}
-#ifdef __cplusplus
+/*
+ * 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