diff options
| author | thorpej <thorpej@NetBSD.org> | 1998-02-04 05:12:46 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 1998-02-04 05:12:46 +0000 |
| commit | 8abe76d2f09ed46db2694080253e1623501ac3f7 (patch) | |
| tree | 16a9f663c517aab7299fd828dd585608afccb293 /sys/arch | |
| parent | 99cc8482d1b6d02bcdee248c019e5e8b3767e1a1 (diff) | |
Add offset and length parameters to bus_dmamap_sync(), used for specifiying
partial syncs of a DMA mapping.
Diffstat (limited to 'sys/arch')
| -rw-r--r-- | sys/arch/alpha/common/bus_dma.c | 8 | ||||
| -rw-r--r-- | sys/arch/alpha/include/bus.h | 11 | ||||
| -rw-r--r-- | sys/arch/arm32/include/bus.h | 11 | ||||
| -rw-r--r-- | sys/arch/bebox/bebox/bus_dma.c | 6 | ||||
| -rw-r--r-- | sys/arch/bebox/include/bus.h | 11 | ||||
| -rw-r--r-- | sys/arch/bebox/isa/isadma.c | 12 | ||||
| -rw-r--r-- | sys/arch/bebox/isa/isadma_machdep.c | 27 | ||||
| -rw-r--r-- | sys/arch/i386/i386/machdep.c | 6 | ||||
| -rw-r--r-- | sys/arch/i386/include/bus.h | 11 | ||||
| -rw-r--r-- | sys/arch/i386/isa/isa_machdep.c | 27 | ||||
| -rw-r--r-- | sys/arch/sparc/dev/vme_machdep.c | 16 | ||||
| -rw-r--r-- | sys/arch/sparc/include/bus.h | 11 | ||||
| -rw-r--r-- | sys/arch/sparc/sparc/machdep.c | 10 |
13 files changed, 105 insertions, 62 deletions
diff --git a/sys/arch/alpha/common/bus_dma.c b/sys/arch/alpha/common/bus_dma.c index 60d8f94bdd6..45c528ea73b 100644 --- a/sys/arch/alpha/common/bus_dma.c +++ b/sys/arch/alpha/common/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.11 1998/02/04 01:57:27 thorpej Exp $ */ +/* $NetBSD: bus_dma.c,v 1.12 1998/02/04 05:12:46 thorpej Exp $ */ /*- * Copyright (c) 1997, 1998 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.11 1998/02/04 01:57:27 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.12 1998/02/04 05:12:46 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -346,9 +346,11 @@ _bus_dmamap_unload(t, map) * by chipset-specific DMA map synchronization functions. */ void -_bus_dmamap_sync(t, map, ops) +_bus_dmamap_sync(t, map, offset, len, ops) bus_dma_tag_t t; bus_dmamap_t map; + bus_addr_t offset; + bus_size_t len; int ops; { diff --git a/sys/arch/alpha/include/bus.h b/sys/arch/alpha/include/bus.h index 70bbbb7f1f3..0c30e8da109 100644 --- a/sys/arch/alpha/include/bus.h +++ b/sys/arch/alpha/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.18 1998/02/04 01:57:28 thorpej Exp $ */ +/* $NetBSD: bus.h,v 1.19 1998/02/04 05:12:47 thorpej Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -480,7 +480,7 @@ struct alpha_bus_dma_tag { bus_dma_segment_t *, int, bus_size_t, int)); void (*_dmamap_unload) __P((bus_dma_tag_t, bus_dmamap_t)); void (*_dmamap_sync) __P((bus_dma_tag_t, bus_dmamap_t, - int)); + bus_addr_t, bus_size_t, int)); /* * DMA memory utility functions. @@ -513,9 +513,9 @@ struct alpha_bus_dma_tag { (*(t)->_dmamap_load_raw)((t), (m), (sg), (n), (s), (f)) #define bus_dmamap_unload(t, p) \ (*(t)->_dmamap_unload)((t), (p)) -#define bus_dmamap_sync(t, p, o) \ +#define bus_dmamap_sync(t, p, o, l, ops) \ (void)((t)->_dmamap_sync ? \ - (*(t)->_dmamap_sync)((t), (p), (o)) : (void)0) + (*(t)->_dmamap_sync)((t), (p), (o), (l), (ops)) : (void)0) #define bus_dmamem_alloc(t, s, a, b, sg, n, r, f) \ (*(t)->_dmamem_alloc)((t), (s), (a), (b), (sg), (n), (r), (f)) @@ -576,7 +576,8 @@ int _bus_dmamap_load_raw_direct_common __P((bus_dma_tag_t, int, bus_addr_t)); void _bus_dmamap_unload __P((bus_dma_tag_t, bus_dmamap_t)); -void _bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, int)); +void _bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, bus_addr_t, + bus_size_t, int)); int _bus_dmamem_alloc __P((bus_dma_tag_t tag, bus_size_t size, bus_size_t alignment, bus_size_t boundary, diff --git a/sys/arch/arm32/include/bus.h b/sys/arch/arm32/include/bus.h index 56f26e28cf5..6d0c9a0ed5d 100644 --- a/sys/arch/arm32/include/bus.h +++ b/sys/arch/arm32/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.7 1998/02/04 01:57:29 thorpej Exp $ */ +/* $NetBSD: bus.h,v 1.8 1998/02/04 05:12:48 thorpej Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -647,7 +647,7 @@ struct arm32_bus_dma_tag { bus_dma_segment_t *, int, bus_size_t, int)); void (*_dmamap_unload) __P((bus_dma_tag_t, bus_dmamap_t)); void (*_dmamap_sync) __P((bus_dma_tag_t, bus_dmamap_t, - int)); + bus_addr_t, bus_size_t, int)); /* * DMA memory utility functions. @@ -677,9 +677,9 @@ struct arm32_bus_dma_tag { (*(t)->_dmamap_load_raw)((t), (m), (sg), (n), (s), (f)) #define bus_dmamap_unload(t, p) \ (*(t)->_dmamap_unload)((t), (p)) -#define bus_dmamap_sync(t, p, o) \ +#define bus_dmamap_sync(t, p, o, l, ops) \ (void)((t)->_dmamap_sync ? \ - (*(t)->_dmamap_sync)((t), (p), (o)) : (void)0) + (*(t)->_dmamap_sync)((t), (p), (o), (l), (ops)) : (void)0) #define bus_dmamem_alloc(t, s, a, b, sg, n, r, f) \ (*(t)->_dmamem_alloc)((t), (s), (a), (b), (sg), (n), (r), (f)) @@ -732,7 +732,8 @@ int _bus_dmamap_load_uio __P((bus_dma_tag_t, bus_dmamap_t, int _bus_dmamap_load_raw __P((bus_dma_tag_t, bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int)); void _bus_dmamap_unload __P((bus_dma_tag_t, bus_dmamap_t)); -void _bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, int)); +void _bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, bus_addr_t, + bus_size_t, int)); int _bus_dmamem_alloc __P((bus_dma_tag_t tag, bus_size_t size, bus_size_t alignment, bus_size_t boundary, diff --git a/sys/arch/bebox/bebox/bus_dma.c b/sys/arch/bebox/bebox/bus_dma.c index 0bdcfeb08d3..105d01c03d2 100644 --- a/sys/arch/bebox/bebox/bus_dma.c +++ b/sys/arch/bebox/bebox/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.6 1998/02/04 01:57:31 thorpej Exp $ */ +/* $NetBSD: bus_dma.c,v 1.7 1998/02/04 05:12:50 thorpej Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -332,9 +332,11 @@ _bus_dmamap_unload(t, map) * by bus-specific DMA map synchronization functions. */ void -_bus_dmamap_sync(t, map, ops) +_bus_dmamap_sync(t, map, offset, len, ops) bus_dma_tag_t t; bus_dmamap_t map; + bus_addr_t offset; + bus_size_t len; int ops; { diff --git a/sys/arch/bebox/include/bus.h b/sys/arch/bebox/include/bus.h index 5332ef39517..e7498986f31 100644 --- a/sys/arch/bebox/include/bus.h +++ b/sys/arch/bebox/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.8 1998/02/04 01:57:32 thorpej Exp $ */ +/* $NetBSD: bus.h,v 1.9 1998/02/04 05:12:51 thorpej Exp $ */ /* $OpenBSD: bus.h,v 1.1 1997/10/13 10:53:42 pefo Exp $ */ /*- @@ -937,7 +937,7 @@ struct bebox_bus_dma_tag { bus_dma_segment_t *, int, bus_size_t, int)); void (*_dmamap_unload) __P((bus_dma_tag_t, bus_dmamap_t)); void (*_dmamap_sync) __P((bus_dma_tag_t, bus_dmamap_t, - int)); + bus_addr_t, bus_size_t, int)); /* * DMA memory utility functions. @@ -967,9 +967,9 @@ struct bebox_bus_dma_tag { (*(t)->_dmamap_load_raw)((t), (m), (sg), (n), (s), (f)) #define bus_dmamap_unload(t, p) \ (*(t)->_dmamap_unload)((t), (p)) -#define bus_dmamap_sync(t, p, o) \ +#define bus_dmamap_sync(t, p, o, l, ops) \ (void)((t)->_dmamap_sync ? \ - (*(t)->_dmamap_sync)((t), (p), (o)) : (void)0) + (*(t)->_dmamap_sync)((t), (p), (o), (l), (ops)) : (void)0) #define bus_dmamem_alloc(t, s, a, b, sg, n, r, f) \ (*(t)->_dmamem_alloc)((t), (s), (a), (b), (sg), (n), (r), (f)) @@ -1020,7 +1020,8 @@ int _bus_dmamap_load_uio __P((bus_dma_tag_t, bus_dmamap_t, int _bus_dmamap_load_raw __P((bus_dma_tag_t, bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int)); void _bus_dmamap_unload __P((bus_dma_tag_t, bus_dmamap_t)); -void _bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, int)); +void _bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, bus_addr_t, + bus_size_t, int)); int _bus_dmamem_alloc __P((bus_dma_tag_t tag, bus_size_t size, bus_size_t alignment, bus_size_t boundary, diff --git a/sys/arch/bebox/isa/isadma.c b/sys/arch/bebox/isa/isadma.c index 1a6b17485ed..e3e7d112e83 100644 --- a/sys/arch/bebox/isa/isadma.c +++ b/sys/arch/bebox/isa/isadma.c @@ -1,7 +1,7 @@ -/* $NetBSD: isadma.c,v 1.1 1997/10/14 06:49:04 sakamoto Exp $ */ +/* $NetBSD: isadma.c,v 1.2 1998/02/04 05:12:52 thorpej Exp $ */ /*- - * Copyright (c) 1997 The NetBSD Foundation, Inc. + * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -288,10 +288,12 @@ isa_dmastart(isadev, chan, addr, nbytes, p, flags, busdmaflags) #endif if (flags & DMAMODE_READ) { - bus_dmamap_sync(sc->sc_dmat, dmam, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->sc_dmat, dmam, 0, dmam->dm_mapsize, + BUS_DMASYNC_PREREAD); sc->sc_dmareads |= (1 << chan); } else { - bus_dmamap_sync(sc->sc_dmat, dmam, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(sc->sc_dmat, dmam, 0, dmam->dm_mapsize, + BUS_DMASYNC_PREWRITE); sc->sc_dmareads &= ~(1 << chan); } @@ -469,7 +471,7 @@ isa_dmadone(isadev, chan) printf("%s: isa_dmadone: channel %d not finished\n", sc->sc_dev.dv_xname, chan); - bus_dmamap_sync(sc->sc_dmat, dmam, + bus_dmamap_sync(sc->sc_dmat, dmam, 0, dmam->dm_mapsize, (sc->sc_dmareads & (1 << chan)) ? BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE); diff --git a/sys/arch/bebox/isa/isadma_machdep.c b/sys/arch/bebox/isa/isadma_machdep.c index b5fa3a8cd03..b8028fac192 100644 --- a/sys/arch/bebox/isa/isadma_machdep.c +++ b/sys/arch/bebox/isa/isadma_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: isadma_machdep.c,v 1.4 1998/02/04 01:57:33 thorpej Exp $ */ +/* $NetBSD: isadma_machdep.c,v 1.5 1998/02/04 05:12:52 thorpej Exp $ */ #define ISA_DMA_STATS @@ -115,7 +115,7 @@ int _isa_bus_dmamap_load_raw __P((bus_dma_tag_t, bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int)); void _isa_bus_dmamap_unload __P((bus_dma_tag_t, bus_dmamap_t)); void _isa_bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, - int)); + bus_addr_t, bus_size_t, int)); int _isa_bus_dmamem_alloc __P((bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, bus_dma_segment_t *, int, int *, int)); @@ -437,9 +437,11 @@ _isa_bus_dmamap_unload(t, map) * Synchronize an ISA DMA map. */ void -_isa_bus_dmamap_sync(t, map, ops) +_isa_bus_dmamap_sync(t, map, offset, len, ops) bus_dma_tag_t t; bus_dmamap_t map; + bus_addr_t offset; + bus_size_t len; int ops; { struct bebox_isa_dma_cookie *cookie = map->_dm_cookie; @@ -451,6 +453,15 @@ _isa_bus_dmamap_sync(t, map, ops) (ops & (BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE)) != 0) panic("_isa_bus_dmamap_sync: mix PRE and POST"); +#ifdef DIAGNOSTIC + if ((ops & (BUS_DMASYNC_PREWRITE|BUS_DMASYNC_POSTREAD)) != 0) { + if (offset >= map->dm_mapsize) + panic("_isa_bus_dmamap_sync: bad offset"); + if (len == 0 || (offset + len) > map->dm_mapsize) + panic("_isa_bus_dmamap_sync: bad length"); + } +#endif + /* * Nothing to do for pre-read. */ @@ -461,8 +472,8 @@ _isa_bus_dmamap_sync(t, map, ops) * caller's buffer to the bounce buffer. */ if (cookie->id_flags & ID_IS_BOUNCING) - bcopy(cookie->id_origbuf, cookie->id_bouncebuf, - cookie->id_origbuflen); + bcopy(cookie->id_origbuf + offset, + cookie->id_bouncebuf + offset, len); } if (ops & BUS_DMASYNC_POSTREAD) { @@ -471,8 +482,8 @@ _isa_bus_dmamap_sync(t, map, ops) * bounce buffer to the caller's buffer. */ if (cookie->id_flags & ID_IS_BOUNCING) - bcopy(cookie->id_bouncebuf, cookie->id_origbuf, - cookie->id_origbuflen); + bcopy(cookie->id_bouncebuf + offset, + cookie->id_origbuf + offset, len); } /* @@ -481,7 +492,7 @@ _isa_bus_dmamap_sync(t, map, ops) #if 0 /* This is a noop anyhow, so why bother calling it? */ - _bus_dmamap_sync(t, map, op); + _bus_dmamap_sync(t, map, offset, len, ops); #endif } diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index e278ffbd040..724596a128f 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.281 1998/02/04 01:57:34 thorpej Exp $ */ +/* $NetBSD: machdep.c,v 1.282 1998/02/04 05:12:54 thorpej Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -2416,9 +2416,11 @@ _bus_dmamap_unload(t, map) * by bus-specific DMA map synchronization functions. */ void -_bus_dmamap_sync(t, map, ops) +_bus_dmamap_sync(t, map, offset, len, ops) bus_dma_tag_t t; bus_dmamap_t map; + bus_addr_t offset; + bus_size_t len; int ops; { diff --git a/sys/arch/i386/include/bus.h b/sys/arch/i386/include/bus.h index 0565a11d124..0c2d8f4b593 100644 --- a/sys/arch/i386/include/bus.h +++ b/sys/arch/i386/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.14 1998/02/04 01:57:36 thorpej Exp $ */ +/* $NetBSD: bus.h,v 1.15 1998/02/04 05:12:56 thorpej Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -907,7 +907,7 @@ struct i386_bus_dma_tag { bus_dma_segment_t *, int, bus_size_t, int)); void (*_dmamap_unload) __P((bus_dma_tag_t, bus_dmamap_t)); void (*_dmamap_sync) __P((bus_dma_tag_t, bus_dmamap_t, - int)); + bus_addr_t, bus_size_t, int)); /* * DMA memory utility functions. @@ -937,9 +937,9 @@ struct i386_bus_dma_tag { (*(t)->_dmamap_load_raw)((t), (m), (sg), (n), (s), (f)) #define bus_dmamap_unload(t, p) \ (*(t)->_dmamap_unload)((t), (p)) -#define bus_dmamap_sync(t, p, o) \ +#define bus_dmamap_sync(t, p, o, l, ops) \ (void)((t)->_dmamap_sync ? \ - (*(t)->_dmamap_sync)((t), (p), (o)) : (void)0) + (*(t)->_dmamap_sync)((t), (p), (o), (l), (ops)) : (void)0) #define bus_dmamem_alloc(t, s, a, b, sg, n, r, f) \ (*(t)->_dmamem_alloc)((t), (s), (a), (b), (sg), (n), (r), (f)) @@ -990,7 +990,8 @@ int _bus_dmamap_load_uio __P((bus_dma_tag_t, bus_dmamap_t, int _bus_dmamap_load_raw __P((bus_dma_tag_t, bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int)); void _bus_dmamap_unload __P((bus_dma_tag_t, bus_dmamap_t)); -void _bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, int)); +void _bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, bus_addr_t, + bus_size_t, int)); int _bus_dmamem_alloc __P((bus_dma_tag_t tag, bus_size_t size, bus_size_t alignment, bus_size_t boundary, diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c index 1b843f600a3..1af3aa2fd7b 100644 --- a/sys/arch/i386/isa/isa_machdep.c +++ b/sys/arch/i386/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.c,v 1.27 1998/02/04 01:57:38 thorpej Exp $ */ +/* $NetBSD: isa_machdep.c,v 1.28 1998/02/04 05:12:57 thorpej Exp $ */ #define ISA_DMA_STATS @@ -127,7 +127,7 @@ int _isa_bus_dmamap_load_raw __P((bus_dma_tag_t, bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int)); void _isa_bus_dmamap_unload __P((bus_dma_tag_t, bus_dmamap_t)); void _isa_bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, - int)); + bus_addr_t, bus_size_t, int)); int _isa_bus_dmamem_alloc __P((bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, bus_dma_segment_t *, int, int *, int)); @@ -862,9 +862,11 @@ _isa_bus_dmamap_unload(t, map) * Synchronize an ISA DMA map. */ void -_isa_bus_dmamap_sync(t, map, ops) +_isa_bus_dmamap_sync(t, map, offset, len, ops) bus_dma_tag_t t; bus_dmamap_t map; + bus_addr_t offset; + bus_size_t len; int ops; { struct i386_isa_dma_cookie *cookie = map->_dm_cookie; @@ -876,6 +878,15 @@ _isa_bus_dmamap_sync(t, map, ops) (ops & (BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE)) != 0) panic("_isa_bus_dmamap_sync: mix PRE and POST"); +#ifdef DIAGNOSTIC + if ((ops & (BUS_DMASYNC_PREWRITE|BUS_DMASYNC_POSTREAD)) != 0) { + if (offset >= map->dm_mapsize) + panic("_isa_bus_dmamap_sync: bad offset"); + if (len == 0 || (offset + len) > map->dm_mapsize) + panic("_isa_bus_dmamap_sync: bad length"); + } +#endif + /* * Nothing to do for pre-read. */ @@ -886,8 +897,8 @@ _isa_bus_dmamap_sync(t, map, ops) * caller's buffer to the bounce buffer. */ if (cookie->id_flags & ID_IS_BOUNCING) - bcopy(cookie->id_origbuf, cookie->id_bouncebuf, - cookie->id_origbuflen); + bcopy(cookie->id_origbuf + offset, + cookie->id_bouncebuf + offset, len); } if (ops & BUS_DMASYNC_POSTREAD) { @@ -896,8 +907,8 @@ _isa_bus_dmamap_sync(t, map, ops) * bounce buffer to the caller's buffer. */ if (cookie->id_flags & ID_IS_BOUNCING) - bcopy(cookie->id_bouncebuf, cookie->id_origbuf, - cookie->id_origbuflen); + bcopy(cookie->id_bouncebuf + offset, + cookie->id_origbuf + offset, len); } /* @@ -906,7 +917,7 @@ _isa_bus_dmamap_sync(t, map, ops) #if 0 /* This is a noop anyhow, so why bother calling it? */ - _bus_dmamap_sync(t, map, op); + _bus_dmamap_sync(t, map, offset, len, ops); #endif } diff --git a/sys/arch/sparc/dev/vme_machdep.c b/sys/arch/sparc/dev/vme_machdep.c index b1f03df771f..07dee59499e 100644 --- a/sys/arch/sparc/dev/vme_machdep.c +++ b/sys/arch/sparc/dev/vme_machdep.c @@ -1,7 +1,7 @@ -/* $NetBSD: vme_machdep.c,v 1.3 1998/02/04 01:57:40 thorpej Exp $ */ +/* $NetBSD: vme_machdep.c,v 1.4 1998/02/04 05:12:58 thorpej Exp $ */ /*- - * Copyright (c) 1997 The NetBSD Foundation, Inc. + * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -116,7 +116,7 @@ static int sparc_vme4_dmamap_load __P((bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t, struct proc *, int)); static void sparc_vme4_dmamap_unload __P((bus_dma_tag_t, bus_dmamap_t)); static void sparc_vme4_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, - int)); + bus_addr_t, bus_size_t, int)); static int sparc_vme4_dmamem_alloc __P((bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, bus_dma_segment_t *, @@ -133,7 +133,7 @@ static int sparc_vme4m_dmamap_load __P((bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t, struct proc *, int)); static void sparc_vme4m_dmamap_unload __P((bus_dma_tag_t, bus_dmamap_t)); static void sparc_vme4m_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, - int)); + bus_addr_t, bus_size_t, int)); static int sparc_vme4m_dmamem_alloc __P((bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, bus_dma_segment_t *, @@ -789,9 +789,11 @@ sparc_vme4_dmamem_free(t, segs, nsegs) } void -sparc_vme4_dmamap_sync(t, map, ops) +sparc_vme4_dmamap_sync(t, map, offset, len, ops) bus_dma_tag_t t; bus_dmamap_t map; + bus_addr_t offset; + bus_size_t len; int ops; { @@ -904,9 +906,11 @@ sparc_vme4m_dmamem_free(t, segs, nsegs) } void -sparc_vme4m_dmamap_sync(t, map, ops) +sparc_vme4m_dmamap_sync(t, map, offset, len, ops) bus_dma_tag_t t; bus_dmamap_t map; + bus_addr_t offset; + bus_size_t len; int ops; { diff --git a/sys/arch/sparc/include/bus.h b/sys/arch/sparc/include/bus.h index f69c11bbd13..a4ccf516925 100644 --- a/sys/arch/sparc/include/bus.h +++ b/sys/arch/sparc/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.5 1998/02/04 01:57:41 thorpej Exp $ */ +/* $NetBSD: bus.h,v 1.6 1998/02/04 05:12:59 thorpej Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -397,7 +397,7 @@ struct sparc_bus_dma_tag { bus_dma_segment_t *, int, bus_size_t, int)); void (*_dmamap_unload) __P((bus_dma_tag_t, bus_dmamap_t)); void (*_dmamap_sync) __P((bus_dma_tag_t, bus_dmamap_t, - int)); + bus_addr_t, bus_size_t, int)); /* * DMA memory utility functions. @@ -427,9 +427,9 @@ struct sparc_bus_dma_tag { (*(t)->_dmamap_load_raw)((t), (m), (sg), (n), (s), (f)) #define bus_dmamap_unload(t, p) \ (*(t)->_dmamap_unload)((t), (p)) -#define bus_dmamap_sync(t, p, o) \ +#define bus_dmamap_sync(t, p, o, l, ops) \ (void)((t)->_dmamap_sync ? \ - (*(t)->_dmamap_sync)((t), (p), (o)) : (void)0) + (*(t)->_dmamap_sync)((t), (p), (o), (l), (ops)) : (void)0) #define bus_dmamem_alloc(t, s, a, b, sg, n, r, f) \ (*(t)->_dmamem_alloc)((t), (s), (a), (b), (sg), (n), (r), (f)) @@ -480,7 +480,8 @@ int _bus_dmamap_load_uio __P((bus_dma_tag_t, bus_dmamap_t, int _bus_dmamap_load_raw __P((bus_dma_tag_t, bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int)); void _bus_dmamap_unload __P((bus_dma_tag_t, bus_dmamap_t)); -void _bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, int)); +void _bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, bus_addr_t, + bus_size_t, int)); int _bus_dmamem_alloc __P((bus_dma_tag_t tag, bus_size_t size, bus_size_t alignment, bus_size_t boundary, diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 27dd693b3d2..0464e707871 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.99 1998/02/04 01:57:42 thorpej Exp $ */ +/* $NetBSD: machdep.c,v 1.100 1998/02/04 05:13:00 thorpej Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -1410,13 +1410,17 @@ _bus_dmamap_unload(t, map) * by bus-specific DMA map synchronization functions. */ void -_bus_dmamap_sync(t, map, ops) +_bus_dmamap_sync(t, map, offset, len, ops) bus_dma_tag_t t; bus_dmamap_t map; + bus_addr_t offset; + bus_size_t len; int ops; { - /* Nothing to do here. */ + /* + * XXX Should flush CPU write buffers. + */ } /* |
