diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2014-07-02 06:09:50 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2014-07-02 06:09:50 +0000 |
commit | 34082dd8dc0dff512e6eb8f423c7b593954daa20 (patch) | |
tree | 2a5910578af31af9b1a65e7bfb6969f408dafd6b | |
parent | 96ceff8aaefb8ebfd41840f7f1e355b8db2f5660 (diff) |
Use real parameter types for u{dv,vn}_attach() instead of void *
ok guenther
-rw-r--r-- | share/man/man9/uvm.9 | 8 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_drv.c | 5 | ||||
-rw-r--r-- | sys/kern/exec_subr.c | 4 | ||||
-rw-r--r-- | sys/uvm/uvm_device.c | 7 | ||||
-rw-r--r-- | sys/uvm/uvm_device.h | 6 | ||||
-rw-r--r-- | sys/uvm/uvm_extern.h | 4 | ||||
-rw-r--r-- | sys/uvm/uvm_mmap.c | 8 | ||||
-rw-r--r-- | sys/uvm/uvm_vnode.c | 5 |
8 files changed, 22 insertions, 25 deletions
diff --git a/share/man/man9/uvm.9 b/share/man/man9/uvm.9 index e6adf25b83a..a2065943e2e 100644 --- a/share/man/man9/uvm.9 +++ b/share/man/man9/uvm.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: uvm.9,v 1.55 2014/06/30 21:48:09 matthew Exp $ +.\" $OpenBSD: uvm.9,v 1.56 2014/07/02 06:09:49 matthew Exp $ .\" $NetBSD: uvm.9,v 1.14 2000/06/29 06:08:44 mrg Exp $ .\" .\" Copyright (c) 1998 Matthew R. Green @@ -30,7 +30,7 @@ .\" XXX this manual sets nS to 1 or 0 in the description, to obtain .\" synopsis-like function prototypes. any better way? .\" -.Dd $Mdocdate: June 30 2014 $ +.Dd $Mdocdate: July 2 2014 $ .Dt UVM 9 .Os .Sh NAME @@ -439,7 +439,7 @@ returns a standard errno. .Sh MEMORY MAPPING FILES AND DEVICES .nr nS 1 .Ft struct uvm_object * -.Fn uvn_attach "void *arg" "vm_prot_t accessprot" +.Fn uvn_attach "struct vnode *vp" "vm_prot_t accessprot" .Ft void .Fn uvm_vnp_setsize "struct vnode *vp" "voff_t newsize" .Ft void @@ -453,7 +453,7 @@ returns a standard errno. The .Fn uvn_attach function attaches a UVM object to vnode -.Fa arg , +.Fa vp , creating the object if necessary. The object is returned. .Pp diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index b6fa7932d1c..5a59329929f 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_drv.c,v 1.127 2014/04/07 06:43:11 jsg Exp $ */ +/* $OpenBSD: drm_drv.c,v 1.128 2014/07/02 06:09:49 matthew Exp $ */ /*- * Copyright 2007-2009 Owain G. Ainsworth <oga@openbsd.org> * Copyright © 2008 Intel Corporation @@ -1691,9 +1691,8 @@ out_free_list: } struct uvm_object * -udv_attach_drm(void *arg, vm_prot_t accessprot, voff_t off, vsize_t size) +udv_attach_drm(dev_t device, vm_prot_t accessprot, voff_t off, vsize_t size) { - dev_t device = *((dev_t *)arg); struct drm_device *dev = drm_get_device_from_kdev(device); struct drm_local_map *map; struct drm_gem_object *obj; diff --git a/sys/kern/exec_subr.c b/sys/kern/exec_subr.c index 45708838117..a7ba940a410 100644 --- a/sys/kern/exec_subr.c +++ b/sys/kern/exec_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_subr.c,v 1.33 2014/05/29 05:05:34 guenther Exp $ */ +/* $OpenBSD: exec_subr.c,v 1.34 2014/07/02 06:09:49 matthew Exp $ */ /* $NetBSD: exec_subr.c,v 1.9 1994/12/04 03:10:42 mycroft Exp $ */ /* @@ -187,7 +187,7 @@ vmcmd_map_pagedvn(struct proc *p, struct exec_vmcmd *cmd) * first, attach to the object */ - uobj = uvn_attach((void *)cmd->ev_vp, VM_PROT_READ|VM_PROT_EXECUTE); + uobj = uvn_attach(cmd->ev_vp, VM_PROT_READ|VM_PROT_EXECUTE); if (uobj == NULL) return (ENOMEM); diff --git a/sys/uvm/uvm_device.c b/sys/uvm/uvm_device.c index 0ec469c9692..0d0e4f28878 100644 --- a/sys/uvm/uvm_device.c +++ b/sys/uvm/uvm_device.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_device.c,v 1.45 2014/04/13 23:14:15 tedu Exp $ */ +/* $OpenBSD: uvm_device.c,v 1.46 2014/07/02 06:09:49 matthew Exp $ */ /* $NetBSD: uvm_device.c,v 1.30 2000/11/25 06:27:59 chs Exp $ */ /* @@ -97,9 +97,8 @@ struct uvm_pagerops uvm_deviceops = { * The last two arguments (off and size) are only used for access checking. */ struct uvm_object * -udv_attach(void *arg, vm_prot_t accessprot, voff_t off, vsize_t size) +udv_attach(dev_t device, vm_prot_t accessprot, voff_t off, vsize_t size) { - dev_t device = *((dev_t *)arg); struct uvm_device *udv, *lcv; paddr_t (*mapfn)(dev_t, off_t, int); #if NDRM > 0 @@ -118,7 +117,7 @@ udv_attach(void *arg, vm_prot_t accessprot, voff_t off, vsize_t size) return(NULL); #if NDRM > 0 - obj = udv_attach_drm(arg, accessprot, off, size); + obj = udv_attach_drm(device, accessprot, off, size); if (obj) return(obj); #endif diff --git a/sys/uvm/uvm_device.h b/sys/uvm/uvm_device.h index 03bc37df44f..3d15f446907 100644 --- a/sys/uvm/uvm_device.h +++ b/sys/uvm/uvm_device.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_device.h,v 1.9 2013/06/07 20:46:14 kettenis Exp $ */ +/* $OpenBSD: uvm_device.h,v 1.10 2014/07/02 06:09:49 matthew Exp $ */ /* $NetBSD: uvm_device.h,v 1.9 2000/05/28 10:21:55 drochner Exp $ */ /* @@ -70,8 +70,8 @@ struct uvm_device { * prototypes */ -struct uvm_object *udv_attach(void *, vm_prot_t, voff_t, vsize_t); -struct uvm_object *udv_attach_drm(void *, vm_prot_t, voff_t, vsize_t); +struct uvm_object *udv_attach(dev_t, vm_prot_t, voff_t, vsize_t); +struct uvm_object *udv_attach_drm(dev_t, vm_prot_t, voff_t, vsize_t); #endif /* _KERNEL */ diff --git a/sys/uvm/uvm_extern.h b/sys/uvm/uvm_extern.h index 42329bc9916..314c1b915e6 100644 --- a/sys/uvm/uvm_extern.h +++ b/sys/uvm/uvm_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_extern.h,v 1.116 2014/06/13 01:48:52 matthew Exp $ */ +/* $OpenBSD: uvm_extern.h,v 1.117 2014/07/02 06:09:49 matthew Exp $ */ /* $NetBSD: uvm_extern.h,v 1.57 2001/03/09 01:02:12 chs Exp $ */ /* @@ -739,7 +739,7 @@ void uvm_vnp_sync(struct mount *); void uvm_vnp_terminate(struct vnode *); /* terminate a uvm/uvn object */ boolean_t uvm_vnp_uncache(struct vnode *); -struct uvm_object *uvn_attach(void *, vm_prot_t); +struct uvm_object *uvn_attach(struct vnode *, vm_prot_t); /* kern_malloc.c */ void kmeminit_nkmempages(void); diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c index bed8ef9a896..5b85d5ee81b 100644 --- a/sys/uvm/uvm_mmap.c +++ b/sys/uvm/uvm_mmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_mmap.c,v 1.95 2014/06/27 20:50:43 matthew Exp $ */ +/* $OpenBSD: uvm_mmap.c,v 1.96 2014/07/02 06:09:49 matthew Exp $ */ /* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */ /* @@ -949,7 +949,7 @@ uvm_mmap(vm_map_t map, vaddr_t *addr, vsize_t size, vm_prot_t prot, } else { vp = (struct vnode *) handle; /* get vnode */ if (vp->v_type != VCHR) { - uobj = uvn_attach((void *) vp, (flags & MAP_SHARED) ? + uobj = uvn_attach(vp, (flags & MAP_SHARED) ? maxprot : (maxprot & ~VM_PROT_WRITE)); #ifndef UBC @@ -987,7 +987,7 @@ uvm_mmap(vm_map_t map, vaddr_t *addr, vsize_t size, vm_prot_t prot, vref(vp); #endif } else { - uobj = udv_attach((void *) &vp->v_rdev, + uobj = udv_attach(vp->v_rdev, (flags & MAP_SHARED) ? maxprot : (maxprot & ~VM_PROT_WRITE), foff, size); /* @@ -997,7 +997,7 @@ uvm_mmap(vm_map_t map, vaddr_t *addr, vsize_t size, vm_prot_t prot, */ if (uobj == NULL && (prot & PROT_EXEC) == 0) { maxprot &= ~VM_PROT_EXECUTE; - uobj = udv_attach((void *) &vp->v_rdev, + uobj = udv_attach(vp->v_rdev, (flags & MAP_SHARED) ? maxprot : (maxprot & ~VM_PROT_WRITE), foff, size); } diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c index 4105d87c997..74390be8124 100644 --- a/sys/uvm/uvm_vnode.c +++ b/sys/uvm/uvm_vnode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_vnode.c,v 1.82 2014/05/08 20:08:50 kettenis Exp $ */ +/* $OpenBSD: uvm_vnode.c,v 1.83 2014/07/02 06:09:49 matthew Exp $ */ /* $NetBSD: uvm_vnode.c,v 1.36 2000/11/24 20:34:01 chs Exp $ */ /* @@ -139,9 +139,8 @@ uvn_init(void) * pointers are equiv. */ struct uvm_object * -uvn_attach(void *arg, vm_prot_t accessprot) +uvn_attach(struct vnode *vp, vm_prot_t accessprot) { - struct vnode *vp = arg; struct uvm_vnode *uvn = &vp->v_uvm; struct vattr vattr; int oldflags, result; |