diff options
author | jhb <jhb@FreeBSD.org> | 2005-04-01 20:00:11 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-04-01 20:00:11 +0000 |
commit | a3c6b782c3ed4abd939e54896eed4b89f4d18d21 (patch) | |
tree | c33b91d98e8867bbb1f42b28ab23638d2003f368 /sys/i386/ibcs2/imgact_coff.c | |
parent | 9683bbdf3f053a2b65d3ac11aac7a2eec86c559b (diff) | |
download | FreeBSD-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/ibcs2/imgact_coff.c')
-rw-r--r-- | sys/i386/ibcs2/imgact_coff.c | 14 |
1 files changed, 9 insertions, 5 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; |