powerpc: Add __SANE_USERSPACE_TYPES__ to asm/types.h for LL64
authorMatt Evans <matt@ozlabs.org>
Wed, 7 Dec 2011 20:57:09 +0000 (20:57 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 19 Dec 2011 03:41:14 +0000 (14:41 +1100)
PPC64 uses long long for u64 in the kernel, but powerpc's asm/types.h
prevents 64-bit userland from seeing this definition, instead defaulting
to u64 == long in userspace.  Some user programs (e.g. kvmtool) may actually
want LL64, so this patch adds a check for __SANE_USERSPACE_TYPES__ so that,
if defined, int-ll64.h is included instead.

Signed-off-by: Matt Evans <matt@ozlabs.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/types.h

index 8947b9827bc40d8d03fba298554d0c0f449aa31c..d82e94e6c2b41045b6a56aa8a0c0c9c7056e9371 100644 (file)
@@ -5,8 +5,11 @@
  * This is here because we used to use l64 for 64bit powerpc
  * and we don't want to impact user mode with our change to ll64
  * in the kernel.
+ *
+ * However, some user programs are fine with this.  They can
+ * flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here.
  */
-#if defined(__powerpc64__) && !defined(__KERNEL__)
+#if !defined(__SANE_USERSPACE_TYPES__) && defined(__powerpc64__) && !defined(__KERNEL__)
 # include <asm-generic/int-l64.h>
 #else
 # include <asm-generic/int-ll64.h>