#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
-#endif
+#endif
+
+/*
+ * On Linux, define the membarrier system call number if not yet available in
+ * the system headers.
+ */
+#if (defined(__linux__) && !defined(__NR_membarrier))
+#define __NR_membarrier 351
+#endif
#define CAA_CACHE_LINE_SIZE 256
#define cmm_rmb() membar_safe("#LoadLoad")
#define cmm_wmb() membar_safe("#StoreStore")
-typedef unsigned long long cycles_t;
-
-static inline cycles_t caa_get_cycles (void)
-{
- return 0; /* unimplemented */
-}
-
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif