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/arc keep vmspace rather than proc in arc...



details:   https://anonhg.NetBSD.org/src/rev/07badda4e81e
branches:  yamt-uio_vmspace
changeset: 586731:07badda4e81e
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sat Feb 18 14:35:56 2006 +0000

description:
keep vmspace rather than proc in arc_bus_dmamap.

diffstat:

 sys/arch/arc/arc/bus_dma.c |  15 ++++++++-------
 sys/arch/arc/include/bus.h |   4 ++--
 2 files changed, 10 insertions(+), 9 deletions(-)

diffs (82 lines):

diff -r 7bd95fdcc5a4 -r 07badda4e81e sys/arch/arc/arc/bus_dma.c
--- a/sys/arch/arc/arc/bus_dma.c        Sat Feb 18 14:31:36 2006 +0000
+++ b/sys/arch/arc/arc/bus_dma.c        Sat Feb 18 14:35:56 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.26.2.2 2006/02/18 14:31:36 yamt Exp $    */
+/*     $NetBSD: bus_dma.c,v 1.26.2.3 2006/02/18 14:35:56 yamt Exp $    */
 /*     NetBSD: bus_dma.c,v 1.20 2000/01/10 03:24:36 simonb Exp         */
 
 /*-
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.26.2.2 2006/02/18 14:31:36 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.26.2.3 2006/02/18 14:35:56 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -119,7 +119,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;
@@ -265,7 +265,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
@@ -319,7 +319,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;
 }
@@ -367,7 +367,7 @@
        if (error == 0) {
                map->dm_mapsize = uio->uio_resid;
                map->dm_nsegs = seg + 1;
-               map->_dm_proc = p;
+               map->_dm_vmspace = uio->vmspace;
        }
        return error;
 }
@@ -473,7 +473,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(VMSPACE_IS_KERNEL_P(map->_dm_vmspace) ||
+           map->_dm_vmspace == curproc->p_vmspace))
                useindex = 0;
        else
                useindex = 1;
diff -r 7bd95fdcc5a4 -r 07badda4e81e sys/arch/arc/include/bus.h
--- a/sys/arch/arc/include/bus.h        Sat Feb 18 14:31:36 2006 +0000
+++ b/sys/arch/arc/include/bus.h        Sat Feb 18 14:35:56 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.20 2005/12/24 20:06:47 perry Exp $   */
+/*     $NetBSD: bus.h,v 1.20.2.1 2006/02/18 14:35:57 yamt Exp $        */
 /*     NetBSD: bus.h,v 1.27 2000/03/15 16:44:50 drochner Exp   */
 /*     $OpenBSD: bus.h,v 1.15 1999/08/11 23:15:21 niklas Exp $ */
 
@@ -813,7 +813,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 the mapping */
+       struct vmspace  *_dm_vmspace;   /* vmspace that owns the mapping */
 
        /*
         * Private cookie to be used by the DMA back-end.



Home | Main Index | Thread Index | Old Index