Commit 598865c5 authored by Will Deacon's avatar Will Deacon

arm64: barrier: Implement smp_cond_load_relaxed

We can provide an implementation of smp_cond_load_relaxed using READ_ONCE
and __cmpwait_relaxed.
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 76f4e2da
...@@ -128,6 +128,19 @@ do { \ ...@@ -128,6 +128,19 @@ do { \
__u.__val; \ __u.__val; \
}) })
#define smp_cond_load_relaxed(ptr, cond_expr) \
({ \
typeof(ptr) __PTR = (ptr); \
typeof(*ptr) VAL; \
for (;;) { \
VAL = READ_ONCE(*__PTR); \
if (cond_expr) \
break; \
__cmpwait_relaxed(__PTR, VAL); \
} \
VAL; \
})
#define smp_cond_load_acquire(ptr, cond_expr) \ #define smp_cond_load_acquire(ptr, cond_expr) \
({ \ ({ \
typeof(ptr) __PTR = (ptr); \ typeof(ptr) __PTR = (ptr); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment