fix a bug with cat >/dev/{dsp,dspW,audio} hanging

This commit is contained in:
Cameron Grant 1999-09-08 17:34:54 +00:00
parent 6523748af1
commit a78723c1c1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51095
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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;