Skip to content
Commit 3226aad8 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin
Browse files

sh: support 1 and 2 byte xchg



This completes the xchg implementation for sh architecture.  Note: The
llsc variant is tricky since this only supports 4 byte atomics, the
existing implementation of 1 byte xchg is wrong: we need to do a 4 byte
cmpxchg and retry if any bytes changed meanwhile.

Write this in C for clarity.

Suggested-by: default avatarRich Felker <dalias@libc.org>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
parent a6596127
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment