diff options
Diffstat (limited to 'arch/x86/mm/ioremap_32.c')
-rw-r--r-- | arch/x86/mm/ioremap_32.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/mm/ioremap_32.c b/arch/x86/mm/ioremap_32.c index 4d919c37d1d6..f4a2082568c8 100644 --- a/arch/x86/mm/ioremap_32.c +++ b/arch/x86/mm/ioremap_32.c | |||
@@ -19,6 +19,18 @@ | |||
19 | #include <asm/pgtable.h> | 19 | #include <asm/pgtable.h> |
20 | #include <asm/tlbflush.h> | 20 | #include <asm/tlbflush.h> |
21 | 21 | ||
22 | #ifdef CONFIG_X86_64 | ||
23 | |||
24 | unsigned long __phys_addr(unsigned long x) | ||
25 | { | ||
26 | if (x >= __START_KERNEL_map) | ||
27 | return x - __START_KERNEL_map + phys_base; | ||
28 | return x - PAGE_OFFSET; | ||
29 | } | ||
30 | EXPORT_SYMBOL(__phys_addr); | ||
31 | |||
32 | #endif | ||
33 | |||
22 | /* | 34 | /* |
23 | * Fix up the linear direct mapping of the kernel to avoid cache attribute | 35 | * Fix up the linear direct mapping of the kernel to avoid cache attribute |
24 | * conflicts. | 36 | * conflicts. |
@@ -49,6 +61,7 @@ static int ioremap_change_attr(unsigned long phys_addr, unsigned long size, | |||
49 | * memmap entry. | 61 | * memmap entry. |
50 | */ | 62 | */ |
51 | err = change_page_attr_addr(vaddr, npages, prot); | 63 | err = change_page_attr_addr(vaddr, npages, prot); |
64 | |||
52 | if (!err) | 65 | if (!err) |
53 | global_flush_tlb(); | 66 | global_flush_tlb(); |
54 | 67 | ||
@@ -83,6 +96,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, | |||
83 | if (phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS) | 96 | if (phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS) |
84 | return (__force void __iomem *)phys_to_virt(phys_addr); | 97 | return (__force void __iomem *)phys_to_virt(phys_addr); |
85 | 98 | ||
99 | #ifdef CONFIG_X86_32 | ||
86 | /* | 100 | /* |
87 | * Don't allow anybody to remap normal RAM that we're using.. | 101 | * Don't allow anybody to remap normal RAM that we're using.. |
88 | */ | 102 | */ |
@@ -98,6 +112,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, | |||
98 | if (!PageReserved(page)) | 112 | if (!PageReserved(page)) |
99 | return NULL; | 113 | return NULL; |
100 | } | 114 | } |
115 | #endif | ||
101 | 116 | ||
102 | pgprot = MAKE_GLOBAL(__PAGE_KERNEL | flags); | 117 | pgprot = MAKE_GLOBAL(__PAGE_KERNEL | flags); |
103 | 118 | ||
@@ -211,6 +226,7 @@ void iounmap(volatile void __iomem *addr) | |||
211 | } | 226 | } |
212 | EXPORT_SYMBOL(iounmap); | 227 | EXPORT_SYMBOL(iounmap); |
213 | 228 | ||
229 | #ifdef CONFIG_X86_32 | ||
214 | 230 | ||
215 | int __initdata early_ioremap_debug; | 231 | int __initdata early_ioremap_debug; |
216 | 232 | ||
@@ -443,3 +459,5 @@ void __this_fixmap_does_not_exist(void) | |||
443 | { | 459 | { |
444 | WARN_ON(1); | 460 | WARN_ON(1); |
445 | } | 461 | } |
462 | |||
463 | #endif /* CONFIG_X86_32 */ | ||