Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115560495
D49978.id154158.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D49978.id154158.diff
View Options
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -67,6 +67,12 @@
#define DSP_REGISTERED(x) (PCM_REGISTERED(x) && (x)->dsp_dev != NULL)
+#define DSP_F_VALID(x) ((x) & (FREAD | FWRITE))
+#define DSP_F_DUPLEX(x) (((x) & (FREAD | FWRITE)) == (FREAD | FWRITE))
+#define DSP_F_SIMPLEX(x) (!DSP_F_DUPLEX(x))
+#define DSP_F_READ(x) ((x) & FREAD)
+#define DSP_F_WRITE(x) ((x) & FWRITE)
+
#define OLDPCM_IOCTL
static d_open_t dsp_open;
@@ -144,18 +150,18 @@
static void
dsp_lock_chans(struct dsp_cdevpriv *priv, uint32_t prio)
{
- if (priv->rdch != NULL && (prio & SD_F_PRIO_RD))
+ if (priv->rdch != NULL && DSP_F_READ(prio))
CHN_LOCK(priv->rdch);
- if (priv->wrch != NULL && (prio & SD_F_PRIO_WR))
+ if (priv->wrch != NULL && DSP_F_WRITE(prio))
CHN_LOCK(priv->wrch);
}
static void
dsp_unlock_chans(struct dsp_cdevpriv *priv, uint32_t prio)
{
- if (priv->rdch != NULL && (prio & SD_F_PRIO_RD))
+ if (priv->rdch != NULL && DSP_F_READ(prio))
CHN_UNLOCK(priv->rdch);
- if (priv->wrch != NULL && (prio & SD_F_PRIO_WR))
+ if (priv->wrch != NULL && DSP_F_WRITE(prio))
CHN_UNLOCK(priv->wrch);
}
@@ -234,12 +240,6 @@
return (0);
}
-#define DSP_F_VALID(x) ((x) & (FREAD | FWRITE))
-#define DSP_F_DUPLEX(x) (((x) & (FREAD | FWRITE)) == (FREAD | FWRITE))
-#define DSP_F_SIMPLEX(x) (!DSP_F_DUPLEX(x))
-#define DSP_F_READ(x) ((x) & FREAD)
-#define DSP_F_WRITE(x) ((x) & FWRITE)
-
static void
dsp_close(void *data)
{
@@ -475,12 +475,12 @@
switch (buf->uio_rw) {
case UIO_READ:
- prio = SD_F_PRIO_RD;
+ prio = FREAD;
ch = &priv->rdch;
chn_io = chn_read;
break;
case UIO_WRITE:
- prio = SD_F_PRIO_WR;
+ prio = FWRITE;
ch = &priv->wrch;
chn_io = chn_write;
break;
@@ -1793,7 +1793,7 @@
ret = 0;
- dsp_lock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR);
+ dsp_lock_chans(priv, FREAD | FWRITE);
wrch = priv->wrch;
rdch = priv->rdch;
@@ -1809,7 +1809,7 @@
ret |= chn_poll(rdch, e, td);
}
- dsp_unlock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR);
+ dsp_unlock_chans(priv, FREAD | FWRITE);
PCM_GIANT_LEAVE(d);
@@ -1871,7 +1871,7 @@
PCM_GIANT_ENTER(d);
- dsp_lock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR);
+ dsp_lock_chans(priv, FREAD | FWRITE);
wrch = priv->wrch;
rdch = priv->rdch;
@@ -1880,7 +1880,7 @@
(*offset + size) > sndbuf_getallocsize(c->bufsoft) ||
(wrch != NULL && (wrch->flags & CHN_F_MMAP_INVALID)) ||
(rdch != NULL && (rdch->flags & CHN_F_MMAP_INVALID))) {
- dsp_unlock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR);
+ dsp_unlock_chans(priv, FREAD | FWRITE);
PCM_GIANT_EXIT(d);
return (EINVAL);
}
@@ -1891,7 +1891,7 @@
rdch->flags |= CHN_F_MMAP;
*offset = (uintptr_t)sndbuf_getbufofs(c->bufsoft, *offset);
- dsp_unlock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR);
+ dsp_unlock_chans(priv, FREAD | FWRITE);
*object = vm_pager_allocate(OBJT_DEVICE, i_dev,
size, nprot, *offset, curthread->td_ucred);
diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h
--- a/sys/dev/sound/pcm/sound.h
+++ b/sys/dev/sound/pcm/sound.h
@@ -121,9 +121,6 @@
#define SD_F_EQ_MASK (SD_F_EQ | SD_F_EQ_ENABLED | \
SD_F_EQ_BYPASSED | SD_F_EQ_PC)
-#define SD_F_PRIO_RD 0x10000000
-#define SD_F_PRIO_WR 0x20000000
-
#define SD_F_BITS "\020" \
"\001SIMPLEX" \
/* "\002 */ \
@@ -138,9 +135,7 @@
"\013EQ_BYPASSED" \
"\014EQ_PC" \
"\015PVCHANS" \
- "\016RVCHANS" \
- "\035PRIO_RD" \
- "\036PRIO_WR"
+ "\016RVCHANS"
#define PCM_ALIVE(x) ((x) != NULL && (x)->lock != NULL)
#define PCM_REGISTERED(x) (PCM_ALIVE(x) && ((x)->flags & SD_F_REGISTERED))
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 26, 8:26 AM (11 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17794705
Default Alt Text
D49978.id154158.diff (3 KB)
Attached To
Mode
D49978: sound: Retire SD_F_PRIO_*
Attached
Detach File
Event Timeline
Log In to Comment