[tip:,locking/core] locking/x86: Define arch_try_cmpxchg_local
Commit Message
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 561b081f19655a46a9690e868fa4aa516ff1b62c
Gitweb: https://git.kernel.org/tip/561b081f19655a46a9690e868fa4aa516ff1b62c
Author: Uros Bizjak <ubizjak@gmail.com>
AuthorDate: Wed, 05 Apr 2023 16:17:09 +02:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 12 Apr 2023 16:46:35 +02:00
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>
Link: https://lore.kernel.org/r/20230405141710.3551-5-ubizjak@gmail.com
---
arch/x86/include/asm/cmpxchg.h | 6 ++++++
1 file changed, 6 insertions(+)
@@ -221,9 +221,15 @@ extern void __add_wrong_size(void)
#define __try_cmpxchg(ptr, pold, new, size) \
__raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
+#define __try_cmpxchg_local(ptr, pold, new, size) \
+ __raw_try_cmpxchg((ptr), (pold), (new), (size), "")
+
#define arch_try_cmpxchg(ptr, pold, new) \
__try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
+#define arch_try_cmpxchg_local(ptr, pold, new) \
+ __try_cmpxchg_local((ptr), (pold), (new), sizeof(*(ptr)))
+
/*
* xadd() adds "inc" to "*ptr" and atomically returns the previous
* value of "*ptr".