]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: cmpxchg: Implement 1 byte & 2 byte cmpxchg()
authorPaul Burton <paul.burton@imgtec.com>
Sat, 10 Jun 2017 00:26:40 +0000 (17:26 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 29 Jun 2017 00:42:25 +0000 (02:42 +0200)
commit3ba7f44d2b19166b34031db48ce613d1bddbd384
tree973693babaf2dd5eee8646c084e155e7b30f1adb
parentb70eb30056dc84568f3d32440d9be6a558025843
MIPS: cmpxchg: Implement 1 byte & 2 byte cmpxchg()

Implement support for 1 & 2 byte cmpxchg() using read-modify-write atop
a 4 byte cmpxchg(). This allows us to support these atomic operations
despite the MIPS ISA only providing 4 & 8 byte atomic operations.

This is required in order to support queued rwlocks (qrwlock) in a later
patch, since these make use of a 1 byte cmpxchg() in their slow path.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/16355/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/cmpxchg.h
arch/mips/kernel/cmpxchg.c