summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_misc.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-04-01 20:00:11 +0000
committerjhb <jhb@FreeBSD.org>2005-04-01 20:00:11 +0000
commita3c6b782c3ed4abd939e54896eed4b89f4d18d21 (patch)
treec33b91d98e8867bbb1f42b28ab23638d2003f368 /sys/compat/linux/linux_misc.c
parent9683bbdf3f053a2b65d3ac11aac7a2eec86c559b (diff)
downloadFreeBSD-src-a3c6b782c3ed4abd939e54896eed4b89f4d18d21.zip
FreeBSD-src-a3c6b782c3ed4abd939e54896eed4b89f4d18d21.tar.gz
- Change the vm_mmap() function to accept an objtype_t parameter specifying
the type of object represented by the handle argument. - Allow vm_mmap() to map device memory via cdev objects in addition to vnodes and anonymous memory. Note that mmaping a cdev directly does not currently perform any MAC checks like mapping a vnode does. - Unbreak the DRM getbufs ioctl by having it call vm_mmap() directly on the cdev the ioctl is acting on rather than trying to find a suitable vnode to map from. Reviewed by: alc, arch@
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r--sys/compat/linux/linux_misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 7bbeaff..85cd13b 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -333,7 +333,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
/* Pull in executable header into kernel_map */
error = vm_mmap(kernel_map, (vm_offset_t *)&a_out, PAGE_SIZE,
- VM_PROT_READ, VM_PROT_READ, 0, (caddr_t)vp, 0);
+ VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, vp, 0);
/*
* Lock no longer needed
*/
@@ -422,7 +422,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
/* map file into kernel_map */
error = vm_mmap(kernel_map, &buffer,
round_page(a_out->a_text + a_out->a_data + file_offset),
- VM_PROT_READ, VM_PROT_READ, 0, (caddr_t)vp,
+ VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, vp,
trunc_page(file_offset));
if (error)
goto cleanup;
@@ -453,7 +453,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
*/
error = vm_mmap(&td->td_proc->p_vmspace->vm_map, &vmaddr,
a_out->a_text + a_out->a_data, VM_PROT_ALL, VM_PROT_ALL,
- MAP_PRIVATE | MAP_FIXED, (caddr_t)vp, file_offset);
+ MAP_PRIVATE | MAP_FIXED, OBJT_VNODE, vp, file_offset);
if (error)
goto cleanup;
}
OpenPOWER on IntegriCloud