summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-10-20 14:53:33 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2026-10-20 14:53:33 -1000
commit6303381334e3ac3f0762c5db2f240e0348c36c9b (patch)
tree84340da1196aa21a4dc0bb745b8040aa4b0fafb4 /include
parent14c897740388216acd59477a382de327d5e27ba4 (diff)
parent558ccc91ddf98d58ae726ed7ccaf5838f284084f (diff)
Merge tag 'cmpxchg-emu.2026.10.12b' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
Pull two-byte cmpxchg emulation from Paul McKenney: "These commits add a cmpxchg_emu_u16() function that emulates two-byte cmpxchg() in terms of four-byte cmpxchg() for architectures not having native instructions for this purpose. They also make use of this cmpxchg_emu_u16() function in those architectures, namely sh, arc, csky, and xtensa. This permits use of two-byte cmpxchg() in common code. However, it sadly does not permit easy implementation of all algorithms needing on two-byte atomic operations because there are some systems still supported by Linux that do not have native two-byte store instructions. There is reason to believe that these systems will soon no longer be supported by Linux [1]" Link: https://lore.kernel.org/all/20260908152808.3928630-4-arnd@kernel.org/ [1] * tag 'cmpxchg-emu.2026.10.12b' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: xtensa: Emulate two-byte cmpxchg csky: Emulate two-byte cmpxchg ARC: Emulate two-byte cmpxchg sh: Emulate two-byte cmpxchg lib: Add two-byte cmpxchg emulation function
Diffstat (limited to 'include')
-rw-r--r--include/linux/cmpxchg-emu.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/cmpxchg-emu.h b/include/linux/cmpxchg-emu.h
index 998deec67740..2db70f1e3925 100644
--- a/include/linux/cmpxchg-emu.h
+++ b/include/linux/cmpxchg-emu.h
@@ -4,12 +4,14 @@
* lacking direct support for these sizes. These are implemented in terms
* of 4-byte cmpxchg operations.
*
- * Copyright (C) 2024 Paul E. McKenney.
+ * Copyright (C) 2024 Paul E. McKenney <paulmck@kernel.org>
+ * Copyright (C) 2026 Bradley Morgan <brads@mainlining.org>
*/
#ifndef __LINUX_CMPXCHG_EMU_H
#define __LINUX_CMPXCHG_EMU_H
uintptr_t cmpxchg_emu_u8(volatile u8 *p, uintptr_t old, uintptr_t new);
+unsigned long cmpxchg_emu_u16(volatile u16 *p, unsigned long old, unsigned long new);
#endif /* __LINUX_CMPXCHG_EMU_H */