xen/arm64: cmpxchg: Simplify the cmpxchg implementation
authorJulien Grall <julien.grall@arm.com>
Wed, 22 May 2019 20:37:53 +0000 (13:37 -0700)
committerJulien Grall <julien.grall@arm.com>
Fri, 14 Jun 2019 13:27:32 +0000 (14:27 +0100)
commit00926c2370f3c6a45a20e068f53cbe7989d180f0
treec33819a17a15c1fb48850dcf3449b44d12fb48b6
parent3a4e55e6051bb10f9debc4fb874c31081b24930b
xen/arm64: 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.

This is part of XSA-295.

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