From: Franck Bui-Huu Date: Thu, 19 Oct 2006 11:20:02 +0000 (+0200) Subject: [MIPS] Introduce __pa_symbol() X-Git-Tag: v2.6.20-rc1~34^2~40^2~469^2~27 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8431fd094d625b94d364fe393076ccef88e6ce18;p=linux-2.6 [MIPS] Introduce __pa_symbol() 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 Signed-off-by: Ralf Baechle --- diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index c3b13dedf2..0dc1a45c27 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h @@ -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)