aboutsummaryrefslogtreecommitdiff
path: root/include/asm-mips/page.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-mips/page.h')
-rw-r--r--include/asm-mips/page.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index c56c6a85908..b92dd8c760d 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -35,7 +35,7 @@
#ifndef __ASSEMBLY__
#include <linux/pfn.h>
-#include <linux/io.h>
+#include <asm/io.h>
/*
* It's normally defined only for FLATMEM config but it's
@@ -143,11 +143,15 @@ typedef struct { unsigned long pgprot; } pgprot_t;
* __pa()/__va() should be used only during mem init.
*/
#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
-#define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0)
+#define __pa(x) \
+({ \
+ unsigned long __x = (unsigned long)(x); \
+ __x < CKSEG0 ? XPHYSADDR(__x) : CPHYSADDR(__x); \
+})
#else
-#define __pa_page_offset(x) PAGE_OFFSET
+#define __pa(x) \
+ ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET)
#endif
-#define __pa(x) ((unsigned long)(x) - __pa_page_offset(x) + PHYS_OFFSET)
#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0))