]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[MIPS] Introduce __pa_symbol()
authorFranck Bui-Huu <vagabon.xyz@gmail.com>
Thu, 19 Oct 2006 11:20:02 +0000 (13:20 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 30 Nov 2006 01:14:41 +0000 (01:14 +0000)
This patch introduces __pa_symbol() macro which should be used to
calculate the physical address of kernel symbols. It also relies
on RELOC_HIDE() to avoid any compiler's oddities when doing
arithmetics on symbols.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
include/asm-mips/page.h

index c3b13dedf21af574abfba586985cd6721d37f47e..0dc1a45c27eda52d0080ae10aecad2e36f33dcb6 100644 (file)
@@ -142,6 +142,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
 #define __pa_page_offset(x)    PAGE_OFFSET
 #endif
 #define __pa(x)                        ((unsigned long)(x) - __pa_page_offset(x))
+#define __pa_symbol(x)         __pa(RELOC_HIDE((unsigned long)(x),0))
 #define __va(x)                        ((void *)((unsigned long)(x) + PAGE_OFFSET))
 
 #define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)