Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sgimips/sgimips Adapt to new dm_maxsegsz semantics.



details:   https://anonhg.NetBSD.org/src/rev/9d6d3e2ffeb1
branches:  trunk
changeset: 574744:9d6d3e2ffeb1
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Mar 11 07:01:55 2005 +0000

description:
Adapt to new dm_maxsegsz semantics.

diffstat:

 sys/arch/sgimips/sgimips/bus.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (72 lines):

diff -r e85247de058d -r 9d6d3e2ffeb1 sys/arch/sgimips/sgimips/bus.c
--- a/sys/arch/sgimips/sgimips/bus.c    Fri Mar 11 06:58:11 2005 +0000
+++ b/sys/arch/sgimips/sgimips/bus.c    Fri Mar 11 07:01:55 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.c,v 1.37 2004/12/17 22:59:49 sekiya Exp $  */
+/*     $NetBSD: bus.c,v 1.38 2005/03/11 07:01:55 matt Exp $    */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.37 2004/12/17 22:59:49 sekiya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.38 2005/03/11 07:01:55 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -384,10 +384,11 @@
        map = (struct sgimips_bus_dmamap *)mapstore;
        map->_dm_size = size;
        map->_dm_segcnt = nsegments;
-       map->_dm_maxsegsz = maxsegsz;
+       map->_dm_maxmaxsegsz = maxsegsz;
        map->_dm_boundary = boundary;
        map->_dm_flags = flags & ~(BUS_DMA_WAITOK|BUS_DMA_NOWAIT);
        map->_dm_proc = NULL;
+       map->dm_maxsegsz = maxsegsz;
        map->dm_mapsize = 0;            /* no valid mappings */
        map->dm_nsegs = 0;
 
@@ -464,7 +465,7 @@
                } else {
                        if (curaddr == lastaddr &&
                            (map->dm_segs[seg].ds_len + sgsize) <=
-                            map->_dm_maxsegsz &&
+                            map->dm_maxsegsz &&
                            (map->_dm_boundary == 0 ||
                             (map->dm_segs[seg].ds_addr & bmask) ==
                             (curaddr & bmask)))
@@ -511,6 +512,7 @@
         */
        map->dm_mapsize = 0;
        map->dm_nsegs = 0;
+       KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz);
 
        if (buflen > map->_dm_size)
                return EINVAL;
@@ -552,6 +554,7 @@
         */
        map->dm_mapsize = 0;
        map->dm_nsegs = 0;
+       KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz);
 
 #ifdef DIAGNOSTIC
        if ((m0->m_flags & M_PKTHDR) == 0)
@@ -598,6 +601,7 @@
         */
        map->dm_mapsize = 0;
        map->dm_nsegs = 0;
+       KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz);
 
        resid = uio->uio_resid;
        iov = uio->uio_iov;
@@ -658,6 +662,7 @@
         * No resources to free; just mark the mappings as
         * invalid.
         */
+       map->dm_maxsegsz = map->_dm_maxmaxsegsz;
        map->dm_mapsize = 0;
        map->dm_nsegs = 0;
        map->_dm_flags &= ~SGIMIPS_DMAMAP_COHERENT;



Home | Main Index | Thread Index | Old Index