aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/dev_dsp.txt
blob: 93a00aecc93212823b3215214bca1f92ccaba7a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# 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
openat$adsp1(fd const[AT_FDCWD], file ptr[in, string["/dev/adsp1"]], 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