From 8e3a88b3bd7e62b6b1cde6a2de1e9f2e3d95804b Mon Sep 17 00:00:00 2001 From: piernov Date: Wed, 3 May 2023 11:31:20 +0200 Subject: [PATCH] oscdriver: Fix for linux 6.3.0 --- src/oscdriver/oscdriver.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/oscdriver/oscdriver.c b/src/oscdriver/oscdriver.c index c765f37..ed0791d 100644 --- a/src/oscdriver/oscdriver.c +++ b/src/oscdriver/oscdriver.c @@ -1769,7 +1769,11 @@ static struct vm_operations_struct mmap_vm_ops_m = static int op_mmap_m(struct file *filp, struct vm_area_struct *vma) { vma->vm_ops = &mmap_vm_ops_m; +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) vma->vm_flags |= VM_RESERVED; +#else + vm_flags_set(vma, VM_RESERVED); +#endif vma->vm_private_data = filp->private_data; mmap_open_m(vma); // printk("op_mmap\n"); @@ -1848,7 +1852,11 @@ static struct vm_operations_struct mmap_vm_ops_tb = static int op_mmap_tb(struct file *filp, struct vm_area_struct *vma) { vma->vm_ops = &mmap_vm_ops_tb; +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) vma->vm_flags |= VM_RESERVED; +#else + vm_flags_set(vma, VM_RESERVED); +#endif vma->vm_private_data = filp->private_data; mmap_open_tb(vma); // printk("op_mmap\n"); @@ -1927,7 +1935,11 @@ static struct vm_operations_struct mmap_vm_ops_mdb = int op_mmap_mdb(struct file *filp, struct vm_area_struct *vma) { vma->vm_ops = &mmap_vm_ops_mdb; +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) vma->vm_flags |= VM_RESERVED; +#else + vm_flags_set(vma, VM_RESERVED); +#endif vma->vm_private_data = filp->private_data; mmap_open_mdb(vma); // printk("op_mmap\n");