summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>2002-06-10 22:27:34 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>2002-06-10 22:27:34 +0000
commit20b57726acf01366e47a793e662e001c4ec1caf3 (patch)
treec2f264d25fe4773ff7588187a1d7ec039d4caae2
parentf89fa4a231402099db1e26ddb2e8ab8746e1bc23 (diff)
old bouncebuffering api not used anymore
-rw-r--r--sys/arch/i386/isa/isa_machdep.c104
-rw-r--r--sys/dev/isa/isadmavar.h19
2 files changed, 2 insertions, 121 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 */
diff --git a/sys/dev/isa/isadmavar.h b/sys/dev/isa/isadmavar.h
index 69b6ec4093a..a2a0093a5e9 100644
--- a/sys/dev/isa/isadmavar.h
+++ b/sys/dev/isa/isadmavar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: isadmavar.h,v 1.13 2002/03/14 01:26:56 millert Exp $ */
+/* $OpenBSD: isadmavar.h,v 1.14 2002/06/10 22:27:33 niklas Exp $ */
/* $NetBSD: isadmavar.h,v 1.10 1997/08/04 22:13:33 augustss Exp $ */
/*-
@@ -48,23 +48,6 @@
/* XXX ugly.. but it's a deprecated API that uses it so it will go.. */
extern struct device *isa_dev;
-#define ISADMA_MAP_WAITOK 0x0001 /* OK for isadma_map to sleep */
-#define ISADMA_MAP_BOUNCE 0x0002 /* use bounce buffer if necessary */
-#define ISADMA_MAP_CONTIG 0x0004 /* must be physically contiguous */
-#define ISADMA_MAP_8BIT 0x0008 /* must not cross 64k boundary */
-#define ISADMA_MAP_16BIT 0x0010 /* must not cross 128k boundary */
-
-struct isadma_seg { /* a physical contiguous segment */
- vm_offset_t addr; /* address of this segment */
- vm_size_t length; /* length of this segment (bytes) */
- bus_dmamap_t dmam; /* DMA handle for bus_dma routines. */
-};
-
-int isadma_map(caddr_t, vm_size_t, struct isadma_seg *, int);
-void isadma_unmap(caddr_t, vm_size_t, int, struct isadma_seg *);
-void isadma_copytobuf(caddr_t, vm_size_t, int, struct isadma_seg *);
-void isadma_copyfrombuf(caddr_t, vm_size_t, int, struct isadma_seg *);
-
#define isadma_acquire(c) isa_dma_acquire(isa_dev, (c))
#define isadma_release(c) isa_dma_release(isa_dev, (c))
#define isadma_cascade(c) isa_dmacascade(isa_dev, (c))