summaryrefslogtreecommitdiffstats
path: root/sys/i386
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/i386
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/i386')
-rw-r--r--sys/i386/ibcs2/imgact_coff.c14
-rw-r--r--sys/i386/linux/imgact_linux.c7
2 files changed, 13 insertions, 8 deletions
diff --git a/sys/i386/ibcs2/imgact_coff.c b/sys/i386/ibcs2/imgact_coff.c
index 226d1e9..b6c6cae 100644
--- a/sys/i386/ibcs2/imgact_coff.c
+++ b/sys/i386/ibcs2/imgact_coff.c
@@ -91,7 +91,7 @@ load_coff_section(struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset,
}
DPRINTF(("%s(%d): vm_mmap(&vmspace->vm_map, &0x%08lx, 0x%x, 0x%x, "
- "VM_PROT_ALL, MAP_PRIVATE | MAP_FIXED, vp, 0x%x)\n",
+ "VM_PROT_ALL, MAP_PRIVATE | MAP_FIXED, OBJT_VNODE, vp, 0x%x)\n",
__FILE__, __LINE__, map_addr, map_len, prot, map_offset));
if ((error = vm_mmap(&vmspace->vm_map,
@@ -100,7 +100,8 @@ load_coff_section(struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset,
prot,
VM_PROT_ALL,
MAP_PRIVATE | MAP_FIXED,
- (caddr_t) vp,
+ OBJT_VNODE,
+ vp,
map_offset)) != 0)
return error;
@@ -136,7 +137,8 @@ load_coff_section(struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset,
VM_PROT_READ,
VM_PROT_READ,
0,
- (caddr_t) vp,
+ OBJT_VNODE,
+ vp,
trunc_page(offset + filsz))) != 0)
return error;
@@ -215,7 +217,8 @@ coff_load_file(struct thread *td, char *name)
VM_PROT_READ,
VM_PROT_READ,
0,
- (caddr_t) vp,
+ OBJT_VNODE,
+ vp,
0)) != 0)
goto unlocked_fail;
@@ -372,7 +375,8 @@ exec_coff_imgact(imgp)
VM_PROT_READ,
VM_PROT_READ,
0,
- (caddr_t) imgp->vp,
+ OBJT_VNODE,
+ imgp->vp,
foff)) != 0) {
error = ENOEXEC;
goto fail;
diff --git a/sys/i386/linux/imgact_linux.c b/sys/i386/linux/imgact_linux.c
index 50e40bf..cfc28e9 100644
--- a/sys/i386/linux/imgact_linux.c
+++ b/sys/i386/linux/imgact_linux.c
@@ -143,8 +143,8 @@ exec_linux_imgact(struct image_params *imgp)
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) imgp->vp, trunc_page(file_offset));
+ VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE,
+ imgp->vp, trunc_page(file_offset));
if (error)
goto fail;
@@ -181,7 +181,8 @@ exec_linux_imgact(struct image_params *imgp)
VM_PROT_READ | VM_PROT_EXECUTE,
VM_PROT_ALL,
MAP_PRIVATE | MAP_FIXED,
- (caddr_t)imgp->vp, file_offset);
+ OBJT_VNODE,
+ imgp->vp, file_offset);
if (error)
goto fail;
OpenPOWER on IntegriCloud