mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 13:58:34 +00:00
arm: atomic -- Add atomic_read/atomic_set helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
aea8a605f3
commit
56cb0f8baf
@@ -18,9 +18,17 @@ typedef struct {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static inline int atomic_read(const atomic_t *v)
|
||||||
|
{
|
||||||
|
return (*(volatile int *)&(v)->counter);
|
||||||
|
}
|
||||||
|
|
||||||
#define atomic_set(mem,v) ((mem)->counter = (v))
|
static inline void atomic_set(atomic_t *v, int i)
|
||||||
#define atomic_get(v) (*(volatile int *)&(v)->counter)
|
{
|
||||||
|
v->counter = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define atomic_get atomic_read
|
||||||
|
|
||||||
static inline int atomic_add_return(int i, atomic_t *v)
|
static inline int atomic_add_return(int i, atomic_t *v)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user