aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/page.h
diff options
context:
space:
mode:
authorFranck Bui-Huu <vagabon.xyz@gmail.com>2006-10-19 07:20:02 -0400
committerRalf Baechle <ralf@linux-mips.org>2006-11-29 20:14:41 -0500
commit8431fd094d625b94d364fe393076ccef88e6ce18 (patch)
treea6f34ac5f87f437b99d82f449849086539e2ed9c /include/asm-mips/page.h
parentd4df6d4e7a66b7a9bd57f5dc7d80d6b55dc12dbb (diff)
[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 <fbuihuu@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips/page.h')
-rw-r--r--include/asm-mips/page.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index c3b13dedf21a..0dc1a45c27ed 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -142,6 +142,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
142#define __pa_page_offset(x) PAGE_OFFSET 142#define __pa_page_offset(x) PAGE_OFFSET
143#endif 143#endif
144#define __pa(x) ((unsigned long)(x) - __pa_page_offset(x)) 144#define __pa(x) ((unsigned long)(x) - __pa_page_offset(x))
145#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0))
145#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET)) 146#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET))
146 147
147#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 148#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)