diff options
-rw-r--r-- | arch/powerpc/Kconfig | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/page.h | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 74991fee2e62..fe404e77246e 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -986,6 +986,7 @@ config RELOCATABLE | |||
986 | must live at a different physical address than the primary | 986 | must live at a different physical address than the primary |
987 | kernel. | 987 | kernel. |
988 | 988 | ||
989 | # This value must have zeroes in the bottom 60 bits otherwise lots will break | ||
989 | config PAGE_OFFSET | 990 | config PAGE_OFFSET |
990 | hex | 991 | hex |
991 | default "0xc000000000000000" | 992 | default "0xc000000000000000" |
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; | |||
211 | #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET)) | 211 | #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET)) |
212 | #define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET) | 212 | #define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET) |
213 | #else | 213 | #else |
214 | #ifdef CONFIG_PPC64 | ||
215 | /* | ||
216 | * gcc miscompiles (unsigned long)(&static_var) - PAGE_OFFSET | ||
217 | * with -mcmodel=medium, so we use & and | instead of - and + on 64-bit. | ||
218 | */ | ||
219 | #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) | PAGE_OFFSET)) | ||
220 | #define __pa(x) ((unsigned long)(x) & 0x0fffffffffffffffUL) | ||
221 | |||
222 | #else /* 32-bit, non book E */ | ||
214 | #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START)) | 223 | #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START)) |
215 | #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START) | 224 | #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START) |
216 | #endif | 225 | #endif |
226 | #endif | ||
217 | 227 | ||
218 | /* | 228 | /* |
219 | * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI, | 229 | * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI, |