summaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/ioremap_32.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-01-30 13:34:05 +0100
committerIngo Molnar <mingo@elte.hu>2008-01-30 13:34:05 +0100
commit240d3a7c47e3fb9c2533f63e9e323a25d91d0643 (patch)
tree133f2b2bb45eb70cdc9e694db12a0a1c8ac81d4c /arch/x86/mm/ioremap_32.c
parente4c1b977f0036c00ebabb60375cb63d0de9d43fa (diff)
x86: unify ioremap
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/ioremap_32.c')
-rw-r--r--arch/x86/mm/ioremap_32.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/mm/ioremap_32.c b/arch/x86/mm/ioremap_32.c
index 4d919c37d1d..f4a2082568c 100644
--- a/arch/x86/mm/ioremap_32.c
+++ b/arch/x86/mm/ioremap_32.c
@@ -19,6 +19,18 @@
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
+#ifdef CONFIG_X86_64
+
+unsigned long __phys_addr(unsigned long x)
+{
+ if (x >= __START_KERNEL_map)
+ return x - __START_KERNEL_map + phys_base;
+ return x - PAGE_OFFSET;
+}
+EXPORT_SYMBOL(__phys_addr);
+
+#endif
+
/*
* Fix up the linear direct mapping of the kernel to avoid cache attribute
* conflicts.
@@ -49,6 +61,7 @@ static int ioremap_change_attr(unsigned long phys_addr, unsigned long size,
* memmap entry.
*/
err = change_page_attr_addr(vaddr, npages, prot);
+
if (!err)
global_flush_tlb();
@@ -83,6 +96,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
if (phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS)
return (__force void __iomem *)phys_to_virt(phys_addr);
+#ifdef CONFIG_X86_32
/*
* Don't allow anybody to remap normal RAM that we're using..
*/
@@ -98,6 +112,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
if (!PageReserved(page))
return NULL;
}
+#endif
pgprot = MAKE_GLOBAL(__PAGE_KERNEL | flags);
@@ -211,6 +226,7 @@ void iounmap(volatile void __iomem *addr)
}
EXPORT_SYMBOL(iounmap);
+#ifdef CONFIG_X86_32
int __initdata early_ioremap_debug;
@@ -443,3 +459,5 @@ void __this_fixmap_does_not_exist(void)
{
WARN_ON(1);
}
+
+#endif /* CONFIG_X86_32 */