summaryrefslogtreecommitdiff
path: root/sys/arch/mvmeppc
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-11-05 17:25:59 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-11-05 17:25:59 +0000
commit85530efaf7a6a42f72dd88dd2812fc34f33a931e (patch)
treefe27ed806015eba36ede599b284de31066d02abb /sys/arch/mvmeppc
parent6278fb02068a0fc75a8a6ecb4ed0a3292aad76ab (diff)
Switch everything to the new bus_dmamap_sync API.
Most work by Wilbern Cobb <vedge@csoft.org> with some fixes from me, mickey@ and drahn@.
Diffstat (limited to 'sys/arch/mvmeppc')
-rw-r--r--sys/arch/mvmeppc/include/bus_mi.h25
-rw-r--r--sys/arch/mvmeppc/mvmeppc/bus_dma.c10
2 files changed, 17 insertions, 18 deletions
diff --git a/sys/arch/mvmeppc/include/bus_mi.h b/sys/arch/mvmeppc/include/bus_mi.h
index 9ce8209835b..a2cc5b80ba3 100644
--- a/sys/arch/mvmeppc/include/bus_mi.h
+++ b/sys/arch/mvmeppc/include/bus_mi.h
@@ -1,5 +1,5 @@
/* $NetBSD: bus.h,v 1.1 2001/06/06 17:37:37 matt Exp $ */
-/* $OpenBSD: bus_mi.h,v 1.2 2001/09/23 01:42:38 miod Exp $ */
+/* $OpenBSD: bus_mi.h,v 1.3 2001/11/05 17:25:58 art Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -977,15 +977,10 @@ bus_space_copy_region_4(t, h1, o1, h2, o2, c)
struct mbuf;
struct uio;
-/*
- * Operations performed by bus_dmamap_sync().
- */
-typedef enum {
- BUS_DMASYNC_PREREAD = 0x01, /* pre-read synchronization */
- BUS_DMASYNC_POSTREAD = 0x02, /* post-read synchronization */
- BUS_DMASYNC_PREWRITE = 0x04, /* pre-write synchronization */
- BUS_DMASYNC_POSTWRITE = 0x08 /* post-write synchronization */
-} bus_dmasync_op_t;
+#define BUS_DMASYNC_PREREAD 0x01
+#define BUS_DMASYNC_POSTREAD 0x02
+#define BUS_DMASYNC_PREWRITE 0x04
+#define BUS_DMASYNC_POSTWRITE 0x08
typedef struct powerpc_bus_dma_tag *bus_dma_tag_t;
typedef struct powerpc_bus_dmamap *bus_dmamap_t;
@@ -1035,7 +1030,8 @@ struct powerpc_bus_dma_tag {
int (*_dmamap_load_raw) __P((bus_dma_tag_t, bus_dmamap_t,
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, bus_dmasync_op_t));
+ void (*_dmamap_sync) __P((bus_dma_tag_t, bus_dmamap_t,
+ bus_addr_t, bus_size_t, int));
/*
* DMA memory utility functions.
@@ -1065,9 +1061,9 @@ struct powerpc_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, a, l, o) \
(void)((t)->_dmamap_sync ? \
- (*(t)->_dmamap_sync)((t), (p), (o)) : (void)0)
+ (*(t)->_dmamap_sync)((t), (p), (a), (l), (o)) : (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))
@@ -1119,7 +1115,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, bus_dmasync_op_t));
+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/mvmeppc/mvmeppc/bus_dma.c b/sys/arch/mvmeppc/mvmeppc/bus_dma.c
index c00ab320083..eef88567b78 100644
--- a/sys/arch/mvmeppc/mvmeppc/bus_dma.c
+++ b/sys/arch/mvmeppc/mvmeppc/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.5 2001/09/19 20:50:57 mickey Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.6 2001/11/05 17:25:58 art Exp $ */
/* $NetBSD: bus_dma.c,v 1.2 2001/06/10 02:31:25 briggs Exp $ */
/*-
@@ -405,10 +405,12 @@ _bus_dmamap_unload(t, map)
*/
void
-_bus_dmamap_sync(t, map, op)
+_bus_dmamap_sync(t, map, offset, len, op)
bus_dma_tag_t t;
bus_dmamap_t map;
- bus_dmasync_op_t op;
+ bus_addr_t offset;
+ bus_size_t len;
+ int op;
{
int i;
switch (op) {
@@ -418,7 +420,7 @@ _bus_dmamap_sync(t, map, op)
case BUS_DMASYNC_PREREAD:
for (i = map->dm_nsegs; i--; )
invdcache(map->dm_segs[i].ds_addr,
- map->dm_segs[i].ds_len);
+ len);
break;
}
}