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 _dm_proc -> _dm_vmspace.



details:   https://anonhg.NetBSD.org/src/rev/d4745c058bfe
branches:  yamt-uio_vmspace
changeset: 586741:d4745c058bfe
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sat Feb 18 23:28:28 2006 +0000

description:
_dm_proc -> _dm_vmspace.

diffstat:

 sys/arch/algor/algor/bus_dma.c   |  15 ++++++++-------
 sys/arch/algor/include/bus.h     |   4 ++--
 sys/arch/hpcsh/include/bus.h     |   4 ++--
 sys/arch/mips/include/bus_dma.h  |   4 ++--
 sys/arch/mips/mips/bus_dma.c     |  16 ++++++++--------
 sys/arch/newsmips/include/bus.h  |   4 ++--
 sys/arch/newsmips/newsmips/bus.c |  17 +++++++++--------
 7 files changed, 33 insertions(+), 31 deletions(-)

diffs (274 lines):

diff -r 3be9979c3a54 -r d4745c058bfe sys/arch/algor/algor/bus_dma.c
--- a/sys/arch/algor/algor/bus_dma.c    Sat Feb 18 23:21:32 2006 +0000
+++ b/sys/arch/algor/algor/bus_dma.c    Sat Feb 18 23:28:28 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.15.2.1 2006/02/18 11:12:18 yamt Exp $    */
+/*     $NetBSD: bus_dma.c,v 1.15.2.2 2006/02/18 23:28:28 yamt Exp $    */
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.15.2.1 2006/02/18 11:12:18 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.15.2.2 2006/02/18 23:28:28 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -95,7 +95,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;
@@ -261,7 +261,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
@@ -315,7 +315,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);
 }
@@ -364,7 +364,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);
 }
@@ -470,7 +470,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 3be9979c3a54 -r d4745c058bfe sys/arch/algor/include/bus.h
--- a/sys/arch/algor/include/bus.h      Sat Feb 18 23:21:32 2006 +0000
+++ b/sys/arch/algor/include/bus.h      Sat Feb 18 23:28:28 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.10 2005/12/11 12:16:08 christos Exp $        */
+/*     $NetBSD: bus.h,v 1.10.2.1 2006/02/18 23:28:28 yamt Exp $        */
 
 /*-
  * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -630,7 +630,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.
diff -r 3be9979c3a54 -r d4745c058bfe sys/arch/hpcsh/include/bus.h
--- a/sys/arch/hpcsh/include/bus.h      Sat Feb 18 23:21:32 2006 +0000
+++ b/sys/arch/hpcsh/include/bus.h      Sat Feb 18 23:28:28 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.11 2005/12/11 12:17:36 christos Exp $        */
+/*     $NetBSD: bus.h,v 1.11.2.1 2006/02/18 23:28:28 yamt Exp $        */
 
 /*-
  * Copyright (c) 1997, 1998, 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -730,7 +730,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.
diff -r 3be9979c3a54 -r d4745c058bfe sys/arch/mips/include/bus_dma.h
--- a/sys/arch/mips/include/bus_dma.h   Sat Feb 18 23:21:32 2006 +0000
+++ b/sys/arch/mips/include/bus_dma.h   Sat Feb 18 23:28:28 2006 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.h,v 1.5 2005/12/11 12:18:09 christos Exp $ */
+/* $NetBSD: bus_dma.h,v 1.5.2.1 2006/02/18 23:28:28 yamt Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -210,7 +210,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.
diff -r 3be9979c3a54 -r d4745c058bfe sys/arch/mips/mips/bus_dma.c
--- a/sys/arch/mips/mips/bus_dma.c      Sat Feb 18 23:21:32 2006 +0000
+++ b/sys/arch/mips/mips/bus_dma.c      Sat Feb 18 23:28:28 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.16.2.1 2006/02/18 11:12:19 yamt Exp $    */
+/*     $NetBSD: bus_dma.c,v 1.16.2.2 2006/02/18 23:28:28 yamt Exp $    */
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.16.2.1 2006/02/18 11:12:19 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.16.2.2 2006/02/18 23:28:28 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -95,7 +95,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;
@@ -262,7 +262,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
@@ -316,7 +316,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);
 }
@@ -365,7 +365,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);
 }
@@ -471,8 +471,8 @@
         *
         * This should be true the vast majority of the time.
         */
-       if (__predict_true(map->_dm_proc == NULL || 
-               map->_dm_proc == curlwp->l_proc))
+       if (__predict_true(VMSPACE_IS_KERNEL_P(map->_dm_vmspace) ||
+           map->_dm_vmspace == curproc->p_vmspace))
                useindex = 0;
        else
                useindex = 1;
diff -r 3be9979c3a54 -r d4745c058bfe sys/arch/newsmips/include/bus.h
--- a/sys/arch/newsmips/include/bus.h   Sat Feb 18 23:21:32 2006 +0000
+++ b/sys/arch/newsmips/include/bus.h   Sat Feb 18 23:28:28 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.13.2.1 2006/02/18 15:38:43 yamt Exp $        */
+/*     $NetBSD: bus.h,v 1.13.2.2 2006/02/18 23:28:28 yamt Exp $        */
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -614,7 +614,7 @@
        int             _dm_flags;      /* misc. flags */
        int             _dm_maptbl;     /* DMA mapping table index */
        int             _dm_maptblcnt;  /* number of DMA mapping table */
-       struct proc     *_dm_proc;      /* proc that owns the mapping */
+       struct vmspace  *_dm_vmspace;   /* vmspace that owns the mapping */
 
        /*
         * PUBLIC MEMBERS: these are used by machine-independent code.
diff -r 3be9979c3a54 -r d4745c058bfe sys/arch/newsmips/newsmips/bus.c
--- a/sys/arch/newsmips/newsmips/bus.c  Sat Feb 18 23:21:32 2006 +0000
+++ b/sys/arch/newsmips/newsmips/bus.c  Sat Feb 18 23:28:28 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.c,v 1.22.2.1 2006/02/18 14:26:06 yamt Exp $        */
+/*     $NetBSD: bus.c,v 1.22.2.2 2006/02/18 23:28:28 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.22.2.1 2006/02/18 14:26:06 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.22.2.2 2006/02/18 23:28:28 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -173,7 +173,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;
@@ -316,7 +316,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
@@ -370,7 +370,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;
 }
@@ -418,7 +418,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;
 }
@@ -449,7 +449,7 @@
        map->dm_mapsize = 0;
        map->dm_nsegs = 0;
        map->_dm_flags &= ~NEWSMIPS_DMAMAP_COHERENT;
-       map->_dm_proc = NULL;
+       map->_dm_vmspace = NULL;
 }
 
 #ifdef MIPS1
@@ -628,7 +628,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;



Home | Main Index | Thread Index | Old Index