|
@@ -213,7 +213,7 @@ extern const void *__pv_table_begin, *__pv_table_end;
|
|
|
: "r" (x), "I" (__PV_BITS_31_24) \
|
|
|
: "cc")
|
|
|
|
|
|
-static inline phys_addr_t __virt_to_phys(unsigned long x)
|
|
|
+static inline phys_addr_t __virt_to_phys_nodebug(unsigned long x)
|
|
|
{
|
|
|
phys_addr_t t;
|
|
|
|
|
@@ -245,7 +245,7 @@ static inline unsigned long __phys_to_virt(phys_addr_t x)
|
|
|
#define PHYS_OFFSET PLAT_PHYS_OFFSET
|
|
|
#define PHYS_PFN_OFFSET ((unsigned long)(PHYS_OFFSET >> PAGE_SHIFT))
|
|
|
|
|
|
-static inline phys_addr_t __virt_to_phys(unsigned long x)
|
|
|
+static inline phys_addr_t __virt_to_phys_nodebug(unsigned long x)
|
|
|
{
|
|
|
return (phys_addr_t)x - PAGE_OFFSET + PHYS_OFFSET;
|
|
|
}
|
|
@@ -261,6 +261,16 @@ static inline unsigned long __phys_to_virt(phys_addr_t x)
|
|
|
((((unsigned long)(kaddr) - PAGE_OFFSET) >> PAGE_SHIFT) + \
|
|
|
PHYS_PFN_OFFSET)
|
|
|
|
|
|
+#define __pa_symbol_nodebug(x) __virt_to_phys_nodebug((x))
|
|
|
+
|
|
|
+#ifdef CONFIG_DEBUG_VIRTUAL
|
|
|
+extern phys_addr_t __virt_to_phys(unsigned long x);
|
|
|
+extern phys_addr_t __phys_addr_symbol(unsigned long x);
|
|
|
+#else
|
|
|
+#define __virt_to_phys(x) __virt_to_phys_nodebug(x)
|
|
|
+#define __phys_addr_symbol(x) __pa_symbol_nodebug(x)
|
|
|
+#endif
|
|
|
+
|
|
|
/*
|
|
|
* These are *only* valid on the kernel direct mapped RAM memory.
|
|
|
* Note: Drivers should NOT use these. They are the wrong
|
|
@@ -283,6 +293,7 @@ static inline void *phys_to_virt(phys_addr_t x)
|
|
|
* Drivers should NOT use these either.
|
|
|
*/
|
|
|
#define __pa(x) __virt_to_phys((unsigned long)(x))
|
|
|
+#define __pa_symbol(x) __phys_addr_symbol(RELOC_HIDE((unsigned long)(x), 0))
|
|
|
#define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x)))
|
|
|
#define pfn_to_kaddr(pfn) __va((phys_addr_t)(pfn) << PAGE_SHIFT)
|
|
|
|