aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/dev_dsp.txt
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-12-01 11:08:13 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-12-01 11:08:13 +0100
commitc35a341c32f11b4c0d0298a216878403aed59aca (patch)
tree1de814cced56fbf6f35885c83d4347297ac0af99 /sys/linux/dev_dsp.txt
parent3504484430f1d004d7eb10c5d04577c0b2d84cb3 (diff)
sys/linux: add /dev/dsp descriptions
Diffstat (limited to 'sys/linux/dev_dsp.txt')
-rw-r--r--sys/linux/dev_dsp.txt67
1 files changed, 67 insertions, 0 deletions
diff --git a/sys/linux/dev_dsp.txt b/sys/linux/dev_dsp.txt
new file mode 100644
index 000000000..20d487e62
--- /dev/null
+++ b/sys/linux/dev_dsp.txt
@@ -0,0 +1,67 @@
+# Copyright 2019 syzkaller project authors. All rights reserved.
+# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+include <uapi/asm/ioctl.h>
+include <uapi/linux/fcntl.h>
+include <uapi/linux/soundcard.h>
+
+resource fd_dsp[fd]
+
+openat$dsp(fd const[AT_FDCWD], file ptr[in, string["/dev/dsp"]], flags flags[open_flags], mode const[0]) fd_dsp
+openat$dsp1(fd const[AT_FDCWD], file ptr[in, string["/dev/dsp1"]], flags flags[open_flags], mode const[0]) fd_dsp
+
+write$dsp(fd fd_dsp, data ptr[in, array[int8]], len bytesize[data])
+read$dsp(fd fd_dsp, data ptr[out, array[int8]], len bytesize[data])
+mmap$dsp(addr vma, len len[addr], prot flags[mmap_prot], flags flags[mmap_flags], fd fd_dsp, offset const[0])
+
+ioctl$SNDCTL_DSP_RESET(fd fd_dsp, cmd const[SNDCTL_DSP_RESET], arg const[0])
+ioctl$SNDCTL_DSP_SYNC(fd fd_dsp, cmd const[SNDCTL_DSP_SYNC], arg const[0])
+ioctl$SNDCTL_DSP_SPEED(fd fd_dsp, cmd const[SNDCTL_DSP_SPEED], arg ptr[in, int32])
+ioctl$SNDCTL_DSP_STEREO(fd fd_dsp, cmd const[SNDCTL_DSP_STEREO], arg ptr[in, bool32])
+ioctl$SNDCTL_DSP_GETBLKSIZE(fd fd_dsp, cmd const[SNDCTL_DSP_GETBLKSIZE], arg ptr[out, int32])
+ioctl$SNDCTL_DSP_CHANNELS(fd fd_dsp, cmd const[SNDCTL_DSP_CHANNELS], arg ptr[in, int32])
+ioctl$SNDCTL_DSP_POST(fd fd_dsp, cmd const[SNDCTL_DSP_POST], arg const[0])
+ioctl$SNDCTL_DSP_SUBDIVIDE(fd fd_dsp, cmd const[SNDCTL_DSP_SUBDIVIDE], arg ptr[in, int32])
+ioctl$SNDCTL_DSP_SETFRAGMENT(fd fd_dsp, cmd const[SNDCTL_DSP_SETFRAGMENT], arg ptr[in, int32])
+ioctl$SNDCTL_DSP_GETFMTS(fd fd_dsp, cmd const[SNDCTL_DSP_GETFMTS], arg ptr[in, int32])
+ioctl$SNDCTL_DSP_SETFMT(fd fd_dsp, cmd const[SNDCTL_DSP_SETFMT], arg ptr[in, int32])
+ioctl$SNDCTL_DSP_GETOSPACE(fd fd_dsp, cmd const[SNDCTL_DSP_GETOSPACE], arg ptr[out, array[int8, AUFIO_BUF_INFO_SIZE]])
+ioctl$SNDCTL_DSP_GETISPACE(fd fd_dsp, cmd const[SNDCTL_DSP_GETISPACE], arg ptr[out, array[int8, AUFIO_BUF_INFO_SIZE]])
+ioctl$SNDCTL_DSP_NONBLOCK(fd fd_dsp, cmd const[SNDCTL_DSP_NONBLOCK], arg const[0])
+ioctl$SNDCTL_DSP_GETCAPS(fd fd_dsp, cmd const[SNDCTL_DSP_GETCAPS], arg ptr[out, int32])
+ioctl$SNDCTL_DSP_GETTRIGGER(fd fd_dsp, cmd const[SNDCTL_DSP_GETTRIGGER], arg ptr[out, int32])
+ioctl$SNDCTL_DSP_SETTRIGGER(fd fd_dsp, cmd const[SNDCTL_DSP_SETTRIGGER], arg ptr[in, int32])
+ioctl$SNDCTL_DSP_GETIPTR(fd fd_dsp, cmd const[SNDCTL_DSP_GETIPTR], arg ptr[out, array[int8, COUNT_INFO_SIZE]])
+ioctl$SNDCTL_DSP_GETOPTR(fd fd_dsp, cmd const[SNDCTL_DSP_GETOPTR], arg ptr[out, array[int8, COUNT_INFO_SIZE]])
+ioctl$SNDCTL_DSP_SETDUPLEX(fd fd_dsp, cmd const[SNDCTL_DSP_SETDUPLEX], arg const[0])
+ioctl$SNDCTL_DSP_GETODELAY(fd fd_dsp, cmd const[SNDCTL_DSP_GETODELAY], arg ptr[out, int32])
+ioctl$SOUND_PCM_READ_RATE(fd fd_dsp, cmd const[SOUND_PCM_READ_RATE], arg ptr[out, int32])
+ioctl$SOUND_PCM_READ_CHANNELS(fd fd_dsp, cmd const[SOUND_PCM_READ_CHANNELS], arg ptr[out, int32])
+ioctl$SOUND_PCM_READ_BITS(fd fd_dsp, cmd const[SOUND_PCM_READ_BITS], arg ptr[out, int32])
+ioctl$SOUND_OLD_MIXER_INFO(fd fd_dsp, cmd const[SOUND_OLD_MIXER_INFO], arg ptr[out, array[int8, OLD_MIXED_INFO_SIZE]])
+ioctl$SOUND_MIXER_INFO(fd fd_dsp, cmd const[SOUND_MIXER_INFO], arg ptr[out, array[int8, MIXER_INFO_SIZE]])
+ioctl$SOUND_MIXER_WRITE_RECSRC(fd fd_dsp, cmd const[SOUND_MIXER_WRITE_RECSRC], arg ptr[in, int32])
+ioctl$SOUND_MIXER_READ_DEVMASK(fd fd_dsp, cmd const[SOUND_MIXER_READ_DEVMASK], arg ptr[out, int32])
+ioctl$SOUND_MIXER_READ_STEREODEVS(fd fd_dsp, cmd const[SOUND_MIXER_READ_STEREODEVS], arg ptr[out, int32])
+ioctl$SOUND_MIXER_READ_RECMASK(fd fd_dsp, cmd const[SOUND_MIXER_READ_RECMASK], arg ptr[out, int32])
+ioctl$SOUND_MIXER_READ_CAPS(fd fd_dsp, cmd const[SOUND_MIXER_READ_CAPS], arg ptr[out, int32])
+ioctl$SOUND_MIXER_READ_RECSRC(fd fd_dsp, cmd const[SOUND_MIXER_READ_RECSRC], arg ptr[out, int32])
+ioctl$SOUND_MIXER_WRITE_VOLUME(fd fd_dsp, cmd int32[SOUND_MIXER_WRITE_VOLUME:SOUND_MIXER_WRITE_ONOFF_MAX], arg ptr[in, int32[0:100]])
+ioctl$SOUND_MIXER_READ_VOLUME(fd fd_dsp, cmd int32[SOUND_MIXER_READ_VOLUME:SOUND_MIXER_READ_ONOFF_MAX], arg ptr[out, int32])
+
+# NEED: we could provide a special support for this to save typing and duplication here.
+# It could be eigher:
+# csizeof[struct audio_buf_info]
+# Note: we probalby want to use sizeof as replacement for current bytesize.
+# Note: the argument is not necessary a struct, so we need to pronounce struct as well.
+# Or more generic form would be something along the following lines:
+# ceval[`sizeof(struct audio_buf_info)`]
+# as replacement for any one-off defines.
+
+define AUFIO_BUF_INFO_SIZE sizeof(struct audio_buf_info)
+define COUNT_INFO_SIZE sizeof(struct count_info)
+define MIXER_INFO_SIZE sizeof(struct mixer_info)
+define OLD_MIXED_INFO_SIZE sizeof(struct _old_mixer_info)
+define SOUND_MIXER_WRITE_ONOFF_MAX MIXER_WRITE(SOUND_ONOFF_MAX)
+define SOUND_MIXER_READ_ONOFF_MAX MIXER_READ(SOUND_ONOFF_MAX)
+_ = __NR_mmap2