]> git.baikalelectronics.ru Git - kernel.git/commit
openrisc: add 1 and 2 byte cmpxchg support
authorStafford Horne <shorne@gmail.com>
Thu, 23 Mar 2017 14:27:12 +0000 (23:27 +0900)
committerStafford Horne <shorne@gmail.com>
Fri, 3 Nov 2017 05:01:12 +0000 (14:01 +0900)
commit72a2dca28e08447b8317cd13e6e21a940bb7ff2a
tree73f0b4010d05cad70a4bb60ac251f6222783b750
parent5e448e6d3004c44b74242f72936dc73698f457de
openrisc: add 1 and 2 byte cmpxchg support

OpenRISC only supports hardware instructions that perform 4 byte atomic
operations.  For enabling qrwlocks for upcoming SMP support 1 and 2 byte
implementations are needed.  To do this we leverage the 4 byte atomic
operations and shift/mask the 1 and 2 byte areas as needed.

This heavily borrows ideas and routines from sh and mips, which do
something similar.

Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Stafford Horne <shorne@gmail.com>
arch/openrisc/include/asm/cmpxchg.h