diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2002-06-10 22:27:34 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2002-06-10 22:27:34 +0000 |
commit | 20b57726acf01366e47a793e662e001c4ec1caf3 (patch) | |
tree | c2f264d25fe4773ff7588187a1d7ec039d4caae2 /sys/arch/i386 | |
parent | f89fa4a231402099db1e26ddb2e8ab8746e1bc23 (diff) |
old bouncebuffering api not used anymore
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/isa/isa_machdep.c | 104 |
1 files changed, 1 insertions, 103 deletions
diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c index 87463b342c8..fda6b3822b8 100644 --- a/sys/arch/i386/isa/isa_machdep.c +++ b/sys/arch/i386/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isa_machdep.c,v 1.45 2002/03/14 01:26:33 millert Exp $ */ +/* $OpenBSD: isa_machdep.c,v 1.46 2002/06/10 22:27:33 niklas Exp $ */ /* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */ #define ISA_DMA_STATS @@ -1152,106 +1152,4 @@ _isa_dma_free_bouncebuf(t, map) cookie->id_nbouncesegs = 0; cookie->id_flags &= ~ID_HAS_BOUNCE; } - -#ifdef __ISADMA_COMPAT -/* - * setup (addr, nbytes) for an ISA dma transfer. - * flags&ISADMA_MAP_WAITOK may wait - * flags&ISADMA_MAP_BOUNCE may use a bounce buffer if necessary - * flags&ISADMA_MAP_CONTIG result must be physically contiguous - * flags&ISADMA_MAP_8BIT must not cross 64k boundary - * flags&ISADMA_MAP_16BIT must not cross 128k boundary - * - * returns the number of used phys entries, 0 on failure. - * if flags&ISADMA_MAP_CONTIG result is 1 on sucess! - */ -int -isadma_map(addr, nbytes, phys, flags) - caddr_t addr; - vm_size_t nbytes; - struct isadma_seg *phys; - int flags; -{ - bus_dma_tag_t dmat = ((struct isa_softc *)isa_dev)->sc_dmat; - bus_dmamap_t dmam; - int i; - -/* XXX if this turns out to be too low, convert the driver to real bus_dma */ -#define ISADMA_MAX_SEGMENTS 64 -#define ISADMA_MAX_SEGSZ 0xffffff - - if (bus_dmamap_create(dmat, nbytes, - (flags & ISADMA_MAP_CONTIG) ? 1 : ISADMA_MAX_SEGMENTS, - ISADMA_MAX_SEGSZ, - (flags & ISADMA_MAP_8BIT) ? 0xffff : - ((flags & ISADMA_MAP_16BIT) ? 0x1ffff : 0), - (flags & ISADMA_MAP_WAITOK) ? BUS_DMA_WAITOK : BUS_DMA_NOWAIT, - &dmam) != 0) - return (0); - if (bus_dmamap_load(dmat, dmam, addr, nbytes, 0, - (flags & ISADMA_MAP_WAITOK) ? BUS_DMA_WAITOK : BUS_DMA_NOWAIT) != - 0) { - bus_dmamap_destroy(dmat, dmam); - return (0); - } - for (i = 0; i < dmam->dm_nsegs; i++) { - phys[i].addr = dmam->dm_segs[i].ds_addr; - phys[i].length = dmam->dm_segs[i].ds_len; - } - phys[0].dmam = dmam; - return (dmam->dm_nsegs); -} - -/* - * undo a ISA dma mapping. Simply return the bounced segments to the pool. - */ -void -isadma_unmap(addr, nbytes, nphys, phys) - caddr_t addr; - vm_size_t nbytes; - int nphys; - struct isadma_seg *phys; -{ - bus_dma_tag_t dmat = ((struct isa_softc *)isa_dev)->sc_dmat; - bus_dmamap_t dmam = phys[0].dmam; - - if (dmam == NULL) - return; - bus_dmamap_unload(dmat, dmam); - bus_dmamap_destroy(dmat, dmam); - phys[0].dmam = NULL; -} - -/* - * copy bounce buffer to buffer where needed - */ -void -isadma_copyfrombuf(addr, nbytes, nphys, phys) - caddr_t addr; - vm_size_t nbytes; - int nphys; - struct isadma_seg *phys; -{ - bus_dma_tag_t dmat = ((struct isa_softc *)isa_dev)->sc_dmat; - bus_dmamap_t dmam = phys[0].dmam; - - bus_dmamap_sync(dmat, dmam, 0, dmam->dm_mapsize, BUS_DMASYNC_POSTREAD); -} - -/* - * copy buffer to bounce buffer where needed - */ -void -isadma_copytobuf(addr, nbytes, nphys, phys) - caddr_t addr; - vm_size_t nbytes; - int nphys; - struct isadma_seg *phys; -{ - bus_dma_tag_t dmat = ((struct isa_softc *)isa_dev)->sc_dmat; - bus_dmamap_t dmam = phys[0].dmam; - - bus_dmamap_sync(dmat, dmam, 0, dmam->dm_mapsize, BUS_DMASYNC_PREWRITE); -} -#endif /* __ISADMA_COMPAT */ #endif /* NISADMA > 0 */ |