Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Welcome to 5.99.53! Merge rmind-uvmplock branch:



details:   https://anonhg.NetBSD.org/src/rev/e6518ef91ce4
branches:  trunk
changeset: 765956:e6518ef91ce4
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sun Jun 12 03:35:36 2011 +0000

description:
Welcome to 5.99.53!  Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.

diffstat:

 sys/arch/acorn26/acorn26/machdep.c         |    30 +-
 sys/arch/acorn26/acorn26/mem.c             |   184 ----
 sys/arch/acorn26/conf/files.acorn26        |     3 +-
 sys/arch/acorn26/include/types.h           |     4 +-
 sys/arch/alpha/alpha/machdep.c             |    44 +-
 sys/arch/alpha/alpha/mem.c                 |   183 ----
 sys/arch/alpha/conf/files.alpha            |     3 +-
 sys/arch/alpha/include/alpha.h             |     3 +-
 sys/arch/alpha/include/types.h             |     4 +-
 sys/arch/amd64/amd64/cpufunc.S             |     7 +-
 sys/arch/amd64/amd64/genassym.cf           |    14 +-
 sys/arch/amd64/amd64/machdep.c             |    26 +-
 sys/arch/amd64/amd64/mem.c                 |   228 ------
 sys/arch/amd64/amd64/vector.S              |   164 +----
 sys/arch/amd64/conf/files.amd64            |     3 +-
 sys/arch/amd64/include/types.h             |     3 +-
 sys/arch/amiga/amiga/amiga_init.c          |    21 +-
 sys/arch/amiga/amiga/machdep.c             |    12 +-
 sys/arch/amiga/amiga/mem.c                 |   210 -----
 sys/arch/amiga/conf/files.amiga            |     3 +-
 sys/arch/amiga/include/types.h             |     3 +-
 sys/arch/arm/arm32/arm32_machdep.c         |    13 +-
 sys/arch/arm/arm32/mem.c                   |   187 -----
 sys/arch/arm/arm32/pmap.c                  |    35 +-
 sys/arch/arm/conf/files.arm                |     3 +-
 sys/arch/arm/include/arm32/pmap.h          |     3 +-
 sys/arch/atari/atari/machdep.c             |    35 +-
 sys/arch/atari/atari/mem.c                 |   182 ----
 sys/arch/atari/conf/files.atari            |     3 +-
 sys/arch/atari/include/types.h             |     4 +-
 sys/arch/cesfic/cesfic/machdep.c           |    12 +-
 sys/arch/cesfic/cesfic/mem.c               |   209 -----
 sys/arch/cesfic/conf/files.cesfic          |     3 +-
 sys/arch/hp300/conf/files.hp300            |     3 +-
 sys/arch/hp300/hp300/machdep.c             |    26 +-
 sys/arch/hp300/hp300/mem.c                 |   209 -----
 sys/arch/hp300/include/types.h             |     3 +-
 sys/arch/hp700/dev/mem.c                   |   132 +---
 sys/arch/hp700/hp700/machdep.c             |    47 +-
 sys/arch/hp700/include/types.h             |     5 +-
 sys/arch/hppa/hppa/pmap.c                  |    87 +-
 sys/arch/hppa/include/pmap.h               |     5 +-
 sys/arch/i386/conf/files.i386              |     3 +-
 sys/arch/i386/i386/genassym.cf             |    14 +-
 sys/arch/i386/i386/i386func.S              |    11 +-
 sys/arch/i386/i386/machdep.c               |    41 +-
 sys/arch/i386/i386/mem.c                   |   234 ------
 sys/arch/i386/i386/vector.S                |   160 +----
 sys/arch/i386/include/types.h              |     3 +-
 sys/arch/ia64/conf/files.ia64              |     3 +-
 sys/arch/ia64/ia64/machdep.c               |    10 +-
 sys/arch/ia64/ia64/mem.c                   |    50 -
 sys/arch/luna68k/conf/files.luna68k        |     3 +-
 sys/arch/luna68k/luna68k/machdep.c         |    15 +-
 sys/arch/luna68k/luna68k/mem.c             |   199 -----
 sys/arch/m68k/m68k/pmap_motorola.c         |    24 +-
 sys/arch/mac68k/conf/files.mac68k          |     3 +-
 sys/arch/mac68k/mac68k/machdep.c           |    13 +-
 sys/arch/mac68k/mac68k/mem.c               |   198 -----
 sys/arch/mips/conf/files.mips              |     3 +-
 sys/arch/mips/include/types.h              |     6 +-
 sys/arch/mips/mips/mem.c                   |   188 -----
 sys/arch/mips/mips/mips_machdep.c          |    63 +-
 sys/arch/mvme68k/conf/files.mvme68k        |     3 +-
 sys/arch/mvme68k/mvme68k/machdep.c         |    12 +-
 sys/arch/mvme68k/mvme68k/mem.c             |   203 -----
 sys/arch/news68k/conf/files.news68k        |     3 +-
 sys/arch/news68k/include/types.h           |     3 +-
 sys/arch/news68k/news68k/machdep.c         |    20 +-
 sys/arch/news68k/news68k/mem.c             |   204 -----
 sys/arch/next68k/conf/files.next68k        |     3 +-
 sys/arch/next68k/next68k/machdep.c         |    13 +-
 sys/arch/next68k/next68k/mem.c             |   208 -----
 sys/arch/powerpc/conf/files.powerpc        |     3 +-
 sys/arch/powerpc/powerpc/mem.c             |   137 ---
 sys/arch/powerpc/powerpc/powerpc_machdep.c |    14 +-
 sys/arch/sh3/conf/files.sh3                |     3 +-
 sys/arch/sh3/include/types.h               |     7 +-
 sys/arch/sh3/sh3/mem.c                     |   175 ----
 sys/arch/sh3/sh3/vm_machdep.c              |    57 +-
 sys/arch/shark/ofw/ofrom.c                 |     8 +-
 sys/arch/sparc/conf/files.sparc            |     3 +-
 sys/arch/sparc/include/types.h             |    10 +-
 sys/arch/sparc/sparc/machdep.c             |    43 +-
 sys/arch/sparc/sparc/mem.c                 |   194 -----
 sys/arch/sparc/sparc/pmap.c                |     7 +-
 sys/arch/sparc64/conf/files.sparc64        |     3 +-
 sys/arch/sparc64/include/pmap.h            |     3 +-
 sys/arch/sparc64/sparc64/machdep.c         |    34 +-
 sys/arch/sparc64/sparc64/mem.c             |   252 ------
 sys/arch/sparc64/sparc64/pmap.c            |    30 +-
 sys/arch/sun2/conf/files.sun2              |     4 +-
 sys/arch/sun2/include/types.h              |     6 +-
 sys/arch/sun2/sun2/machdep.c               |    44 +-
 sys/arch/sun2/sun2/mem.c                   |   325 --------
 sys/arch/sun2/sun2/mm_md.c                 |   161 ++++
 sys/arch/sun3/conf/files.sun3              |     6 +-
 sys/arch/sun3/include/types.h              |     6 +-
 sys/arch/sun3/sun3/machdep.c               |    50 +-
 sys/arch/sun3/sun3/mem.c                   |   352 ---------
 sys/arch/sun3/sun3/mm_md.c                 |   145 +++
 sys/arch/sun3/sun3x/machdep.c              |    48 +-
 sys/arch/sun3/sun3x/mem.c                  |   306 --------
 sys/arch/sun3/sun3x/mm_md.c                |   145 +++
 sys/arch/usermode/conf/files.usermode      |     3 +-
 sys/arch/usermode/usermode/mem.c           |    52 -
 sys/arch/vax/conf/files.vax                |     3 +-
 sys/arch/vax/include/types.h               |     4 +-
 sys/arch/vax/vax/machdep.c                 |    40 +-
 sys/arch/vax/vax/mem.c                     |   171 ----
 sys/arch/x68k/conf/files.x68k              |     3 +-
 sys/arch/x68k/x68k/machdep.c               |    19 +-
 sys/arch/x68k/x68k/mem.c                   |   216 -----
 sys/arch/x86/conf/files.x86                |     3 +-
 sys/arch/x86/include/cpu.h                 |     4 +-
 sys/arch/x86/include/cpuvar.h              |     4 +-
 sys/arch/x86/include/i82489var.h           |     9 +-
 sys/arch/x86/include/pmap.h                |    50 +-
 sys/arch/x86/include/pmap_pv.h             |     6 +-
 sys/arch/x86/x86/cpu.c                     |     9 +-
 sys/arch/x86/x86/lapic.c                   |    10 +-
 sys/arch/x86/x86/pmap.c                    |  1036 ++++++++-------------------
 sys/arch/x86/x86/pmap_tlb.c                |   420 +++++++++++
 sys/arch/x86/x86/x86_machdep.c             |    12 +-
 sys/arch/xen/conf/files.xen                |     5 +-
 sys/arch/xen/x86/cpu.c                     |     7 +-
 sys/arch/xen/x86/xen_pmap.c                |   198 +++++-
 sys/arch/xen/xen/privcmd.c                 |    51 +-
 sys/arch/xen/xen/xbdback_xenbus.c          |    10 +-
 sys/coda/coda_vnops.c                      |    16 +-
 sys/ddb/db_xxx.c                           |     6 +-
 sys/dev/ata/ld_ataraid.c                   |    10 +-
 sys/dev/ccd.c                              |    10 +-
 sys/dev/cgd.c                              |     8 +-
 sys/dev/dkwedge/dk.c                       |    12 +-
 sys/dev/fss.c                              |     6 +-
 sys/dev/mm.c                               |   394 +++++++++-
 sys/dev/mm.h                               |    95 ++
 sys/dev/vnd.c                              |    14 +-
 sys/fs/adosfs/adutil.c                     |     6 +-
 sys/fs/adosfs/advfsops.c                   |     6 +-
 sys/fs/cd9660/cd9660_node.c                |     6 +-
 sys/fs/cd9660/cd9660_vfsops.c              |     7 +-
 sys/fs/efs/efs_ihash.c                     |     6 +-
 sys/fs/efs/efs_vfsops.c                    |     6 +-
 sys/fs/filecorefs/filecore_node.c          |     6 +-
 sys/fs/filecorefs/filecore_vfsops.c        |     8 +-
 sys/fs/hfs/hfs_nhash.c                     |     6 +-
 sys/fs/hfs/hfs_vfsops.c                    |     8 +-
 sys/fs/msdosfs/msdosfs_denode.c            |    11 +-
 sys/fs/msdosfs/msdosfs_vfsops.c            |     8 +-
 sys/fs/msdosfs/msdosfs_vnops.c             |    12 +-
 sys/fs/nilfs/nilfs_subr.c                  |     8 +-
 sys/fs/nilfs/nilfs_vnops.c                 |     8 +-
 sys/fs/ntfs/ntfs_vfsops.c                  |    12 +-
 sys/fs/ptyfs/ptyfs_subr.c                  |     9 +-
 sys/fs/ptyfs/ptyfs_vnops.c                 |     8 +-
 sys/fs/puffs/puffs_msgif.c                 |     6 +-
 sys/fs/puffs/puffs_node.c                  |    13 +-
 sys/fs/puffs/puffs_vfsops.c                |    16 +-
 sys/fs/puffs/puffs_vnops.c                 |    32 +-
 sys/fs/smbfs/smbfs_kq.c                    |    28 +-
 sys/fs/smbfs/smbfs_node.c                  |     8 +-
 sys/fs/smbfs/smbfs_vfsops.c                |    12 +-
 sys/fs/sysvbfs/sysvbfs_vfsops.c            |    12 +-
 sys/fs/tmpfs/tmpfs_subr.c                  |    25 +-
 sys/fs/tmpfs/tmpfs_vnops.c                 |    23 +-
 sys/fs/udf/udf_readwrite.c                 |     8 +-
 sys/fs/udf/udf_subr.c                      |    20 +-
 sys/fs/udf/udf_vnops.c                     |    18 +-
 sys/fs/union/union_subr.c                  |    14 +-
 sys/fs/union/union_vnops.c                 |    32 +-
 sys/fs/unionfs/unionfs_subr.c              |    17 +-
 sys/fs/unionfs/unionfs_vnops.c             |    41 +-
 sys/kern/init_main.c                       |    12 +-
 sys/kern/sys_descrip.c                     |     6 +-
 sys/kern/sysv_shm.c                        |    14 +-
 sys/kern/uipc_usrreq.c                     |    14 +-
 sys/kern/vfs_bio.c                         |    28 +-
 sys/kern/vfs_cache.c                       |    10 +-
 sys/kern/vfs_mount.c                       |    22 +-
 sys/kern/vfs_subr.c                        |    36 +-
 sys/kern/vfs_syscalls.c                    |     8 +-
 sys/kern/vfs_vnode.c                       |   112 +-
 sys/kern/vfs_vnops.c                       |    38 +-
 sys/kern/vfs_wapbl.c                       |     8 +-
 sys/miscfs/deadfs/dead_vnops.c             |    10 +-
 sys/miscfs/fdesc/fdesc_vnops.c             |     8 +-
 sys/miscfs/genfs/genfs_io.c                |    58 +-
 sys/miscfs/genfs/genfs_vnops.c             |    30 +-
 sys/miscfs/genfs/layer_subr.c              |    16 +-
 sys/miscfs/genfs/layer_vnops.c             |    32 +-
 sys/miscfs/kernfs/kernfs_subr.c            |    12 +-
 sys/miscfs/procfs/procfs_subr.c            |    18 +-
 sys/miscfs/specfs/spec_vnops.c             |    12 +-
 sys/miscfs/syncfs/sync_subr.c              |    12 +-
 sys/miscfs/syncfs/sync_vnops.c             |    23 +-
 sys/nfs/nfs_bio.c                          |    50 +-
 sys/nfs/nfs_clntsubs.c                     |     8 +-
 sys/nfs/nfs_kq.c                           |    28 +-
 sys/nfs/nfs_node.c                         |    11 +-
 sys/nfs/nfs_subs.c                         |    12 +-
 sys/nfs/nfs_vfsops.c                       |     8 +-
 sys/nfs/nfs_vnops.c                        |     6 +-
 sys/rump/librump/rumpkern/vm.c             |    18 +-
 sys/rump/librump/rumpvfs/rump_vfs.c        |     6 +-
 sys/rump/librump/rumpvfs/rumpfs.c          |    10 +-
 sys/rump/librump/rumpvfs/vm_vfs.c          |    32 +-
 sys/sys/conf.h                             |     4 +-
 sys/sys/param.h                            |     4 +-
 sys/sys/vnode.h                            |    17 +-
 sys/ufs/ext2fs/ext2fs_readwrite.c          |     8 +-
 sys/ufs/ext2fs/ext2fs_vfsops.c             |    13 +-
 sys/ufs/ffs/ffs_alloc.c                    |    12 +-
 sys/ufs/ffs/ffs_inode.c                    |     8 +-
 sys/ufs/ffs/ffs_quota2.c                   |    12 +-
 sys/ufs/ffs/ffs_snapshot.c                 |    12 +-
 sys/ufs/ffs/ffs_vfsops.c                   |    25 +-
 sys/ufs/ffs/ffs_vnops.c                    |    24 +-
 sys/ufs/lfs/lfs_alloc.c                    |    10 +-
 sys/ufs/lfs/lfs_bio.c                      |    16 +-
 sys/ufs/lfs/lfs_inode.c                    |    16 +-
 sys/ufs/lfs/lfs_segment.c                  |    90 +-
 sys/ufs/lfs/lfs_syscalls.c                 |    13 +-
 sys/ufs/lfs/lfs_vfsops.c                   |    23 +-
 sys/ufs/lfs/lfs_vnops.c                    |    78 +-
 sys/ufs/mfs/mfs_vfsops.c                   |     6 +-
 sys/ufs/ufs/ufs_extattr.c                  |     8 +-
 sys/ufs/ufs/ufs_ihash.c                    |     6 +-
 sys/ufs/ufs/ufs_inode.c                    |    14 +-
 sys/ufs/ufs/ufs_quota1.c                   |    16 +-
 sys/ufs/ufs/ufs_readwrite.c                |    12 +-
 sys/uvm/uvm_amap.c                         |   129 ++-
 sys/uvm/uvm_amap.h                         |    15 +-
 sys/uvm/uvm_anon.c                         |    69 +-
 sys/uvm/uvm_anon.h                         |    23 +-
 sys/uvm/uvm_aobj.c                         |    69 +-
 sys/uvm/uvm_bio.c                          |   163 ++-
 sys/uvm/uvm_device.c                       |    38 +-
 sys/uvm/uvm_extern.h                       |    15 +-
 sys/uvm/uvm_fault.c                        |   269 +++---
 sys/uvm/uvm_fault_i.h                      |    10 +-
 sys/uvm/uvm_glue.c                         |    31 +-
 sys/uvm/uvm_km.c                           |    29 +-
 sys/uvm/uvm_loan.c                         |   125 +-
 sys/uvm/uvm_map.c                          |    61 +-
 sys/uvm/uvm_map.h                          |     5 +-
 sys/uvm/uvm_mmap.c                         |    12 +-
 sys/uvm/uvm_mremap.c                       |     8 +-
 sys/uvm/uvm_object.c                       |   108 ++-
 sys/uvm/uvm_object.h                       |    32 +-
 sys/uvm/uvm_page.c                         |    48 +-
 sys/uvm/uvm_page.h                         |     3 +-
 sys/uvm/uvm_pager.c                        |    10 +-
 sys/uvm/uvm_pdaemon.c                      |    12 +-
 sys/uvm/uvm_pdpolicy_clock.c               |    31 +-
 sys/uvm/uvm_readahead.c                    |    12 +-
 sys/uvm/uvm_swap.c                         |    26 +-
 sys/uvm/uvm_vnode.c                        |    28 +-
 259 files changed, 4556 insertions(+), 8237 deletions(-)

