Source-Changes-HG archive

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

[src/yamt-uio_vmspace]: src/sys/arch/cobalt keep vmspace rather than proc in ...



details:   https://anonhg.NetBSD.org/src/rev/ffb8e3e21661
branches:  yamt-uio_vmspace
changeset: 586733:ffb8e3e21661
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sat Feb 18 14:49:22 2006 +0000

description:
keep vmspace rather than proc in cobalt_bus_dmamap.

diffstat:

 sys/arch/cobalt/cobalt/bus.c  |  17 +++++++++--------
 sys/arch/cobalt/include/bus.h |   4 ++--
 2 files changed, 11 insertions(+), 10 deletions(-)

diffs (91 lines):

diff -r 86e7259986c0 -r ffb8e3e21661 sys/arch/cobalt/cobalt/bus.c
--- a/sys/arch/cobalt/cobalt/bus.c      Sat Feb 18 14:39:41 2006 +0000
+++ b/sys/arch/cobalt/cobalt/bus.c      Sat Feb 18 14:49:22 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.c,v 1.23.2.1 2006/02/18 11:12:18 yamt Exp $        */
+/*     $NetBSD: bus.c,v 1.23.2.2 2006/02/18 14:49:22 yamt Exp $        */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.23.2.1 2006/02/18 11:12:18 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.23.2.2 2006/02/18 14:49:22 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -181,7 +181,7 @@
        map->_dm_maxmaxsegsz = maxsegsz;
        map->_dm_boundary = boundary;
        map->_dm_flags = flags & ~(BUS_DMA_WAITOK|BUS_DMA_NOWAIT);
-       map->_dm_proc = NULL;
+       map->_dm_vmspace = NULL;
        map->dm_maxsegsz = maxsegsz;
        map->dm_mapsize = 0;            /* no valid mappings */
        map->dm_nsegs = 0;
@@ -338,7 +338,7 @@
        if (error == 0) {
                map->dm_mapsize = buflen;
                map->dm_nsegs = seg + 1;
-               map->_dm_proc = p;
+               map->_dm_vmspace = vm;
 
                /*
                 * For linear buffers, we support marking the mapping
@@ -395,7 +395,7 @@
        if (error == 0) {
                map->dm_mapsize = m0->m_pkthdr.len;
                map->dm_nsegs = seg + 1;
-               map->_dm_proc = NULL;   /* always kernel */
+               map->_dm_vmspace = vmspace_kernel();    /* always kernel */
        }
        return error;
 }
@@ -446,7 +446,7 @@
        if (error == 0) {
                map->dm_mapsize = uio->uio_resid;
                map->dm_nsegs = seg + 1;
-               map->_dm_proc = p;
+               map->_dm_vmspace = uio->uio_vmspace;
        }
        return error;
 }
@@ -485,7 +485,7 @@
        map->dm_mapsize = 0;
        map->dm_nsegs = 0;
        map->_dm_flags &= ~COBALT_DMAMAP_COHERENT;
-       map->_dm_proc = NULL;
+       map->_dm_vmspace = NULL;
 }
 
 /*
@@ -564,7 +564,8 @@
         *
         * This should be true the vast majority of the time.
         */
-       if (__predict_true(map->_dm_proc == NULL || map->_dm_proc == curproc))
+       if (__predict_true(VM_SPACE_IS_KERNEL_P(map->_dm_vmspace) ||
+           map->_dm_vmspace == curproc->p_vmspace))
                useindex = 0;
        else
                useindex = 1;
diff -r 86e7259986c0 -r ffb8e3e21661 sys/arch/cobalt/include/bus.h
--- a/sys/arch/cobalt/include/bus.h     Sat Feb 18 14:39:41 2006 +0000
+++ b/sys/arch/cobalt/include/bus.h     Sat Feb 18 14:49:22 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.13 2005/12/24 20:06:58 perry Exp $   */
+/*     $NetBSD: bus.h,v 1.13.2.1 2006/02/18 14:49:22 yamt Exp $        */
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -602,7 +602,7 @@
        bus_size_t      _dm_maxmaxsegsz; /* fixed largest possible segment */
        bus_size_t      _dm_boundary;   /* don't cross this */
        int             _dm_flags;      /* misc. flags */
-       struct proc     *_dm_proc;      /* proc that owns this mapping */
+       struct vmspace  *_dm_vmspace;   /* vmspace that owns this mapping */
 
        /*
         * PUBLIC MEMBERS: these are used by machine-independent code.



Home | Main Index | Thread Index | Old Index