xen/const: Extend the existing macro BIT to take a suffix in parameter
authorJulien Grall <julien.grall@arm.com>
Tue, 14 May 2019 12:24:38 +0000 (13:24 +0100)
committerJulien Grall <julien.grall@arm.com>
Tue, 21 May 2019 10:59:29 +0000 (11:59 +0100)
commit03957f58db8942d61f4889b6924e39d3b27a9e43
tree52e7c867a65868a605af93151f7f5dfe2775bde0
parent57d87ee3a5d10cdba972eec3a54cd971fec1b8d2
xen/const: Extend the existing macro BIT to take a suffix in parameter

Arm currently provides two macro BIT and BIT_ULL that are only usable
in C and return respectively unsigned long and unsigned long long.

Extending the macros to deal with assembly would be a nice benefits as
it could replace the common pattern to define fields (AC(1, sfx) << X)
easier to read.

Rather than extending the two macros, it was decided to drop BIT_ULL()
and extend the macro BIT() to take a suffix (e.g U, UL, ULL) in
parameter. This would allow to use different suffix without having to
define new macros.

The new extend macro is now moved in include/xen/const.h so it can be
used by anyone in Xen and also avoid to include bitops.h in assembly
code.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
14 files changed:
xen/arch/arm/arm32/insn.c
xen/arch/arm/arm64/insn.c
xen/arch/arm/gic-v3-its.c
xen/arch/arm/gic-v3-lpi.c
xen/arch/arm/guest_walk.c
xen/arch/arm/vgic-v3-its.c
xen/arch/arm/vgic-v3.c
xen/arch/arm/vgic.c
xen/drivers/char/meson-uart.c
xen/drivers/char/mvebu-uart.c
xen/include/asm-arm/bitops.h
xen/include/asm-arm/gic_v3_defs.h
xen/include/asm-arm/gic_v3_its.h
xen/include/xen/const.h