n_pages = size >> PAGE_SHIFT;
for(i=0;i<n_pages;i++){
- if(REMAP_PAGE_RANGE(vma, start, __pa(async->buf_page_list[i]),
+ if(remap_pfn_range(vma, start, __pa(async->buf_page_list[i]) >> PAGE_SHIFT,
PAGE_SIZE, PAGE_SHARED)){
return -EAGAIN;
}
#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 */