sh: move xchg_cmpxchg to a header by itself
authorMichael S. Tsirkin <mst@redhat.com>
Fri, 8 Jan 2016 07:23:58 +0000 (09:23 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 12 Jan 2016 18:47:02 +0000 (20:47 +0200)
commit9e3f84ce416663c84a191cb3ead300fc1a4adadc
tree8c4537b92a1498af2599787cfc8622cd24a0ab20
parent3226aad81aa670015a59e51458a0deb2d3bcb600
sh: move xchg_cmpxchg to a header by itself

Looks like future sh variants will support a 4-byte cas which will be
used to implement 1 and 2 byte xchg.

This is exactly what we do for llsc now, move the portable part of the
code into a separate header so it's easy to reuse.

Suggested-by: Rich Felker <dalias@libc.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
arch/sh/include/asm/cmpxchg-llsc.h
arch/sh/include/asm/cmpxchg-xchg.h [new file with mode: 0644]