xen/arm32: cmpxchg: Simplify the cmpxchg implementation
authorJulien Grall <julien.grall@arm.com>
Mon, 29 Apr 2019 14:05:22 +0000 (15:05 +0100)
committerJulien Grall <julien.grall@arm.com>
Fri, 14 Jun 2019 13:27:32 +0000 (14:27 +0100)
commit2d2ccf4355a182232b2c60a3bca4c15210e8b4b6
tree6a052465f7079ceb4f3746764eb9006056de70f3
parent00926c2370f3c6a45a20e068f53cbe7989d180f0
xen/arm32: cmpxchg: Simplify the cmpxchg implementation

The only difference between each case of the cmpxchg is the size of
used. Rather than duplicating the code, provide a macro to generate each
cases.

This makes the code easier to read and modify.

While doing the rework, the case for 64-bit cmpxchg is removed. This is
unused today (already commented) and it would not be possible to use
it directly.

This is part of XSA-295.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/asm-arm/arm32/cmpxchg.h