Skip to content

Commit 8b69961

Browse files
Andrea Parripalmer-dabbelt
authored andcommitted
riscv, atomic: Add #define's for the atomic_{cmp,}xchg_*() variants
If an architecture does not define the atomic_{cmp,}xchg_*() variants, the generic implementation defaults them to the fully-ordered version. riscv's had its own variants since "the beginning", but it never told (#define-d these for) the generic implementation: it is time to do so. Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
1 parent 7566ec3 commit 8b69961

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/riscv/include/asm/atomic.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,15 @@ c_t atomic##prefix##_cmpxchg(atomic##prefix##_t *v, c_t o, c_t n) \
303303

304304
ATOMIC_OPS()
305305

306+
#define atomic_xchg_relaxed atomic_xchg_relaxed
307+
#define atomic_xchg_acquire atomic_xchg_acquire
308+
#define atomic_xchg_release atomic_xchg_release
309+
#define atomic_xchg atomic_xchg
310+
#define atomic_cmpxchg_relaxed atomic_cmpxchg_relaxed
311+
#define atomic_cmpxchg_acquire atomic_cmpxchg_acquire
312+
#define atomic_cmpxchg_release atomic_cmpxchg_release
313+
#define atomic_cmpxchg atomic_cmpxchg
314+
306315
#undef ATOMIC_OPS
307316
#undef ATOMIC_OP
308317

0 commit comments

Comments
 (0)