arch/sparc: Introduce cmpxchg_u8 SPARC
authorBabu Moger <babu.moger@oracle.com>
Wed, 24 May 2017 23:55:12 +0000 (17:55 -0600)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 May 2017 19:06:51 +0000 (12:06 -0700)
commita12ee2349312d7112b9b7c6ac2e70c5ec2ca334e
treef05689b6e06bbf9c03499ce2ad8728546a0b54cc
parent97d9f969161d79e6a4bba247e67ce731ff861f79
arch/sparc: Introduce cmpxchg_u8 SPARC

SPARC supports 32 bit and 64 bit cmpxchg right now. Add support
for 8 bit (1 byte) cmpxchg. This is required to support queued
rwlocks feature  which uses 1 byte cmpxchg.

The function __cmpxchg_u8 here uses the 4 byte cas instruction with a
byte manipulation to achieve 1 byte cmpxchg.

Signed-off-by: Babu Moger <babu.moger@oracle.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com>
Reviewed-by: Jane Chu <jane.chu@oracle.com>
Reviewed-by: Vijay Kumar <vijay.ac.kumar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/cmpxchg_64.h