Cleanup: Move instrumentation/ headers to include/instrumentation/
[lttng-modules.git] / wrapper / atomic.h
CommitLineData
b7cdc182 1/* SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
9f36eaed 2 *
505fb410
MD
3 * wrapper/atomic.h
4 *
5 * wrapper around linux/atomic.h.
6 *
7 * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
505fb410
MD
8 */
9
9f36eaed
MJ
10#ifndef _LTTNG_WRAPPER_ATOMIC_H
11#define _LTTNG_WRAPPER_ATOMIC_H
12
505fb410
MD
13#include <linux/version.h>
14#include <linux/atomic.h>
15
16#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
17static inline void lttng_smp_mb__before_atomic(void)
18{
19 smp_mb__before_atomic();
20}
21
22static 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)) */
27static inline void lttng_smp_mb__before_atomic(void)
28{
29 smp_mb__before_atomic_inc();
30}
31
32static 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.032758 seconds and 4 git commands to generate.