--- arch/x86_64/mm/ioremap.c | 1 - arch/x86_64/mm/pat.c | 13 +++++++++++++ include/asm-i386/pgtable.h | 8 +++++--- include/asm-x86_64/pgtable.h | 5 +++-- 4 files changed, 21 insertions(+), 6 deletions(-) Index: linux/arch/x86_64/mm/ioremap.c =================================================================== --- linux.orig/arch/x86_64/mm/ioremap.c +++ linux/arch/x86_64/mm/ioremap.c @@ -204,4 +204,3 @@ void iounmap(volatile void __iomem *addr kfree(p); } EXPORT_SYMBOL(iounmap); - Index: linux/arch/x86_64/mm/pat.c =================================================================== --- linux.orig/arch/x86_64/mm/pat.c +++ linux/arch/x86_64/mm/pat.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -288,3 +289,15 @@ void unmap_devmem(unsigned long pfn, uns free_mattr(addr, size, -1L); } +int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long vaddr, + unsigned long pfn, unsigned long size, + pgprot_t prot) +{ + int err; + /* needed? */ + vma->vm_pgoff = pfn; + vma->vm_page_prot = prot; + err = reserve_mattr_vma(vma); + return err ? err : remap_pfn_range(vma, vaddr, pfn, size, prot); +} +EXPORT_SYMBOL(io_remap_pfn_range); Index: linux/include/asm-x86_64/pgtable.h =================================================================== --- linux.orig/include/asm-x86_64/pgtable.h +++ linux/include/asm-x86_64/pgtable.h @@ -445,8 +445,9 @@ void vmalloc_sync_all(void); extern int kern_addr_valid(unsigned long addr); -#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ - remap_pfn_range(vma, vaddr, pfn, size, prot) +extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long vaddr, + unsigned long pfn, unsigned long size, + pgprot_t prot); #define MK_IOSPACE_PFN(space, pfn) (pfn) #define GET_IOSPACE(pfn) 0 Index: linux/include/asm-i386/pgtable.h =================================================================== --- linux.orig/include/asm-i386/pgtable.h +++ linux/include/asm-i386/pgtable.h @@ -514,15 +514,17 @@ do { \ * tables contain all the necessary information. */ #define update_mmu_cache(vma,address,pte) do { } while (0) + +extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long vaddr, + unsigned long pfn, unsigned long size, + pgprot_t prot); + #endif /* !__ASSEMBLY__ */ #ifdef CONFIG_FLATMEM #define kern_addr_valid(addr) (1) #endif /* CONFIG_FLATMEM */ -#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ - remap_pfn_range(vma, vaddr, pfn, size, prot) - #define MK_IOSPACE_PFN(space, pfn) (pfn) #define GET_IOSPACE(pfn) 0 #define GET_PFN(pfn) (pfn)