mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 05:48:05 +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:
parent
aea8a605f3
commit
56cb0f8baf
@ -18,9 +18,17 @@ typedef struct {
|
||||
|
||||
#endif
|
||||
|
||||
static inline int atomic_read(const atomic_t *v)
|
||||
{
|
||||
return (*(volatile int *)&(v)->counter);
|
||||
}
|
||||
|
||||
#define atomic_set(mem,v) ((mem)->counter = (v))
|
||||
#define atomic_get(v) (*(volatile int *)&(v)->counter)
|
||||
static inline void atomic_set(atomic_t *v, int i)
|
||||
{
|
||||
v->counter = i;
|
||||
}
|
||||
|
||||
#define atomic_get atomic_read
|
||||
|
||||
static inline int atomic_add_return(int i, atomic_t *v)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user