linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] locking/atomic: arc: use generic_cmpxchg[64]_local for arch_cmpxchg[64]_local
@ 2023-10-26  7:38 wuqiang.matt
  0 siblings, 0 replies; only message in thread
From: wuqiang.matt @ 2023-10-26  7:38 UTC (permalink / raw)
  To: Vineet Gupta, Palmer Dabbelt, Ingo Molnar, Geert Uytterhoeven,
	Peter Zijlstra (Intel), Andi Shyti, Andrzej Hajda
  Cc: linux-trace-kernel, mhiramat, mattwu, wuqiang.matt

arch_cmpxchg[64]_local() are not defined for arc architecture. This patch
implement them with generci_cmpxchg[64]_local, advised by Masami Hiramatsu.

Closes: https://lore.kernel.org/linux-trace-kernel/169824660459.24340.14614817132696360531.stgit@devnote2
Closes: https://lore.kernel.org/oe-kbuild-all/202310241310.Ir5uukOG-lkp@intel.com/

Signed-off-by: wuqiang.matt <wuqiang.matt@bytedance.com>
---
 arch/arc/include/asm/cmpxchg.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h
index e138fde067de..ef644cdbe956 100644
--- a/arch/arc/include/asm/cmpxchg.h
+++ b/arch/arc/include/asm/cmpxchg.h
@@ -140,4 +140,18 @@
 
 #endif
 
+/*
+ * always make arch_cmpxchg[64]_local available. __generic_cmpxchg[64]_local
+ * are atomic with respect to current cpu.
+ */
+#include <asm-generic/cmpxchg-local.h>
+
+#define arch_cmpxchg_local(ptr, o, n) ({				\
+	(__typeof__(*ptr))__generic_cmpxchg_local((ptr),		\
+						(unsigned long)(o),	\
+						(unsigned long)(n),	\
+						sizeof(*(ptr)));	\
+})
+#define arch_cmpxchg64_local(ptr, o, n) __generic_cmpxchg64_local((ptr), (o), (n))
+
 #endif
-- 
2.40.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-26  7:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-26  7:38 [PATCH 1/3] locking/atomic: arc: use generic_cmpxchg[64]_local for arch_cmpxchg[64]_local wuqiang.matt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).