Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sys/arch/evbarm/integrator Pull up revision 1.9 (reques...



details:   https://anonhg.NetBSD.org/src/rev/7f858876874a
branches:  netbsd-1-6
changeset: 529661:7f858876874a
user:      he <he%NetBSD.org@localhost>
date:      Sat Dec 07 19:25:18 2002 +0000

description:
Pull up revision 1.9 (requested by thorpej in ticket #568):
  Change the way DMA map syncs are done.  Instead of remembering
  the virtual address for each DMA segment, just cache a
  pointer to the original buffer/buftype used to load the
  DMA map, and use that.  Shrinks bus_dma_segment_t from 12
  to 8 bytes, and the cache flushing is also more efficient.

diffstat:

 sys/arch/evbarm/integrator/int_bus_dma.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (52 lines):

diff -r b9ff86e45a16 -r 7f858876874a sys/arch/evbarm/integrator/int_bus_dma.c
--- a/sys/arch/evbarm/integrator/int_bus_dma.c  Sat Dec 07 19:24:49 2002 +0000
+++ b/sys/arch/evbarm/integrator/int_bus_dma.c  Sat Dec 07 19:25:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: int_bus_dma.c,v 1.7 2002/04/05 16:58:08 thorpej Exp $  */
+/*     $NetBSD: int_bus_dma.c,v 1.7.4.1 2002/12/07 19:25:18 he Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -109,6 +109,8 @@
        if (error == 0) {
                map->dm_mapsize = buflen;
                map->dm_nsegs = seg + 1;
+               map->_dm_origbuf = buf;
+               map->_dm_buftype = ARM32_BUFTYPE_LINEAR;
                map->_dm_proc = p;
        }
 #ifdef DEBUG_DMA
@@ -161,6 +163,8 @@
        if (error == 0) {
                map->dm_mapsize = m0->m_pkthdr.len;
                map->dm_nsegs = seg + 1;
+               map->_dm_origbuf = m0;
+               map->_dm_buftype = ARM32_BUFTYPE_MBUF;
                map->_dm_proc = NULL;   /* always kernel */
        }
 #ifdef DEBUG_DMA
@@ -223,6 +227,8 @@
        if (error == 0) {
                map->dm_mapsize = uio->uio_resid;
                map->dm_nsegs = seg + 1;
+               map->_dm_origbuf = uio;
+               map->_dm_buftype = ARM32_BUFTYPE_UIO;
                map->_dm_proc = p;
        }
        return (error);
@@ -480,7 +486,6 @@
                if (first) {
                        map->dm_segs[seg].ds_addr = LOCAL_TO_CM_ALIAS(curaddr);
                        map->dm_segs[seg].ds_len = sgsize;
-                       map->dm_segs[seg]._ds_vaddr = vaddr;
                        first = 0;
                } else {
                        if (curaddr == lastaddr &&
@@ -495,7 +500,6 @@
                                        break;
                                map->dm_segs[seg].ds_addr = LOCAL_TO_CM_ALIAS(curaddr);
                                map->dm_segs[seg].ds_len = sgsize;
-                               map->dm_segs[seg]._ds_vaddr = vaddr;
                        }
                }
 



Home | Main Index | Thread Index | Old Index