diff options
Diffstat (limited to 'sys/dev/sound/pcm/channel.c')
| -rw-r--r-- | sys/dev/sound/pcm/channel.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 011dc1427c2e..7c3f0e3dc9f0 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -581,14 +581,30 @@ chn_read(struct pcm_channel *c, struct uio *buf) } void -chn_intr(struct pcm_channel *c) +chn_intr_locked(struct pcm_channel *c) { - CHN_LOCK(c); + + CHN_LOCKASSERT(c); + c->interrupts++; + if (c->direction == PCMDIR_PLAY) chn_wrintr(c); else chn_rdintr(c); +} + +void +chn_intr(struct pcm_channel *c) +{ + + if (CHN_LOCKOWNED(c)) { + chn_intr_locked(c); + return; + } + + CHN_LOCK(c); + chn_intr_locked(c); CHN_UNLOCK(c); } |
