summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-28 01:17:32 (GMT)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-28 01:17:32 (GMT)
commit10420921675582903ab256dc3094206ac0280f68 (patch)
treeb774e849efa85255b2fbc0a24698c75196038e96 /arch/powerpc/include/asm
parent13906db670a128864714c30c244b866dce119494 (diff)
parentd220980b701d838560a70de691b53be007e99e78 (diff)
downloadlinux-fsl-qoriq-10420921675582903ab256dc3094206ac0280f68.tar.xz
Merge branch 'merge' into next
Merge recent fixes to lparcfg so subsequent patches can move the whole file to arch/powerpc/platforms/pseries
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r--arch/powerpc/include/asm/page.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 988c812..b9f4262 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -211,9 +211,19 @@ extern long long virt_phys_offset;
#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET))
#define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET)
#else
+#ifdef CONFIG_PPC64
+/*
+ * gcc miscompiles (unsigned long)(&static_var) - PAGE_OFFSET
+ * with -mcmodel=medium, so we use & and | instead of - and + on 64-bit.
+ */
+#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) | PAGE_OFFSET))
+#define __pa(x) ((unsigned long)(x) & 0x0fffffffffffffffUL)
+
+#else /* 32-bit, non book E */
#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START))
#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START)
#endif
+#endif
/*
* Unfortunately the PLT is in the BSS in the PPC32 ELF ABI,