diff --git a/sonoPciDrv.c b/sonoPciDrv.c index 52b0f31..3f304a5 100644 --- a/sonoPciDrv.c +++ b/sonoPciDrv.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -179,7 +180,13 @@ static int sono_bar_mmap(struct file *filp, struct vm_area_struct *vma) if(vsize > bar_size) return -EINVAL; - vma->vm_flags |= VM_IO; + + #if LINUX_VERSION_CODE <= KERNEL_VERSION(5,4,0) + vma->vm_flags |= VM_IO;// ubuntu 14 + #elif LINUX_VERSION_CODE <= KERNEL_VERSION(6,8,0) + vm_flags_set(vma, VM_IO); + #endif + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); int res = remap_pfn_range(vma, vma->vm_start, physical >> PAGE_SHIFT, vsize, vma->vm_page_prot); if(res)