From bc857018aa8452c6cef10565490706264fe1aebf Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Tue, 15 Mar 2005 01:00:33 +0000 Subject: [PATCH] replace remap_page_range with remap_pfn_range --- comedi/comedi_fops.c | 2 +- include/linux/mm.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index df3a778e..c99f0576 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -1309,7 +1309,7 @@ static int comedi_mmap_v22(struct file * file, struct vm_area_struct *vma) n_pages = size >> PAGE_SHIFT; for(i=0;ibuf_page_list[i]), + if(remap_pfn_range(vma, start, __pa(async->buf_page_list[i]) >> PAGE_SHIFT, PAGE_SIZE, PAGE_SHARED)){ return -EAGAIN; } diff --git a/include/linux/mm.h b/include/linux/mm.h index aabaccfc..4c19bc6a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -28,6 +28,15 @@ #define REMAP_PAGE_RANGE(a,b,c,d,e) remap_page_range(a,b,c,d,e) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) +static inline int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, + unsigned long pfn, unsigned long size, pgprot_t prot) +{ + return REMAP_PAGE_RANGE(vma, from, pfn << PAGE_SHIFT, size, prot); +}; + +#endif + #endif /* _COMPAT_MM_H */ -- 2.26.2