diffs (truncated from 23511 to 300 lines):

diff -r d67e73201b7b -r e6518ef91ce4 sys/arch/acorn26/acorn26/machdep.c
--- a/sys/arch/acorn26/acorn26/machdep.c        Sun Jun 12 03:29:33 2011 +0000
+++ b/sys/arch/acorn26/acorn26/machdep.c        Sun Jun 12 03:35:36 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.33 2010/02/08 19:02:25 joerg Exp $ */
+/* $NetBSD: machdep.c,v 1.34 2011/06/12 03:35:36 rmind Exp $ */
 
 /*-
  * Copyright (c) 1998 Ben Harris
@@ -32,7 +32,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.33 2010/02/08 19:02:25 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.34 2011/06/12 03:35:36 rmind Exp $");
 
 #include <sys/buf.h>
 #include <sys/kernel.h>
@@ -44,6 +44,8 @@
 #include <sys/cpu.h>
 #include <sys/device.h>
 
+#include <dev/mm.h>
+
 #include <dev/i2c/i2cvar.h>
 #include <dev/i2c/pcf8583var.h>
 
@@ -202,3 +204,27 @@
        return (pcfrtc_bootstrap_write(iociic_bootstrap_cookie(), 0x50,
            location, &val, 1));
 }
+
+bool
+mm_md_direct_mapped_phys(paddr_t paddr, vaddr_t *vaddr)
+{
+
+       *vaddr = (vaddr_t)MEMC_PHYS_BASE + paddr;
+       return true;
+}
+
+int
+mm_md_physacc(paddr_t pa, vm_prot_t prot)
+{
+
+       return (pa > MEMC_PHYS_BASE + ptoa(physmem)) ? EFAULT : 0;
+}
+
+int
+mm_md_kernacc(void *ptr, vm_prot_t prot, bool *handled)
+{
+       const vaddr_t v = (vaddr_t)ptr;
+
+       *handled = (v >= MEMC_PHYS_BASE && v < MEMC_PHYS_BASE + ptoa(physmem));
+       return 0;
+}
diff -r d67e73201b7b -r e6518ef91ce4 sys/arch/acorn26/acorn26/mem.c
--- a/sys/arch/acorn26/acorn26/mem.c    Sun Jun 12 03:29:33 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-/*     $NetBSD: mem.c,v 1.15 2011/02/08 20:20:06 rmind Exp $   */
-
-/*
- * Copyright (c) 1988 University of Utah.
- * Copyright (c) 1982, 1986, 1990, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * the Systems Programming Group of the University of Utah Computer
- * Science Department.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Memory special file
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.15 2011/02/08 20:20:06 rmind Exp $");
-
-#ifdef _KERNEL_OPT
-#include "opt_compat_netbsd.h"
-#endif
-
-#include <sys/param.h>
-#include <sys/conf.h>
-#include <sys/buf.h>
-#include <sys/systm.h>
-#include <sys/uio.h>
-#include <sys/malloc.h>
-#include <sys/proc.h>
-#include <sys/fcntl.h>
-
-#include <machine/cpu.h>
-#include <machine/memcreg.h>
-
-#include <uvm/uvm_extern.h>
-
-void *zeropage;
-int physlock;
-
-dev_type_read(mmrw);
-dev_type_ioctl(mmioctl);
-dev_type_mmap(mmmmap);
-
-const struct cdevsw mem_cdevsw = {
-       nullopen, nullclose, mmrw, mmrw, mmioctl,
-       nostop, notty, nopoll, mmmmap, nokqfilter,
-};
-
-/*ARGSUSED*/
-int
-mmrw(dev_t dev, struct uio *uio, int flags)
-{
-       register vm_offset_t v;
-       register int c;
-       register struct iovec *iov;
-       int error = 0;
-
-       while (uio->uio_resid > 0 && error == 0) {
-               iov = uio->uio_iov;
-               if (iov->iov_len == 0) {
-                       uio->uio_iov++;
-                       uio->uio_iovcnt--;
-                       if (uio->uio_iovcnt < 0)
-                               panic("mmrw");
-                       continue;
-               }
-               switch (minor(dev)) {
-
-               case DEV_MEM:
-                       /*
-                        * On arm26, there's no need to map in the
-                        * relevant page, as we've got physical memory
-                        * mapped in at another address and can just
-                        * use that.
-                        */
-                       v = uio->uio_offset;
-                       c = min(iov->iov_len, MAXPHYS);
-                       /* XXX Should use pmap_find(). */
-                       if (v < 0 ||
-                           (char *)v + c > 
-                                       (char*)MEMC_PHYS_BASE + ptoa(physmem))
-                               return EFAULT;
-                       error = uiomove((char*)MEMC_PHYS_BASE + uio->uio_offset,
-                                       uio->uio_resid, uio);
-                       continue;
-
-               case DEV_KMEM:
-                       v = uio->uio_offset;
-                       c = min(iov->iov_len, MAXPHYS);
-                       /* Allow reading from physically mapped space. */
-                       if (((void *)v >= MEMC_PHYS_BASE &&
-                            (char *)v + c <
-                               (char*)MEMC_PHYS_BASE + ptoa(physmem)) ||
-                           uvm_kernacc((void *)v, c,
-                                       uio->uio_rw == UIO_READ ?
-                                       B_READ : B_WRITE))
-                               error = uiomove((void *)v, c, uio);
-                       else
-                               return (EFAULT);
-                       break;
-
-               case DEV_NULL:
-                       if (uio->uio_rw == UIO_WRITE)
-                               uio->uio_resid = 0;
-                       return (0);
-
-#ifdef COMPAT_16
-               case _DEV_ZERO_oARM:
-#endif
-               case DEV_ZERO:
-                       if (uio->uio_rw == UIO_WRITE) {
-                               uio->uio_resid = 0;
-                               return (0);
-                       }
-                       if (zeropage == NULL) {
-                               zeropage = 
-                                   malloc(PAGE_SIZE, M_TEMP, M_WAITOK|M_ZERO);
-                       }
-                       c = min(iov->iov_len, PAGE_SIZE);
-                       error = uiomove(zeropage, c, uio);
-                       break;
-
-               default:
-                       return (ENXIO);
-               }
-       }
-       if (minor(dev) == DEV_MEM) {
-/*unlock:*/
-               if (physlock > 1)
-                       wakeup((void *)&physlock);
-               physlock = 0;
-       }
-       return (error);
-}
-
-paddr_t
-mmmmap(dev_t dev, off_t off, int prot)
-{
-       int ppn;
-
-       /*
-        * /dev/mem is the only one that makes sense through this
-        * interface.  For /dev/kmem any physaddr we return here
-        * could be transient and hence incorrect or invalid at
-        * a later time.  /dev/null just doesn't make any sense
-        * and /dev/zero is a hack that is handled via the default
-        * pager in mmap().
-        */
-       if (minor(dev) != DEV_MEM)
-               return (-1);
-
-       /* minor device 0 is physical memory */
-
-       /* XXX This may botch our cacheing assumptions.  Do we care? */
-       ppn = atop(off);
-       if (ppn >= 0 && ppn < physmem)
-               return ppn;
-       return -1;
-}
diff -r d67e73201b7b -r e6518ef91ce4 sys/arch/acorn26/conf/files.acorn26
--- a/sys/arch/acorn26/conf/files.acorn26       Sun Jun 12 03:29:33 2011 +0000
+++ b/sys/arch/acorn26/conf/files.acorn26       Sun Jun 12 03:35:36 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.acorn26,v 1.14 2009/02/14 10:20:55 bjh21 Exp $
+# $NetBSD: files.acorn26,v 1.15 2011/06/12 03:35:36 rmind Exp $
 
 # Copyright (c) 1997, 1998, 2000 Ben Harris
 # All rights reserved.
