1 /* SPDX-License-Identifier: (GPL-2.0 OR LGPL-2.1)
5 * wrapper around linux/atomic.h.
7 * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 #ifndef _LTTNG_WRAPPER_ATOMIC_H
11 #define _LTTNG_WRAPPER_ATOMIC_H
13 #include <linux/version.h>
14 #include <linux/atomic.h>
16 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
17 static inline void lttng_smp_mb__before_atomic(void)
19 smp_mb__before_atomic();
22 static inline void lttng_smp_mb__after_atomic(void)
24 smp_mb__after_atomic();
26 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
27 static inline void lttng_smp_mb__before_atomic(void)
29 smp_mb__before_atomic_inc();
32 static inline void lttng_smp_mb__after_atomic(void)
34 smp_mb__after_atomic_inc();
36 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
38 #endif /* _LTTNG_WRAPPER_ATOMIC_H */
This page took 0.033053 seconds and 4 git commands to generate.