diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-03-17 09:28:13 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-03-17 09:28:13 +0100 |
commit | 37ba1b62836d2440980cf553c49556393b05c6cd (patch) | |
tree | 3bbd9b76117d484d5a624db1b2b9ec0181c7ff55 /arch/x86/mm/iomap_32.c | |
parent | 1713c0d508fbbb42aa5f90039195e5ac31a50625 (diff) | |
parent | dde332b660cf0bc2baaba678b52768a0fb6e6da2 (diff) |
Merge branch 'fix/opl3sa2-suspend' into topic/isa-misc
Diffstat (limited to 'arch/x86/mm/iomap_32.c')
-rw-r--r-- | arch/x86/mm/iomap_32.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c index d0151d8ce45..04102d42ff4 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c @@ -17,8 +17,20 @@ */ #include <asm/iomap.h> +#include <asm/pat.h> #include <linux/module.h> +int is_io_mapping_possible(resource_size_t base, unsigned long size) +{ +#ifndef CONFIG_X86_PAE + /* There is no way to map greater than 1 << 32 address without PAE */ + if (base + size > 0x100000000ULL) + return 0; +#endif + return 1; +} +EXPORT_SYMBOL_GPL(is_io_mapping_possible); + /* Map 'pfn' using fixed map 'type' and protections 'prot' */ void * @@ -29,6 +41,15 @@ iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot) pagefault_disable(); + /* + * For non-PAT systems, promote PAGE_KERNEL_WC to PAGE_KERNEL_UC_MINUS. + * PAGE_KERNEL_WC maps to PWT, which translates to uncached if the + * MTRR is UC or WC. UC_MINUS gets the real intention, of the + * user, which is "WC if the MTRR is WC, UC if you can't do that." + */ + if (!pat_enabled && pgprot_val(prot) == pgprot_val(PAGE_KERNEL_WC)) + prot = PAGE_KERNEL_UC_MINUS; + idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); set_pte(kmap_pte-idx, pfn_pte(pfn, prot)); |