]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/mm/iomap_32.c
Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2
[linux-2.6-omap-h63xx.git] / arch / x86 / mm / iomap_32.c
index d5e28424622c10ab123eb5a34df7a1e41c92e29c..04102d42ff4250873a519620958855e9b50770ff 100644 (file)
 #include <asm/pat.h>
 #include <linux/module.h>
 
-#ifdef CONFIG_X86_PAE
-static int
-is_io_mapping_possible(resource_size_t base, unsigned long size)
-{
-       return 1;
-}
-#else
-static int
-is_io_mapping_possible(resource_size_t base, unsigned long size)
+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;
-
-       return 1;
-}
 #endif
-
-int
-reserve_io_memtype_wc(u64 base, unsigned long size, pgprot_t *prot)
-{
-       unsigned long ret_flag;
-
-       if (!is_io_mapping_possible(base, size))
-               goto out_err;
-
-       if (!pat_enabled) {
-               *prot = pgprot_noncached(PAGE_KERNEL);
-               return 0;
-       }
-
-       if (reserve_memtype(base, base + size, _PAGE_CACHE_WC, &ret_flag))
-               goto out_err;
-
-       if (ret_flag == _PAGE_CACHE_WB)
-               goto out_free;
-
-       if (kernel_map_sync_memtype(base, size, ret_flag))
-               goto out_free;
-
-       *prot = __pgprot(__PAGE_KERNEL | ret_flag);
-       return 0;
-
-out_free:
-       free_memtype(base, base + size);
-out_err:
-       return -EINVAL;
-}
-EXPORT_SYMBOL_GPL(reserve_io_memtype_wc);
-
-void
-free_io_memtype(u64 base, unsigned long size)
-{
-       if (pat_enabled)
-               free_memtype(base, base + size);
+       return 1;
 }
-EXPORT_SYMBOL_GPL(free_io_memtype);
+EXPORT_SYMBOL_GPL(is_io_mapping_possible);
 
 /* Map 'pfn' using fixed map 'type' and protections 'prot'
  */