Xen Test Framework
atomic.h
Go to the documentation of this file.
1#ifndef XTF_ATOMIC_H
2#define XTF_ATOMIC_H
3
4#include <xtf/lib.h>
5#include <xtf/barrier.h>
6
7#define LOAD_ACQUIRE(p) \
8 ({ typeof(*p) _p = ACCESS_ONCE(*p); \
9 smp_rmb(); \
10 _p; \
11 })
12
13#define STORE_RELEASE(p, v) \
14 ({ smp_wmb(); \
15 ACCESS_ONCE(*p) = v; \
16 })
17
18#endif /* XTF_ATOMIC_H */
19
20/*
21 * Local variables:
22 * mode: C
23 * c-file-style: "BSD"
24 * c-basic-offset: 4
25 * tab-width: 4
26 * indent-tabs-mode: nil
27 * End:
28 */