Skip to content

Commit

Permalink
use vm_flags_set() on kernels 6.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinko Kocevar authored and jerzyjamroz committed Jun 20, 2024
1 parent acbff79 commit 4fdac7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mrmShared/linux/uio_mrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ int mrf_mmap_physical(struct uio_info *info, struct vm_area_struct *vma)
return -EINVAL;
}

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0))
vm_flags_set(vma, VM_IO | VM_RESERVED);
#else
vma->vm_flags |= VM_IO | VM_RESERVED;
#endif
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);

return remap_pfn_range(vma,
Expand Down

0 comments on commit 4fdac7c

Please sign in to comment.