From f18a6d836b5e0081dff9217b44e88e74c421c576 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Mon, 10 Dec 2001 23:29:37 +0000 Subject: merge with linux kernel 2.4.15 --- linux/drm_vm.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'linux/drm_vm.h') diff --git a/linux/drm_vm.h b/linux/drm_vm.h index 30b5b226..6803a57b 100644 --- a/linux/drm_vm.h +++ b/linux/drm_vm.h @@ -353,7 +353,12 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma) unlock_kernel(); vma->vm_ops = &DRM(vm_dma_ops); + +#if LINUX_VERSION_CODE <= 0x020414 vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */ +#else + vma->vm_flags |= VM_RESERVED; /* Don't swap */ +#endif vma->vm_file = filp; /* Needed for drm_vm_open() */ DRM(vm_open)(vma); @@ -479,17 +484,29 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) vma->vm_private_data = (void *)map; /* Don't let this area swap. Change when DRM_KERNEL advisory is supported. */ +#if LINUX_VERSION_CODE <= 0x020414 vma->vm_flags |= VM_LOCKED; +#else + vma->vm_flags |= VM_RESERVED; +#endif break; case _DRM_SCATTER_GATHER: vma->vm_ops = &DRM(vm_sg_ops); vma->vm_private_data = (void *)map; - vma->vm_flags |= VM_LOCKED; +#if LINUX_VERSION_CODE <= 0x020414 + vma->vm_flags |= VM_LOCKED; +#else + vma->vm_flags |= VM_RESERVED; +#endif break; default: return -EINVAL; /* This should never happen. */ } +#if LINUX_VERSION_CODE <= 0x020414 vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */ +#else + vma->vm_flags |= VM_RESERVED; /* Don't swap */ +#endif vma->vm_file = filp; /* Needed for drm_vm_open() */ DRM(vm_open)(vma); -- cgit v1.2.3