mcctrl rus_mmap: make vma->vm_flags arch-dependent
[Dominique: renamed arch_vm_flags to arch_rus_vm_flags] Change-Id: I5ec89b3ff80af6bf0ede342eb5816df8c78de348 Fujitsu: POSTK_DEBUG_ARCH_DEP_100
This commit is contained in:
@ -13,4 +13,10 @@ static inline bool pte_is_write_combined(pte_t pte)
|
||||
return ((pte_val(pte) & PTE_ATTRINDX_MASK) == PFN_WRITE_COMBINED);
|
||||
}
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_12 */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
|
||||
static const unsigned long arch_rus_vm_flags = VM_RESERVED | VM_MIXEDMAP | VM_EXEC;
|
||||
#else
|
||||
static const unsigned long arch_rus_vm_flags = VM_DONTDUMP | VM_MIXEDMAP | VM_EXEC;
|
||||
#endif
|
||||
#endif /* __HEADER_MCCTRL_ARM64_ARCHDEPS_H */
|
||||
|
||||
@ -13,4 +13,10 @@ static inline bool pte_is_write_combined(pte_t pte)
|
||||
return ((pte_flags(pte) & _PAGE_PWT) && !(pte_flags(pte) & _PAGE_PCD));
|
||||
}
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_12 */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
|
||||
static const unsigned long arch_rus_vm_flags = VM_RESERVED | VM_MIXEDMAP;
|
||||
#else
|
||||
static const unsigned long arch_rus_vm_flags = VM_DONTDUMP | VM_MIXEDMAP;
|
||||
#endif
|
||||
#endif /* __HEADER_MCCTRL_X86_64_ARCHDEPS_H */
|
||||
|
||||
@ -910,13 +910,7 @@ static struct vm_operations_struct rus_vmops = {
|
||||
|
||||
static int rus_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
|
||||
// vma->vm_flags |= VM_RESERVED | VM_DONTEXPAND | VM_MIXEDMAP;
|
||||
vma->vm_flags |= VM_RESERVED | VM_MIXEDMAP;
|
||||
#else
|
||||
// vma->vm_flags |= VM_DONTDUMP | VM_DONTEXPAND | VM_MIXEDMAP;
|
||||
vma->vm_flags |= VM_DONTDUMP | VM_MIXEDMAP;
|
||||
#endif
|
||||
vma->vm_flags |= arch_rus_vm_flags;
|
||||
vma->vm_ops = &rus_vmops;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user