summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/page_64.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/page_64.h')
-rw-r--r--arch/x86/include/asm/page_64.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/include/asm/page_64.h b/arch/x86/include/asm/page_64.h
index 4150999..5138174 100644
--- a/arch/x86/include/asm/page_64.h
+++ b/arch/x86/include/asm/page_64.h
@@ -9,7 +9,21 @@
extern unsigned long max_pfn;
extern unsigned long phys_base;
+static inline unsigned long __phys_addr_nodebug(unsigned long x)
+{
+ unsigned long y = x - __START_KERNEL_map;
+
+ /* use the carry flag to determine if x was < __START_KERNEL_map */
+ x = y + ((x > y) ? phys_base : (__START_KERNEL_map - PAGE_OFFSET));
+
+ return x;
+}
+
+#ifdef CONFIG_DEBUG_VIRTUAL
extern unsigned long __phys_addr(unsigned long);
+#else
+#define __phys_addr(x) __phys_addr_nodebug(x)
+#endif
#define __phys_reloc_hide(x) (x)
OpenPOWER on IntegriCloud