1 /* SPDX-License-Identifier: GPL-2.0-only
5 * wrapper around asm/barrier.h.
7 * Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 #ifndef _LTTNG_WRAPPER_BARRIER_H
11 #define _LTTNG_WRAPPER_BARRIER_H
13 #include <lttng/kernel-version.h>
14 #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)
15 #include <asm/barrier.h>
17 #include <asm/system.h>
20 #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)
22 #define lttng_smp_store_release(x, v) smp_store_release(x, v)
23 #define lttng_smp_load_acquire(x) smp_load_acquire(x)
28 * Acquire-release semantics act as a one-way permeable barrier when
29 * pairing a store with a release. Use a full memory barrier to emulate
30 * the acquire-release semantic with a stronger barrier on older
34 #define lttng_smp_store_release(x, v) \
37 ACCESS_ONCE(*(x)) = (v); \
40 #define lttng_smp_load_acquire(x) \
42 __typeof__(*(x)) ___ret; \
44 ___ret = ACCESS_ONCE(*(x)); \
51 #endif /* _LTTNG_WRAPPER_BARRIER_H */
This page took 0.031104 seconds and 4 git commands to generate.