arm/mem_access: Introduce GENMASK_ULL bit operation
authorSergej Proskurin <proskurin@sec.in.tum.de>
Wed, 16 Aug 2017 13:17:38 +0000 (15:17 +0200)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 18 Aug 2017 17:27:33 +0000 (10:27 -0700)
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 <proskurin@sec.in.tum.de>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/asm-arm/config.h
xen/include/asm-x86/config.h
xen/include/xen/bitops.h

index 5b6f3c985db44523126e2cabd16b9595a2d0e715..7da94698e1f3a291c10fed5665b765b28221b09d 100644 (file)
@@ -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
 
index 25af085af05f7cb49d44753560a9e3e7d8633513..0130ac864fc6bbf1c24cf071d590ccc9265ee39c 100644 (file)
@@ -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
index bd0883ab220717451081f702f05d700d3895b3d4..e2019b02a3ae6e71569876cbe2475ec10a344b51 100644 (file)
@@ -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