diff options
Diffstat (limited to 'include/asm-mips/page.h')
-rw-r--r-- | include/asm-mips/page.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 5c3239dad0f2..b92dd8c760da 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
@@ -34,12 +34,8 @@ | |||
34 | 34 | ||
35 | #ifndef __ASSEMBLY__ | 35 | #ifndef __ASSEMBLY__ |
36 | 36 | ||
37 | /* | 37 | #include <linux/pfn.h> |
38 | * This gives the physical RAM offset. | 38 | #include <asm/io.h> |
39 | */ | ||
40 | #ifndef PHYS_OFFSET | ||
41 | #define PHYS_OFFSET 0UL | ||
42 | #endif | ||
43 | 39 | ||
44 | /* | 40 | /* |
45 | * It's normally defined only for FLATMEM config but it's | 41 | * It's normally defined only for FLATMEM config but it's |
@@ -48,9 +44,6 @@ | |||
48 | */ | 44 | */ |
49 | #define ARCH_PFN_OFFSET PFN_UP(PHYS_OFFSET) | 45 | #define ARCH_PFN_OFFSET PFN_UP(PHYS_OFFSET) |
50 | 46 | ||
51 | #include <linux/pfn.h> | ||
52 | #include <asm/io.h> | ||
53 | |||
54 | extern void clear_page(void * page); | 47 | extern void clear_page(void * page); |
55 | extern void copy_page(void * to, void * from); | 48 | extern void copy_page(void * to, void * from); |
56 | 49 | ||
@@ -150,11 +143,15 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
150 | * __pa()/__va() should be used only during mem init. | 143 | * __pa()/__va() should be used only during mem init. |
151 | */ | 144 | */ |
152 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) | 145 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) |
153 | #define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0) | 146 | #define __pa(x) \ |
147 | ({ \ | ||
148 | unsigned long __x = (unsigned long)(x); \ | ||
149 | __x < CKSEG0 ? XPHYSADDR(__x) : CPHYSADDR(__x); \ | ||
150 | }) | ||
154 | #else | 151 | #else |
155 | #define __pa_page_offset(x) PAGE_OFFSET | 152 | #define __pa(x) \ |
153 | ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) | ||
156 | #endif | 154 | #endif |
157 | #define __pa(x) ((unsigned long)(x) - __pa_page_offset(x) + PHYS_OFFSET) | ||
158 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) | 155 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) |
159 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0)) | 156 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0)) |
160 | 157 | ||