Cleanup: Move wrapper/ headers to include/wrapper/
[lttng-modules.git] / include / wrapper / atomic.h
diff --git a/include/wrapper/atomic.h b/include/wrapper/atomic.h
new file mode 100644 (file)
index 0000000..cc7c64c
--- /dev/null
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
+ *
+ * wrapper/atomic.h
+ *
+ * wrapper around linux/atomic.h.
+ *
+ * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#ifndef _LTTNG_WRAPPER_ATOMIC_H
+#define _LTTNG_WRAPPER_ATOMIC_H
+
+#include <linux/version.h>
+#include <linux/atomic.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
+static inline void lttng_smp_mb__before_atomic(void)
+{
+       smp_mb__before_atomic();
+}
+
+static inline void lttng_smp_mb__after_atomic(void)
+{
+       smp_mb__after_atomic();
+}
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
+static inline void lttng_smp_mb__before_atomic(void)
+{
+       smp_mb__before_atomic_inc();
+}
+
+static inline void lttng_smp_mb__after_atomic(void)
+{
+       smp_mb__after_atomic_inc();
+}
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
+
+#endif /* _LTTNG_WRAPPER_ATOMIC_H */
This page took 0.025268 seconds and 4 git commands to generate.