diff options
Diffstat (limited to 'include/asm-mips')
-rw-r--r-- | include/asm-mips/page.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index edb33a14ae9e..c3b13dedf21a 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
@@ -136,8 +136,13 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
136 | /* to align the pointer to the (next) page boundary */ | 136 | /* to align the pointer to the (next) page boundary */ |
137 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) | 137 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) |
138 | 138 | ||
139 | #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) | 139 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) |
140 | #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) | 140 | #define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0) |
141 | #else | ||
142 | #define __pa_page_offset(x) PAGE_OFFSET | ||
143 | #endif | ||
144 | #define __pa(x) ((unsigned long)(x) - __pa_page_offset(x)) | ||
145 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET)) | ||
141 | 146 | ||
142 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | 147 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) |
143 | 148 | ||