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 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
15 #include <linux/atomic.h>
17 #include <asm/atomic.h>
20 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
21 static inline void lttng_smp_mb__before_atomic(void)
23 smp_mb__before_atomic();
26 static inline void lttng_smp_mb__after_atomic(void)
28 smp_mb__after_atomic();
30 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
31 static inline void lttng_smp_mb__before_atomic(void)
33 smp_mb__before_atomic_inc();
36 static inline void lttng_smp_mb__after_atomic(void)
38 smp_mb__after_atomic_inc();
40 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
42 #endif /* _LTTNG_WRAPPER_ATOMIC_H */
This page took 0.032596 seconds and 4 git commands to generate.