Skip to content

Commit 5cd4c26

Browse files
ubizjakingomolnar
authored andcommitted
locking/x86: Define arch_try_cmpxchg_local()
Define target specific arch_try_cmpxchg_local(). This definition overrides the generic arch_try_cmpxchg_local() fallback definition and enables target-specific implementation of try_cmpxchg_local(). Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20230405141710.3551-5-ubizjak@gmail.com Cc: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d994f2c commit 5cd4c26

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

arch/x86/include/asm/cmpxchg.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,15 @@ extern void __add_wrong_size(void)
221221
#define __try_cmpxchg(ptr, pold, new, size) \
222222
__raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
223223

224+
#define __try_cmpxchg_local(ptr, pold, new, size) \
225+
__raw_try_cmpxchg((ptr), (pold), (new), (size), "")
226+
224227
#define arch_try_cmpxchg(ptr, pold, new) \
225228
__try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
226229

230+
#define arch_try_cmpxchg_local(ptr, pold, new) \
231+
__try_cmpxchg_local((ptr), (pold), (new), sizeof(*(ptr)))
232+
227233
/*
228234
* xadd() adds "inc" to "*ptr" and atomically returns the previous
229235
* value of "*ptr".

0 commit comments

Comments
 (0)