diff options
author | cognet <cognet@FreeBSD.org> | 2003-02-20 17:31:12 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2003-02-20 17:31:12 +0000 |
commit | 25a2aa22f19c732e8551e7ad32190bf14add4562 (patch) | |
tree | 754946b164b23a1f5dc38394662ee5a04598b6a7 /sys/dev/sound/pcm/buffer.c | |
parent | 22cf3256d9e0c5f63427ab60eb09a6f768660c18 (diff) | |
download | FreeBSD-src-25a2aa22f19c732e8551e7ad32190bf14add4562.zip FreeBSD-src-25a2aa22f19c732e8551e7ad32190bf14add4562.tar.gz |
Implement a "sndbuf_getbufaddr" function and use it instead of vtophys().
Reviewed by: orion
Diffstat (limited to 'sys/dev/sound/pcm/buffer.c')
-rw-r--r-- | sys/dev/sound/pcm/buffer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c index a096b40..8ae35a3 100644 --- a/sys/dev/sound/pcm/buffer.c +++ b/sys/dev/sound/pcm/buffer.c @@ -48,6 +48,12 @@ sndbuf_destroy(struct snd_dbuf *b) free(b, M_DEVBUF); } +bus_addr_t +sndbuf_getbufaddr(struct snd_dbuf *buf) +{ + return (buf->buf_addr); +} + static void sndbuf_setmap(void *arg, bus_dma_segment_t *segs, int nseg, int error) { @@ -58,12 +64,14 @@ sndbuf_setmap(void *arg, bus_dma_segment_t *segs, int nseg, int error) (unsigned long)segs->ds_len); printf("%p -> %lx\n", b->buf, (unsigned long)vtophys(b->buf)); } + b->buf_addr = segs->ds_addr; } /* * Allocate memory for DMA buffer. If the device does not use DMA transfers, * the driver can call malloc(9) and sndbuf_setup() itself. */ + int sndbuf_alloc(struct snd_dbuf *b, bus_dma_tag_t dmatag, unsigned int size) { |