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:38:40 +0000 (14:38 +0100)
commit632e87512e75cb9e3549662b79c9100cd30aaa8b
treec33c232fc47b3d2d278b4123682c240938394ab8
parent5833f3fc33936d0d1c9d661ddb29ae7c970bd32c
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