Cleanup: Move wrapper/ headers to include/wrapper/
[lttng-modules.git] / include / wrapper / atomic.h
1 /* SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
2 *
3 * wrapper/atomic.h
4 *
5 * wrapper around linux/atomic.h.
6 *
7 * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 */
9
10 #ifndef _LTTNG_WRAPPER_ATOMIC_H
11 #define _LTTNG_WRAPPER_ATOMIC_H
12
13 #include <linux/version.h>
14 #include <linux/atomic.h>
15
16 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
17 static inline void lttng_smp_mb__before_atomic(void)
18 {
19 smp_mb__before_atomic();
20 }
21
22 static inline void lttng_smp_mb__after_atomic(void)
23 {
24 smp_mb__after_atomic();
25 }
26 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
27 static inline void lttng_smp_mb__before_atomic(void)
28 {
29 smp_mb__before_atomic_inc();
30 }
31
32 static inline void lttng_smp_mb__after_atomic(void)
33 {
34 smp_mb__after_atomic_inc();
35 }
36 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
37
38 #endif /* _LTTNG_WRAPPER_ATOMIC_H */
This page took 0.033598 seconds and 4 git commands to generate.