[PATCH 0/5] Provide two-byte cmpxchg() emulation
From: Paul E. McKenney
Date: Wed Oct 07 2026 - 16:37:09 EST
Hello!
This series provides emulation of two-byte cmpxchg(). Note that this
does not (yet) allow free use of atomic operations on two-byte operands
in core code because there are still a few supported systems that do not
have two-byte store instructions. However, this emulation does permit use
of wide range of two-byte atomic operations, so is worth putting forward.
This series is being reposted on request in order to ease testing efforts.
The individual patches are as follows:
1. Add two-byte cmpxchg emulation function, courtesy of Bradley
Morgan.
2. sh: Emulate two-byte cmpxchg, courtesy of Bradley Morgan.
3. ARC: Emulate two-byte cmpxchg, courtesy of Bradley Morgan.
4. csky: Emulate two-byte cmpxchg, courtesy of Bradley Morgan.
5. xtensa: Emulate two-byte cmpxchg, courtesy of Bradley Morgan.
#1 and #2 have the acks required to go into the upcoming v7.4 merge
window.
Thanx, Paul
------------------------------------------------------------------------
arch/arc/include/asm/cmpxchg.h | 3 +++
arch/csky/include/asm/cmpxchg.h | 9 +++++++++
arch/sh/include/asm/cmpxchg.h | 2 ++
arch/xtensa/include/asm/cmpxchg.h | 1 +
include/linux/cmpxchg-emu.h | 4 +++-
lib/cmpxchg-emu.c | 38 ++++++++++++++++++++++++++++++++++----
6 files changed, 52 insertions(+), 5 deletions(-)