@@ -188,7 +188,6 @@
 file   arch/acorn26/acorn26/except.c
 file   arch/acorn26/acorn26/irq.c
 file   arch/acorn26/acorn26/machdep.c
-file   arch/acorn26/acorn26/mem.c
 file   arch/acorn26/acorn26/pmap.c
 #file  arch/acorn26/acorn26/rscons.c
 file   arch/acorn26/acorn26/stubs.c
diff -r d67e73201b7b -r e6518ef91ce4 sys/arch/acorn26/include/types.h
--- a/sys/arch/acorn26/include/types.h  Sun Jun 12 03:29:33 2011 +0000
+++ b/sys/arch/acorn26/include/types.h  Sun Jun 12 03:35:36 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: types.h,v 1.11 2008/01/20 18:09:04 joerg Exp $ */
+/* $NetBSD: types.h,v 1.12 2011/06/12 03:35:36 rmind Exp $ */
 
 #ifndef        _ACORN26_TYPES_H_
 #define        _ACORN26_TYPES_H_
@@ -6,5 +6,7 @@
 #include <arm/arm26/types.h>
 
 #define        __GENERIC_SOFT_INTERRUPTS_ALL_LEVELS
+#define        __HAVE_MM_MD_DIRECT_MAPPED_PHYS
+#define        __HAVE_MM_MD_KERNACC
 
 #endif /* _ACORN26_TYPES_H_ */
diff -r d67e73201b7b -r e6518ef91ce4 sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c    Sun Jun 12 03:29:33 2011 +0000
+++ b/sys/arch/alpha/alpha/machdep.c    Sun Jun 12 03:35:36 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.334 2011/06/07 00:48:30 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.335 2011/06/12 03:35:37 rmind Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.334 2011/06/07 00:48:30 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.335 2011/06/12 03:35:37 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -109,6 +109,7 @@
 #include <sys/sysctl.h>
 
 #include <dev/cons.h>
+#include <dev/mm.h>



Home | Main Index | Thread Index | Old Index