Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150444341
D47559.id146396.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D47559.id146396.diff
View Options
diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h
--- a/sys/dev/sound/pcm/channel.h
+++ b/sys/dev/sound/pcm/channel.h
@@ -354,7 +354,7 @@
#define CHN_F_RUNNING 0x00000004 /* dma is running */
#define CHN_F_TRIGGERED 0x00000008
#define CHN_F_NOTRIGGER 0x00000010
-#define CHN_F_SLEEPING 0x00000020
+#define CHN_F_EXCLUSIVE 0x00000020 /* exclusive access */
#define CHN_F_NBIO 0x00000040 /* do non-blocking i/o */
#define CHN_F_MMAP 0x00000080 /* has been mmap()ed */
@@ -374,7 +374,6 @@
#define CHN_F_VIRTUAL 0x10000000 /* not backed by hardware */
#define CHN_F_BITPERFECT 0x20000000 /* un-cooked, Heh.. */
#define CHN_F_PASSTHROUGH 0x40000000 /* passthrough re-config */
-#define CHN_F_EXCLUSIVE 0x80000000 /* exclusive access */
#define CHN_F_BITS "\020" \
"\001CLOSING" \
@@ -382,7 +381,7 @@
"\003RUNNING" \
"\004TRIGGERED" \
"\005NOTRIGGER" \
- "\006SLEEPING" \
+ "\006EXCLUSIVE" \
"\007NBIO" \
"\010MMAP" \
"\011BUSY" \
@@ -395,8 +394,7 @@
"\020VCHAN_ADAPTIVE" \
"\035VIRTUAL" \
"\036BITPERFECT" \
- "\037PASSTHROUGH" \
- "\040EXCLUSIVE"
+ "\037PASSTHROUGH"
#define CHN_F_RESET (CHN_F_BUSY | CHN_F_DEAD | \
CHN_F_VIRTUAL | CHN_F_HAS_VCHAN | \
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -309,14 +309,7 @@
if (CHN_EMPTY(c, children.busy)) {
if (SEL_WAITING(sndbuf_getsel(bs)) && chn_polltrigger(c))
selwakeuppri(sndbuf_getsel(bs), PRIBIO);
- if (c->flags & CHN_F_SLEEPING) {
- /*
- * Ok, I can just panic it right here since it is
- * quite obvious that we never allow multiple waiters
- * from userland. I'm too generous...
- */
- CHN_BROADCAST(&c->intr_cv);
- }
+ CHN_BROADCAST(&c->intr_cv);
} else {
CHN_FOREACH(ch, c, children.busy) {
CHN_LOCK(ch);
@@ -332,15 +325,11 @@
int ret;
CHN_LOCKASSERT(c);
- KASSERT((c->flags & CHN_F_SLEEPING) == 0,
- ("%s(): entered with CHN_F_SLEEPING", __func__));
if (c->flags & CHN_F_DEAD)
return (EINVAL);
- c->flags |= CHN_F_SLEEPING;
ret = cv_timedwait_sig(&c->intr_cv, c->lock, timeout);
- c->flags &= ~CHN_F_SLEEPING;
return ((c->flags & CHN_F_DEAD) ? EINVAL : ret);
}
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -220,8 +220,8 @@
/* Make sure all channels are stopped. */
CHN_FOREACH(ch, d, channels.pcm) {
CHN_LOCK(ch);
- if ((ch->flags & CHN_F_SLEEPING) == 0 &&
- CHN_STOPPED(ch) && ch->inprog == 0) {
+ if (ch->intr_cv.cv_waiters == 0 && CHN_STOPPED(ch) &&
+ ch->inprog == 0) {
CHN_UNLOCK(ch);
continue;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 2, 6:30 AM (14 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30711926
Default Alt Text
D47559.id146396.diff (2 KB)
Attached To
Mode
D47559: sound: Remove CHN_F_SLEEPING
Attached
Detach File
Event Timeline
Log In to Comment