|
@ -1,4 +1,5 @@ |
|
|
#include <linux/module.h> |
|
|
#include <linux/module.h> |
|
|
|
|
|
#include <linux/version.h> |
|
|
#include <linux/proc_fs.h> |
|
|
#include <linux/proc_fs.h> |
|
|
#include <linux/cdev.h> |
|
|
#include <linux/cdev.h> |
|
|
#include <linux/pci.h> |
|
|
#include <linux/pci.h> |
|
@ -179,7 +180,13 @@ static int sono_bar_mmap(struct file *filp, struct vm_area_struct *vma) |
|
|
if(vsize > bar_size) |
|
|
if(vsize > bar_size) |
|
|
return -EINVAL; |
|
|
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); |
|
|
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); |
|
|
int res = remap_pfn_range(vma, vma->vm_start, physical >> PAGE_SHIFT, vsize, vma->vm_page_prot); |
|
|
if(res) |
|
|
if(res) |
|
|