summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCameron Grant <cg@FreeBSD.org>1999-09-08 17:34:54 +0000
committerCameron Grant <cg@FreeBSD.org>1999-09-08 17:34:54 +0000
commita78723c1c1ba56be22ac58cc48e0aa2742f91350 (patch)
tree30a42a67b6776921a55da19038f6d304cc57f262
parent6523748af102264f4d5380e5c639353a3c362931 (diff)
Notes
-rw-r--r--sys/dev/pcm/channel.c3
-rw-r--r--sys/dev/sound/pcm/channel.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pcm/channel.c b/sys/dev/pcm/channel.c
index 4c91e44c33ca..1bc8056c1842 100644
--- a/sys/dev/pcm/channel.c
+++ b/sys/dev/pcm/channel.c
@@ -268,7 +268,7 @@ chn_write(pcm_channel *c, struct uio *buf)
return EBUSY;
}
c->flags |= CHN_F_WRITING;
- while (buf->uio_resid >= DMA_ALIGN_THRESHOLD) {
+ while (buf->uio_resid > 0) {
s = spltty();
chn_dmaupdate(c);
splx(s);
@@ -284,6 +284,7 @@ chn_write(pcm_channel *c, struct uio *buf)
/* ensure we always have a whole number of samples */
l = min(b->fl, b->bufsize - b->fp) & DMA_ALIGN_MASK;
w = c->feeder->feed(c->feeder, b->buf + b->fp, l, buf);
+ if (w == 0) panic("no feed");
s = spltty();
b->rl += w;
b->fl -= w;
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 4c91e44c33ca..1bc8056c1842 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -268,7 +268,7 @@ chn_write(pcm_channel *c, struct uio *buf)
return EBUSY;
}
c->flags |= CHN_F_WRITING;
- while (buf->uio_resid >= DMA_ALIGN_THRESHOLD) {
+ while (buf->uio_resid > 0) {
s = spltty();
chn_dmaupdate(c);
splx(s);
@@ -284,6 +284,7 @@ chn_write(pcm_channel *c, struct uio *buf)
/* ensure we always have a whole number of samples */
l = min(b->fl, b->bufsize - b->fp) & DMA_ALIGN_MASK;
w = c->feeder->feed(c->feeder, b->buf + b->fp, l, buf);
+ if (w == 0) panic("no feed");
s = spltty();
b->rl += w;
b->fl -= w;