diff options
Diffstat (limited to 'arch/powerpc/include/asm/page.h')
-rw-r--r-- | arch/powerpc/include/asm/page.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index e088545cb3f5..64e144505f65 100644 --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h | |||
@@ -71,15 +71,21 @@ | |||
71 | #define PAGE_OFFSET ASM_CONST(CONFIG_PAGE_OFFSET) | 71 | #define PAGE_OFFSET ASM_CONST(CONFIG_PAGE_OFFSET) |
72 | #define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_PHYSICAL_START)) | 72 | #define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_PHYSICAL_START)) |
73 | 73 | ||
74 | #if defined(CONFIG_RELOCATABLE) && defined(CONFIG_FLATMEM) | 74 | #if defined(CONFIG_RELOCATABLE) |
75 | #ifndef __ASSEMBLY__ | 75 | #ifndef __ASSEMBLY__ |
76 | extern phys_addr_t memstart_addr; | 76 | extern phys_addr_t memstart_addr; |
77 | extern phys_addr_t kernstart_addr; | 77 | extern phys_addr_t kernstart_addr; |
78 | #endif | 78 | #endif |
79 | #define PHYSICAL_START kernstart_addr | 79 | #define PHYSICAL_START kernstart_addr |
80 | #define MEMORY_START memstart_addr | ||
81 | #else | 80 | #else |
82 | #define PHYSICAL_START ASM_CONST(CONFIG_PHYSICAL_START) | 81 | #define PHYSICAL_START ASM_CONST(CONFIG_PHYSICAL_START) |
82 | #endif | ||
83 | |||
84 | #ifdef CONFIG_PPC64 | ||
85 | #define MEMORY_START 0UL | ||
86 | #elif defined(CONFIG_RELOCATABLE) | ||
87 | #define MEMORY_START memstart_addr | ||
88 | #else | ||
83 | #define MEMORY_START (PHYSICAL_START + PAGE_OFFSET - KERNELBASE) | 89 | #define MEMORY_START (PHYSICAL_START + PAGE_OFFSET - KERNELBASE) |
84 | #endif | 90 | #endif |
85 | 91 | ||
@@ -92,8 +98,8 @@ extern phys_addr_t kernstart_addr; | |||
92 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | 98 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) |
93 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 99 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) |
94 | 100 | ||
95 | #define __va(x) ((void *)((unsigned long)(x) - PHYSICAL_START + KERNELBASE)) | 101 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - MEMORY_START)) |
96 | #define __pa(x) ((unsigned long)(x) + PHYSICAL_START - KERNELBASE) | 102 | #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START) |
97 | 103 | ||
98 | /* | 104 | /* |
99 | * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI, | 105 | * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI, |