From 1a3ab74be6a248a9ce5e4f1a69e64bdf72ec1028 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sun, 26 Aug 2001 02:39:06 +0000 Subject: Prepare for transition to 5-parameter bus_dmamap_sync() by creating and using *_bus_dmamap_sync() defines that are defined appropriately depending on __HAS_NEW_BUS_DMAMAP_SYNC. Most of the code changes are simple reversions to the original NetBSD code. Slip in a siop_script_sync() instead of a manually done code section. --- sys/dev/ic/siopvar_common.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'sys/dev/ic/siopvar_common.h') diff --git a/sys/dev/ic/siopvar_common.h b/sys/dev/ic/siopvar_common.h index 6b2b8991b5d..da286cd0926 100644 --- a/sys/dev/ic/siopvar_common.h +++ b/sys/dev/ic/siopvar_common.h @@ -1,4 +1,4 @@ -/* $OpenBSD: siopvar_common.h,v 1.6 2001/06/25 23:14:40 krw Exp $ */ +/* $OpenBSD: siopvar_common.h,v 1.7 2001/08/26 02:39:05 krw Exp $ */ /* $NetBSD: siopvar_common.h,v 1.10 2001/01/26 21:58:56 bouyer Exp $ */ /* @@ -182,6 +182,14 @@ struct siop_lunsw { u_int32_t lunsw_size; /* size of this lun sw */ }; +#ifdef __HAS_NEW_BUS_DMAMAP_SYNC +#define siop_bus_dmamap_sync(tag, map, off, len, op) \ + bus_dmamap_sync((tag), (map), (off), (len), (op)) +#else +#define siop_bus_dmamap_sync(tag, map, off, len, op) \ + bus_dmamap_sync((tag), (map), (op)) +#endif + static __inline__ void siop_table_sync __P((struct siop_cmd *, int)); static __inline__ void siop_table_sync(siop_cmd, ops) @@ -189,7 +197,12 @@ siop_table_sync(siop_cmd, ops) int ops; { struct siop_softc *sc = siop_cmd->siop_sc; - bus_dmamap_sync(sc->sc_dmat, siop_cmd->siop_cbdp->xferdma, ops); + bus_addr_t offset; + + offset = siop_cmd->dsa - + siop_cmd->siop_cbdp->xferdma->dm_segs[0].ds_addr; + siop_bus_dmamap_sync(sc->sc_dmat, siop_cmd->siop_cbdp->xferdma, offset, + sizeof(struct siop_xfer), ops); } void siop_common_reset __P((struct siop_softc *)); -- cgit v1.2.3