diff options
author | nyan <nyan@FreeBSD.org> | 2003-02-07 14:05:34 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2003-02-07 14:05:34 +0000 |
commit | 3391eada81b7f6040f4ba8596e92787f4398bccd (patch) | |
tree | bb7186a3521199202c6d88ec66567221b0ead322 /sys/dev/sound/pcm/buffer.c | |
parent | e495da0cd39b3a144132e16be2f4cf8eed2d13b0 (diff) | |
download | FreeBSD-src-3391eada81b7f6040f4ba8596e92787f4398bccd.zip FreeBSD-src-3391eada81b7f6040f4ba8596e92787f4398bccd.tar.gz |
- Clean up ISA DMA supports.
- Rename all sndbuf_isadma* functions to sndbuf_dma* and move them into
sys/dev/sound/isa/sndbuf_dma.c.
No response from: sound
Diffstat (limited to 'sys/dev/sound/pcm/buffer.c')
-rw-r--r-- | sys/dev/sound/pcm/buffer.c | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c index dd74271..645e3b3 100644 --- a/sys/dev/sound/pcm/buffer.c +++ b/sys/dev/sound/pcm/buffer.c @@ -30,27 +30,6 @@ SND_DECLARE_FILE("$FreeBSD$"); -#define SNDBUF_NAMELEN 48 -struct snd_dbuf { - device_t dev; - u_int8_t *buf, *tmpbuf; - unsigned int bufsize, maxsize; - volatile int dl; /* transfer size */ - volatile int rp; /* pointers to the ready area */ - volatile int rl; /* length of ready area */ - volatile int hp; - volatile u_int32_t total, prev_total; - int isadmachan, dir; /* dma channel */ - u_int32_t fmt, spd, bps; - unsigned int blksz, blkcnt; - int xrun; - u_int32_t flags; - bus_dmamap_t dmamap; - bus_dma_tag_t dmatag; - struct selinfo sel; - char name[SNDBUF_NAMELEN]; -}; - struct snd_dbuf * sndbuf_create(device_t dev, char *drv, char *desc) { @@ -587,77 +566,3 @@ sndbuf_setflags(struct snd_dbuf *b, u_int32_t flags, int on) b->flags |= flags; } -/************************************************************/ - -int -sndbuf_isadmasetup(struct snd_dbuf *b, struct resource *drq) -{ - /* should do isa_dma_acquire/isa_dma_release here */ - if (drq == NULL) { - b->isadmachan = -1; - } else { - sndbuf_setflags(b, SNDBUF_F_ISADMA, 1); - b->isadmachan = rman_get_start(drq); - } - return 0; -} - -int -sndbuf_isadmasetdir(struct snd_dbuf *b, int dir) -{ - KASSERT(b, ("sndbuf_isadmasetdir called with b == NULL")); - KASSERT(sndbuf_getflags(b) & SNDBUF_F_ISADMA, ("sndbuf_isadmasetdir called on non-ISA buffer")); - - b->dir = (dir == PCMDIR_PLAY)? ISADMA_WRITE : ISADMA_READ; - return 0; -} - -void -sndbuf_isadma(struct snd_dbuf *b, int go) -{ - KASSERT(b, ("sndbuf_isadma called with b == NULL")); - KASSERT(sndbuf_getflags(b) & SNDBUF_F_ISADMA, ("sndbuf_isadma called on non-ISA buffer")); - - switch (go) { - case PCMTRIG_START: - /* isa_dmainit(b->chan, size); */ - isa_dmastart(b->dir | ISADMA_RAW, b->buf, b->bufsize, b->isadmachan); - break; - - case PCMTRIG_STOP: - case PCMTRIG_ABORT: - isa_dmastop(b->isadmachan); - isa_dmadone(b->dir | ISADMA_RAW, b->buf, b->bufsize, b->isadmachan); - break; - } - - DEB(printf("buf 0x%p ISA DMA %s, channel %d\n", - b, - (go == PCMTRIG_START)? "started" : "stopped", - b->isadmachan)); -} - -int -sndbuf_isadmaptr(struct snd_dbuf *b) -{ - int i; - - KASSERT(b, ("sndbuf_isadmaptr called with b == NULL")); - KASSERT(sndbuf_getflags(b) & SNDBUF_F_ISADMA, ("sndbuf_isadmaptr called on non-ISA buffer")); - - if (!sndbuf_runsz(b)) - return 0; - i = isa_dmastatus(b->isadmachan); - KASSERT(i >= 0, ("isa_dmastatus returned %d", i)); - return b->bufsize - i; -} - -void -sndbuf_isadmabounce(struct snd_dbuf *b) -{ - KASSERT(b, ("sndbuf_isadmabounce called with b == NULL")); - KASSERT(sndbuf_getflags(b) & SNDBUF_F_ISADMA, ("sndbuf_isadmabounce called on non-ISA buffer")); - - /* tell isa_dma to bounce data in/out */ -} - |