summaryrefslogtreecommitdiff
path: root/arch/sh/include/asm/cmpxchg.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2024-03-28 01:21:31 +0300
committerPaul E. McKenney <paulmck@kernel.org>2024-09-13 17:10:38 +0300
commitc81a748edefd098ea21dd35d4bba03f69412fc26 (patch)
treec04d181cc52b0ee66bc0172392cc6414bc5a01ac /arch/sh/include/asm/cmpxchg.h
parentf2519d4d4fc4d36f2b58c5614357de9f5b4032fc (diff)
downloadlinux-c81a748edefd098ea21dd35d4bba03f69412fc26.tar.xz
sh: Emulate one-byte cmpxchg
Use the new cmpxchg_emu_u8() to emulate one-byte cmpxchg() on sh. [ paulmck: Drop two-byte support per Arnd Bergmann feedback. ] [ paulmck: Apply feedback from Naresh Kamboju. ] [ Apply Geert Uytterhoeven feedback. ] Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Cc: Andi Shyti <andi.shyti@linux.intel.com> Cc: Palmer Dabbelt <palmer@rivosinc.com> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: <linux-sh@vger.kernel.org> Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Diffstat (limited to 'arch/sh/include/asm/cmpxchg.h')
-rw-r--r--arch/sh/include/asm/cmpxchg.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/sh/include/asm/cmpxchg.h b/arch/sh/include/asm/cmpxchg.h
index 5d617b3ef78f..1e5dc5ccf7bf 100644
--- a/arch/sh/include/asm/cmpxchg.h
+++ b/arch/sh/include/asm/cmpxchg.h
@@ -9,6 +9,7 @@
#include <linux/compiler.h>
#include <linux/types.h>
+#include <linux/cmpxchg-emu.h>
#if defined(CONFIG_GUSA_RB)
#include <asm/cmpxchg-grb.h>
@@ -56,6 +57,8 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
unsigned long new, int size)
{
switch (size) {
+ case 1:
+ return cmpxchg_emu_u8(ptr, old, new);
case 4:
return __cmpxchg_u32(ptr, old, new);
}