1 /* SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
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 <lttng/kernel-version.h>
14 #include <linux/atomic.h>
16 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_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 (LTTNG_LINUX_VERSION_CODE >= LTTNG_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 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0)) */
38 #endif /* _LTTNG_WRAPPER_ATOMIC_H */
This page took 0.034863 seconds and 4 git commands to generate.