#include <urcu/compiler.h>
#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
#ifdef __cplusplus
extern "C" {
-#endif
+#endif
#ifdef CONFIG_RCU_ARM_HAVE_DMB
-#define cmm_mb() asm volatile("dmb":::"memory")
-#define cmm_rmb() asm volatile("dmb":::"memory")
-#define cmm_wmb() asm volatile("dmb":::"memory")
+#define cmm_mb() __asm__ __volatile__ ("dmb":::"memory")
+#define cmm_rmb() __asm__ __volatile__ ("dmb":::"memory")
+#define cmm_wmb() __asm__ __volatile__ ("dmb":::"memory")
#endif /* CONFIG_RCU_ARM_HAVE_DMB */
#include <stdlib.h>
#include <sys/time.h>
-typedef unsigned long long cycles_t;
-
-static inline cycles_t caa_get_cycles (void)
-{
- cycles_t thetime;
- struct timeval tv;
-
- if (gettimeofday(&tv, NULL) != 0)
- return 0;
- thetime = ((cycles_t)tv.tv_sec) * 1000000ULL + ((cycles_t)tv.tv_usec);
- return (cycles_t)thetime;
-}
+/*
+ * Define the membarrier system call number if not yet available in the
+ * system headers.
+ */
+#ifndef __NR_membarrier
+#define __NR_membarrier 389
+#endif
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif