aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-i386
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2006-12-06 20:14:03 -0500
committerAndi Kleen <andi@basil.nowhere.org>2006-12-06 20:14:03 -0500
commit9f45accf17efc050ba26bf77cc4f166c950b284e (patch)
tree1ea566184cfa02f4a1dd5e2643ad2d999f398f0f /include/asm-i386
parent6ed018845f1172cdc94f8a20ad807df901c6b7eb (diff)
[PATCH] i386: define __pa_symbol()
On x86_64 we have to be careful with calculating the physical address of kernel symbols. Both because of compiler odditities and because the symbols live in a different range of the virtual address space. Having a defintition of __pa_symbol that works on both x86_64 and i386 simplifies writing code that works for both x86_64 and i386 that has these kinds of dependencies. So this patch adds the trivial i386 __pa_symbol definition. Added assembly magic similar to RELOC_HIDE as suggested by Andi Kleen. Just picked it up from x86_64. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'include/asm-i386')
-rw-r--r--include/asm-i386/page.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index f5bf544c729a..5a70501291d6 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -124,6 +124,9 @@ extern int page_is_ram(unsigned long pagenr);
124#define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE) 124#define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE)
125#define MAXMEM (-__PAGE_OFFSET-__VMALLOC_RESERVE) 125#define MAXMEM (-__PAGE_OFFSET-__VMALLOC_RESERVE)
126#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) 126#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
127/* __pa_symbol should be used for C visible symbols.
128 This seems to be the official gcc blessed way to do such arithmetic. */
129#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0))
127#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) 130#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
128#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 131#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
129#ifdef CONFIG_FLATMEM 132#ifdef CONFIG_FLATMEM