From: Sergej Proskurin Date: Wed, 16 Aug 2017 13:17:38 +0000 (+0200) Subject: arm/mem_access: Introduce GENMASK_ULL bit operation X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1647 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=83be50576e8131642008575f65ddd9d5ede60b11;p=xen.git arm/mem_access: Introduce GENMASK_ULL bit operation The current implementation of GENMASK is capable of creating bitmasks of 32-bit values on AArch32 and 64-bit values on AArch64. As we need to create masks for 64-bit values on AArch32 as well, in this commit we introduce the GENMASK_ULL bit operation. Please note that the GENMASK_ULL implementation has been lifted from the linux kernel source code. Signed-off-by: Sergej Proskurin Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h index 5b6f3c985d..7da94698e1 100644 --- a/xen/include/asm-arm/config.h +++ b/xen/include/asm-arm/config.h @@ -19,6 +19,8 @@ #define BITS_PER_LONG (BYTES_PER_LONG << 3) #define POINTER_ALIGN BYTES_PER_LONG +#define BITS_PER_LLONG 64 + /* xen_ulong_t is always 64 bits */ #define BITS_PER_XEN_ULONG 64 diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index 25af085af0..0130ac864f 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -15,6 +15,8 @@ #define BITS_PER_BYTE 8 #define POINTER_ALIGN BYTES_PER_LONG +#define BITS_PER_LLONG 64 + #define BITS_PER_XEN_ULONG BITS_PER_LONG #define CONFIG_PAGING_ASSISTANCE 1 diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h index bd0883ab22..e2019b02a3 100644 --- a/xen/include/xen/bitops.h +++ b/xen/include/xen/bitops.h @@ -10,6 +10,9 @@ #define GENMASK(h, l) \ (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) +#define GENMASK_ULL(h, l) \ + (((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LLONG - 1 - (h)))) + /* * ffs: find first bit set. This is defined the same way as * the libc and compiler builtin ffs routines, therefore