diff options
author | Chris Mason <chris.mason@fusionio.com> | 2013-09-21 18:44:55 +0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-09-21 18:44:55 +0400 |
commit | 07f0e62e7f2533918f28e780ab3cfeea1a63145d (patch) | |
tree | cb64b7cf275f1a5fd7f121f4f434e77dc6769e37 /arch/powerpc/include/asm/page.h | |
parent | d7396f07358a7c6e22c238d36d1d85f9d652a414 (diff) | |
parent | 6e4664525b1db28f8c4e1130957f70a94c19213e (diff) | |
download | linux-07f0e62e7f2533918f28e780ab3cfeea1a63145d.tar.xz |
Merge tag 'v3.11' into for-linus
Linux 3.11
Diffstat (limited to 'arch/powerpc/include/asm/page.h')
-rw-r--r-- | arch/powerpc/include/asm/page.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index 988c812aab5b..b9f426212d3a 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, |