summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2023-04-10 12:20:21 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2023-04-10 12:20:21 +0800
commit50dc222bdda14454cc596fa4e057ac4b374c4dbc (patch)
tree56f81510ee94c37f1f159167679054638bdcd663
parentde171f0fad4ec02d98d575e0936ddb6dbe292b1b (diff)
downloadomap-modules-50dc222bdda14454cc596fa4e057ac4b374c4dbc.tar.gz
vm_flags: fix build error with wrapper function
as suggested by the following commits: 1c71222e5f23 ("mm: replace vma->vm_flags direct modifications with modifier calls") e430a95a04ef ("mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK") bc292ab00f6c ("mm: introduce vma->vm_flags wrapper functions") Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org> Change-Id: Ia9c000e7ca168289ae8291945d5ebd3243ea72fe
-rw-r--r--pvr/services4/srvkm/env/linux/mmap.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/pvr/services4/srvkm/env/linux/mmap.c b/pvr/services4/srvkm/env/linux/mmap.c
index 0c3fe26..7a0e867 100644
--- a/pvr/services4/srvkm/env/linux/mmap.c
+++ b/pvr/services4/srvkm/env/linux/mmap.c
@@ -757,7 +757,7 @@ DoMapToUser(LinuxMemArea *psLinuxMemArea,
#if defined(PVR_MAKE_ALL_PFNS_SPECIAL)
if (bMixedMap)
{
- ps_vma->vm_flags |= VM_MIXEDMAP;
+ vm_flags_set(ps_vma, VM_MIXEDMAP);
}
#endif
/* Second pass, get the page structures and insert the pages */
@@ -1081,6 +1081,7 @@ PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma)
PVR_DPF((PVR_DBG_MESSAGE, "%s: Mapped psLinuxMemArea 0x%p\n",
__FUNCTION__, psOffsetStruct->psLinuxMemArea));
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,2,0))
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
/* This is probably superfluous and implied by VM_IO */
ps_vma->vm_flags |= VM_RESERVED;
@@ -1088,7 +1089,6 @@ PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma)
ps_vma->vm_flags |= VM_DONTDUMP;
#endif
ps_vma->vm_flags |= VM_IO;
-
/*
* Disable mremap because our nopage handler assumes all
* page requests have already been validated.
@@ -1098,6 +1098,14 @@ PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma)
/* Don't allow mapping to be inherited across a process fork */
ps_vma->vm_flags |= VM_DONTCOPY;
+#else
+ /* version newer than 6.2.0, because of the following changes
+ 1c71222e5f23 mm: replace vma->vm_flags direct modifications with modifier calls
+ e430a95a04ef mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK
+ bc292ab00f6c mm: introduce vma->vm_flags wrapper functions
+ */
+ vm_flags_set(ps_vma, VM_DONTDUMP | VM_IO | VM_DONTEXPAND | VM_DONTCOPY);
+#endif
ps_vma->vm_private_data = (void *)psOffsetStruct;
switch(psOffsetStruct->psLinuxMemArea->ui32AreaFlags & PVRSRV_HAP_CACHETYPE_MASK)