diff options
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vfsops.c | 12 | ||||
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vnops.c | 14 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs.h | 6 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_cmdline.c | 24 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_linux.c | 23 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_mem.c | 155 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_vfsops.c | 8 | ||||
-rw-r--r-- | sys/miscfs/union/union_subr.c | 6 |
8 files changed, 8 insertions, 240 deletions
diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c index 96713bbc6f1..5a04a4f2081 100644 --- a/sys/miscfs/kernfs/kernfs_vfsops.c +++ b/sys/miscfs/kernfs/kernfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kernfs_vfsops.c,v 1.14 2001/02/20 01:50:09 assar Exp $ */ +/* $OpenBSD: kernfs_vfsops.c,v 1.15 2001/06/27 04:58:42 art Exp $ */ /* $NetBSD: kernfs_vfsops.c,v 1.26 1996/04/22 01:42:27 christos Exp $ */ /* @@ -53,12 +53,8 @@ #include <sys/namei.h> #include <sys/malloc.h> -#if defined(UVM) #include <vm/vm.h> #include <uvm/uvm_extern.h> /* for uvmexp */ -#else -#include <sys/vmmeter.h> /* for cnt */ -#endif #include <miscfs/specfs/specdev.h> #include <miscfs/kernfs/kernfs.h> @@ -251,15 +247,9 @@ kernfs_statfs(mp, sbp, p) #endif sbp->f_flags = 0; -#if defined(UVM) sbp->f_bsize = uvmexp.pagesize; sbp->f_iosize = uvmexp.pagesize; sbp->f_bfree = physmem - uvmexp.wired; -#else - sbp->f_bsize = cnt.v_page_size; - sbp->f_iosize = cnt.v_page_size; - sbp->f_bfree = physmem - cnt.v_wire_count; -#endif sbp->f_blocks = physmem; sbp->f_bavail = 0; sbp->f_files = desiredvnodes; diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c index d09467aa019..968a613bf7d 100644 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ b/sys/miscfs/kernfs/kernfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kernfs_vnops.c,v 1.20 2001/06/23 02:14:25 csapuntz Exp $ */ +/* $OpenBSD: kernfs_vnops.c,v 1.21 2001/06/27 04:58:42 art Exp $ */ /* $NetBSD: kernfs_vnops.c,v 1.43 1996/03/16 23:52:47 christos Exp $ */ /* @@ -60,12 +60,8 @@ #include <sys/msgbuf.h> #include <miscfs/kernfs/kernfs.h> -#if defined(UVM) #include <vm/vm.h> #include <uvm/uvm_extern.h> -#else -#include <sys/vmmeter.h> -#endif #define KSTRING 256 /* Largest I/O available via this filesystem */ #define UIO_MX 32 @@ -105,11 +101,7 @@ struct kern_target kern_targets[] = { { DT_REG, N("ostype"), &ostype, KTT_STRING, VREG, READ_MODE }, { DT_REG, N("osrelease"), &osrelease, KTT_STRING, VREG, READ_MODE }, { DT_REG, N("osrev"), &osrev, KTT_INT, VREG, READ_MODE }, -#if defined(UVM) { DT_REG, N("pagesize"), &uvmexp.pagesize, KTT_INT, VREG, READ_MODE }, -#else - { DT_REG, N("pagesize"), &cnt.v_page_size, KTT_INT, VREG, READ_MODE }, -#endif { DT_REG, N("physmem"), &physmem, KTT_INT, VREG, READ_MODE }, { DT_REG, N("posix"), &posix, KTT_INT, VREG, READ_MODE }, #if 0 @@ -313,11 +305,7 @@ kernfs_xread(kt, off, bufp, len) break; case KTT_USERMEM: -#if defined(UVM) sprintf(*bufp, "%u\n", physmem - uvmexp.wired); -#else - sprintf(*bufp, "%u\n", physmem - cnt.v_wire_count); -#endif break; #ifdef IPSEC case KTT_IPSECSPI: diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h index 26d9b7b2154..a35112a4f12 100644 --- a/sys/miscfs/procfs/procfs.h +++ b/sys/miscfs/procfs/procfs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs.h,v 1.12 2001/05/24 07:32:42 aaron Exp $ */ +/* $OpenBSD: procfs.h,v 1.13 2001/06/27 04:58:43 art Exp $ */ /* $NetBSD: procfs.h,v 1.17 1996/02/12 15:01:41 christos Exp $ */ /* @@ -139,10 +139,6 @@ int procfs_domap __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct int procfs_freevp __P((struct vnode *)); int procfs_getcpuinfstr __P((char *, int *)); -#if !defined(UVM) -int procfs_rwmem __P((struct proc *, struct uio *)); -#endif - /* functions to check whether or not files should be displayed */ int procfs_validfile __P((struct proc *, struct mount *)); int procfs_validfpregs __P((struct proc *, struct mount *)); diff --git a/sys/miscfs/procfs/procfs_cmdline.c b/sys/miscfs/procfs/procfs_cmdline.c index 0189e3e9c28..b986a7beeff 100644 --- a/sys/miscfs/procfs/procfs_cmdline.c +++ b/sys/miscfs/procfs/procfs_cmdline.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_cmdline.c,v 1.1 2000/08/12 04:29:24 jasoni Exp $ */ +/* $OpenBSD: procfs_cmdline.c,v 1.2 2001/06/27 04:58:43 art Exp $ */ /* $NetBSD: procfs_cmdline.c,v 1.3 1999/03/13 22:26:48 thorpej Exp $ */ /* @@ -49,9 +49,7 @@ #include <miscfs/procfs/procfs.h> #include <vm/vm.h> -#if defined(UVM) #include <uvm/uvm_extern.h> -#endif /* * code for returning process's command line arguments @@ -106,7 +104,6 @@ procfs_docmdline(curp, p, pfs, uio) /* * Lock the process down in memory. */ -#if defined(UVM) /* XXXCDC: how should locking work here? */ if ((p->p_flag & P_WEXIT) || (p->p_vmspace->vm_refcnt < 1)) { free(arg, M_TEMP); @@ -114,9 +111,6 @@ procfs_docmdline(curp, p, pfs, uio) } PHOLD(p); p->p_vmspace->vm_refcnt++; /* XXX */ -#else - PHOLD(p); -#endif /* * Read in the ps_strings structure. @@ -130,11 +124,7 @@ procfs_docmdline(curp, p, pfs, uio) auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_READ; auio.uio_procp = NULL; -#if defined(UVM) error = uvm_io(&p->p_vmspace->vm_map, &auio); -#else - error = procfs_rwmem(p, &auio); -#endif if (error) goto bad; @@ -150,11 +140,7 @@ procfs_docmdline(curp, p, pfs, uio) auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_READ; auio.uio_procp = NULL; -#if defined(UVM) error = uvm_io(&p->p_vmspace->vm_map, &auio); -#else - error = procfs_rwmem(p, &auio); -#endif if (error) goto bad; @@ -177,11 +163,7 @@ procfs_docmdline(curp, p, pfs, uio) auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_READ; auio.uio_procp = NULL; -#if defined(UVM) error = uvm_io(&p->p_vmspace->vm_map, &auio); -#else - error = procfs_rwmem(p, &auio); -#endif if (error) goto bad; @@ -204,12 +186,8 @@ procfs_docmdline(curp, p, pfs, uio) bad: -#if defined(UVM) PRELE(p); uvmspace_free(p->p_vmspace); -#else - PRELE(p); -#endif free(arg, M_TEMP); return (error); } diff --git a/sys/miscfs/procfs/procfs_linux.c b/sys/miscfs/procfs/procfs_linux.c index 8d41775dd35..f8cd17567be 100644 --- a/sys/miscfs/procfs/procfs_linux.c +++ b/sys/miscfs/procfs/procfs_linux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_linux.c,v 1.2 2001/04/13 01:41:37 miod Exp $ */ +/* $OpenBSD: procfs_linux.c,v 1.3 2001/06/27 04:58:43 art Exp $ */ /* $NetBSD: procfs_linux.c,v 1.2.4.1 2001/03/30 21:48:11 he Exp $ */ /* @@ -46,9 +46,7 @@ #include <miscfs/procfs/procfs.h> #include <vm/vm.h> -#if defined(UVM) #include <uvm/uvm_extern.h> -#endif #define PGTOB(p) ((unsigned long)(p) << PAGE_SHIFT) #define PGTOKB(p) ((unsigned long)(p) << (PAGE_SHIFT - 10)) @@ -75,41 +73,22 @@ procfs_domeminfo(struct proc *curp, struct proc *p, struct pfsnode *pfs, "Cached: %8lu kB\n" "SwapTotal: %8lu kB\n" "SwapFree: %8lu kB\n", -#if defined(UVM) PGTOB(uvmexp.npages), PGTOB(uvmexp.npages - uvmexp.free), PGTOB(uvmexp.free), -#else - 0L, 0L, 0L, -#endif - 0L, 0L, - 0L, -#if defined(UVM) PGTOB(uvmexp.swpages), PGTOB(uvmexp.swpginuse), PGTOB(uvmexp.swpages - uvmexp.swpginuse), PGTOKB(uvmexp.npages), PGTOKB(uvmexp.free), -#else - 0L, - 0L, 0L, 0L, 0L, -#endif - 0L, - 0L, - 0L, -#if defined(UVM) PGTOKB(uvmexp.swpages), PGTOKB(uvmexp.swpages - uvmexp.swpginuse)); -#else - 0L, - 0L); -#endif if (len == 0) return 0; diff --git a/sys/miscfs/procfs/procfs_mem.c b/sys/miscfs/procfs/procfs_mem.c index d5e33efc52e..ae553184db3 100644 --- a/sys/miscfs/procfs/procfs_mem.c +++ b/sys/miscfs/procfs/procfs_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_mem.c,v 1.11 2001/05/24 07:32:43 aaron Exp $ */ +/* $OpenBSD: procfs_mem.c,v 1.12 2001/06/27 04:58:43 art Exp $ */ /* $NetBSD: procfs_mem.c,v 1.8 1996/02/09 22:40:50 christos Exp $ */ /* @@ -57,157 +57,10 @@ #include <vm/vm_kern.h> #include <vm/vm_page.h> -#if defined(UVM) #include <uvm/uvm_extern.h> -#endif #define ISSET(t, f) ((t) & (f)) -#if !defined(UVM) -int -procfs_rwmem(p, uio) - struct proc *p; - struct uio *uio; -{ - int error; - int writing; - - writing = uio->uio_rw == UIO_WRITE; - - /* - * Only map in one page at a time. We don't have to, but it - * makes things easier. This way is trivial - right? - */ - do { - vm_map_t map, tmap; - vm_object_t object; - vm_offset_t kva; - vm_offset_t uva; - int page_offset; /* offset into page */ - vm_offset_t pageno; /* page number */ - vm_map_entry_t out_entry; - vm_prot_t out_prot; - vm_page_t m; - boolean_t wired, single_use; - vm_offset_t off; - u_int len; - int fix_prot; - - uva = (vm_offset_t) uio->uio_offset; - if (uva > VM_MAXUSER_ADDRESS) { - error = 0; - break; - } - - /* - * Get the page number of this segment. - */ - pageno = trunc_page(uva); - page_offset = uva - pageno; - - /* - * How many bytes to copy - */ - len = min(PAGE_SIZE - page_offset, uio->uio_resid); - - /* - * The map we want... - */ - map = &p->p_vmspace->vm_map; - - /* - * Check the permissions for the area we're interested - * in. - */ - fix_prot = 0; - if (writing) - fix_prot = !vm_map_check_protection(map, pageno, - pageno + PAGE_SIZE, VM_PROT_WRITE); - - if (fix_prot) { - /* - * If the page is not writable, we make it so. - * XXX It is possible that a page may *not* be - * read/executable, if a process changes that! - * We will assume, for now, that a page is either - * VM_PROT_ALL, or VM_PROT_READ|VM_PROT_EXECUTE. - */ - error = vm_map_protect(map, pageno, - pageno + PAGE_SIZE, VM_PROT_ALL, 0); - if (error) - break; - } - - /* - * Now we need to get the page. out_entry, out_prot, wired, - * and single_use aren't used. One would think the vm code - * would be a *bit* nicer... We use tmap because - * vm_map_lookup() can change the map argument. - */ - tmap = map; - error = vm_map_lookup(&tmap, pageno, - writing ? VM_PROT_WRITE : VM_PROT_READ, - &out_entry, &object, &off, &out_prot, - &wired, &single_use); - /* - * We're done with tmap now. - */ - if (!error) - vm_map_lookup_done(tmap, out_entry); - - /* - * Fault the page in... - */ - if (!error && writing && object->shadow) { - m = vm_page_lookup(object, off); - if (m == 0 || (m->flags & PG_COPYONWRITE)) { -#ifdef __i386__ - pmap_prefault(map, uva, 4); -#endif - error = vm_fault(map, pageno, - VM_PROT_WRITE, FALSE); - } - } - - /* Find space in kernel_map for the page we're interested in */ - if (!error) { - kva = VM_MIN_KERNEL_ADDRESS; - error = vm_map_find(kernel_map, object, off, &kva, - PAGE_SIZE, 1); - } - - if (!error) { - /* - * Neither vm_map_lookup() nor vm_map_find() appear - * to add a reference count to the object, so we do - * that here and now. - */ - vm_object_reference(object); - - /* - * Mark the page we just found as pageable. - */ - error = vm_map_pageable(kernel_map, kva, - kva + PAGE_SIZE, 0); - - /* - * Now do the i/o move. - */ - if (!error) - error = uiomove((caddr_t) (kva + page_offset), - len, uio); - - vm_map_remove(kernel_map, kva, kva + PAGE_SIZE); - } - if (fix_prot) - vm_map_protect(map, pageno, pageno + PAGE_SIZE, - VM_PROT_READ|VM_PROT_EXECUTE, 0); - } while (error == 0 && uio->uio_resid > 0); - - return (error); -} -#endif - /* * Copy data in and out of the target process. * We do this by mapping the process's page into @@ -228,7 +81,6 @@ procfs_domem(curp, p, pfs, uio) if ((error = procfs_checkioperm(curp, p)) != 0) return (error); -#if defined(UVM) /* XXXCDC: how should locking work here? */ if ((p->p_flag & P_WEXIT) || (p->p_vmspace->vm_refcnt < 1)) return(EFAULT); @@ -237,11 +89,6 @@ procfs_domem(curp, p, pfs, uio) error = uvm_io(&p->p_vmspace->vm_map, uio); PRELE(p); uvmspace_free(p->p_vmspace); -#else - PHOLD(p); - error = procfs_rwmem(p, uio); - PRELE(p); -#endif return error; } diff --git a/sys/miscfs/procfs/procfs_vfsops.c b/sys/miscfs/procfs/procfs_vfsops.c index 9c1601ca502..e590ae5b14e 100644 --- a/sys/miscfs/procfs/procfs_vfsops.c +++ b/sys/miscfs/procfs/procfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_vfsops.c,v 1.13 2001/04/09 07:14:23 tholo Exp $ */ +/* $OpenBSD: procfs_vfsops.c,v 1.14 2001/06/27 04:58:44 art Exp $ */ /* $NetBSD: procfs_vfsops.c,v 1.25 1996/02/09 22:40:53 christos Exp $ */ /* @@ -60,9 +60,7 @@ #include <vm/vm.h> /* for PAGE_SIZE */ -#if defined(UVM) #include <uvm/uvm_extern.h> -#endif int procfs_mount __P((struct mount *, const char *, void *, struct nameidata *, struct proc *)); @@ -183,11 +181,7 @@ procfs_statfs(mp, sbp, p) { struct vmtotal vmtotals; -#if defined(UVM) uvm_total(&vmtotals); -#else - vmtotal(&vmtotals); -#endif sbp->f_bsize = PAGE_SIZE; sbp->f_iosize = PAGE_SIZE; sbp->f_blocks = vmtotals.t_vm; diff --git a/sys/miscfs/union/union_subr.c b/sys/miscfs/union/union_subr.c index d0e5444ec2c..26edd1f0b27 100644 --- a/sys/miscfs/union/union_subr.c +++ b/sys/miscfs/union/union_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: union_subr.c,v 1.8 1999/02/26 03:32:22 art Exp $ */ +/* $OpenBSD: union_subr.c,v 1.9 2001/06/27 04:58:44 art Exp $ */ /* $NetBSD: union_subr.c,v 1.18 1996/02/09 22:41:10 christos Exp $ */ /* @@ -302,11 +302,7 @@ union_newsize(vp, uppersz, lowersz) printf("union: %s size now %ld\n", uppersz != VNOVAL ? "upper" : "lower", (long) sz); #endif -#if defined(UVM) uvm_vnp_setsize(vp, sz); -#else - vnode_pager_setsize(vp, sz); -#endif } } |