sparc32: Implement xchg and atomic_xchg using ATOMIC_HASH locks

commit 1a17fdc4f4 upstream.

Atomicity between xchg and cmpxchg cannot be guaranteed when xchg is
implemented with a swap and cmpxchg is implemented with locks.
Without this, e.g. mcs_spin_lock and mcs_spin_unlock are broken.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
This commit is contained in:
Andreas Larsson 2014-11-05 15:52:08 +01:00 • committed by Luis Henriques
commit 4f7e7dca2b
3 changed files with 30 additions and 11 deletions