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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
# Copyright 2020 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>
include <sound/core/seq/oss/seq_oss_device.h>
include <sound/asoundef.h>
include <uapi/sound/sfnt_info.h>
include <sound/core/seq/oss/seq_oss_event.h>
resource fd_seq[fd]
openat$sequencer(fd const[AT_FDCWD], file ptr[in, string["/dev/sequencer"]], flags flags[open_flags], mode const[0]) fd_seq
openat$sequencer2(fd const[AT_FDCWD], file ptr[in, string["/dev/sequencer2"]], flags flags[open_flags], mode const[0]) fd_seq
read$sequencer(fd fd_seq, buffer ptr[out, array[int8]], count bytesize[buffer])
write$sequencer(fd fd_seq, buffer ptr[in, array[evrec_write]], count bytesize[buffer])
define MIN_OSS_TEMPO 8
define MAX_OSS_TEMPO 360
define MIN_OSS_TIMEBASE 1
define MAX_OSS_TIMEBASE 1000
ioctl$SNDCTL_TMR_TIMEBASE(fd fd_seq, cmd const[SNDCTL_TMR_TIMEBASE], carg ptr[in, int32[MIN_OSS_TIMEBASE:MAX_OSS_TIMEBASE]])
ioctl$SNDCTL_TMR_TEMPO(fd fd_seq, cmd const[SNDCTL_TMR_TEMPO], carg ptr[in, int32[MIN_OSS_TEMPO:MAX_OSS_TEMPO]])
ioctl$SNDCTL_TMR_START(fd fd_seq, cmd const[SNDCTL_TMR_START])
ioctl$SNDCTL_TMR_STOP(fd fd_seq, cmd const[SNDCTL_TMR_STOP])
ioctl$SNDCTL_TMR_CONTINUE(fd fd_seq, cmd const[SNDCTL_TMR_CONTINUE])
ioctl$SNDCTL_TMR_METRONOME(fd fd_seq, cmd const[SNDCTL_TMR_METRONOME])
ioctl$SNDCTL_TMR_SOURCE(fd fd_seq, cmd const[SNDCTL_TMR_SOURCE])
ioctl$SNDCTL_TMR_SELECT(fd fd_seq, cmd const[SNDCTL_TMR_SELECT])
ioctl$SNDCTL_SEQ_CTRLRATE(fd fd_seq, cmd const[SNDCTL_SEQ_CTRLRATE], carg ptr[inout, int32])
ioctl$SNDCTL_SEQ_PANIC(fd fd_seq, cmd const[SNDCTL_SEQ_PANIC])
ioctl$SNDCTL_SEQ_SYNC(fd fd_seq, cmd const[SNDCTL_SEQ_SYNC])
ioctl$SNDCTL_SEQ_RESET(fd fd_seq, cmd const[SNDCTL_SEQ_RESET])
ioctl$SNDCTL_SEQ_TESTMIDI(fd fd_seq, cmd const[SNDCTL_SEQ_TESTMIDI], carg ptr[in, int32])
ioctl$SNDCTL_SEQ_GETINCOUNT(fd fd_seq, cmd const[SNDCTL_SEQ_GETINCOUNT], carg ptr[out, int32])
ioctl$SNDCTL_SEQ_GETOUTCOUNT(fd fd_seq, cmd const[SNDCTL_SEQ_GETOUTCOUNT], carg ptr[out, int32])
ioctl$SNDCTL_SEQ_GETTIME(fd fd_seq, cmd const[SNDCTL_SEQ_GETTIME], carg ptr[out, int32])
ioctl$SNDCTL_SEQ_RESETSAMPLES(fd fd_seq, cmd const[SNDCTL_SEQ_RESETSAMPLES], carg ptr[in, int32])
ioctl$SNDCTL_SEQ_NRSYNTHS(fd fd_seq, cmd const[SNDCTL_SEQ_NRSYNTHS], carg ptr[out, int32])
ioctl$SNDCTL_SEQ_NRMIDIS(fd fd_seq, cmd const[SNDCTL_SEQ_NRMIDIS], carg ptr[out, int32])
ioctl$SNDCTL_SYNTH_MEMAVL(fd fd_seq, cmd const[SNDCTL_SYNTH_MEMAVL], carg ptr[inout, int32])
ioctl$SNDCTL_FM_4OP_ENABLE(fd fd_seq, cmd const[SNDCTL_FM_4OP_ENABLE], carg ptr[in, int32])
ioctl$SNDCTL_SYNTH_INFO(fd fd_seq, cmd const[SNDCTL_SYNTH_INFO], carg ptr[inout, synth_info])
ioctl$SNDCTL_SYNTH_ID(fd fd_seq, cmd const[SNDCTL_SYNTH_ID], carg ptr[inout, synth_info])
ioctl$SNDCTL_SEQ_OUTOFBAND(fd fd_seq, cmd const[SNDCTL_SEQ_OUTOFBAND], carg ptr[in, evrec])
ioctl$SNDCTL_MIDI_INFO(fd fd_seq, cmd const[SNDCTL_MIDI_INFO], carg ptr[inout, midi_info])
ioctl$SNDCTL_SEQ_THRESHOLD(fd fd_seq, cmd const[SNDCTL_SEQ_THRESHOLD], carg ptr[in, int32])
ioctl$SNDCTL_MIDI_PRETIME(fd fd_seq, cmd const[SNDCTL_MIDI_PRETIME], carg ptr[inout, int32])
ioctl$SNDCTL_FM_LOAD_INSTR(fd fd_seq, cmd const[SNDCTL_FM_LOAD_INSTR])
synth_info {
name array[int8, 30]
device int32
synth_type flags[synth_type_flags, int32]
synth_subtype flags[synth_subtype_flags, int32]
perc_mode int32
nr_voices int32
nr_drums int32
instr_bank_size int32
capabilities flags[capabilities_flags, int32]
dummies array[int32, 19]
}
midi_info {
name array[int8, 30]
device int32
capabilities int32
dev_type int32
dummies array[int32, 18]
}
evrec_write [
s evrec_short
n evrec_note
l evrec_long
v evrec_voice
t evrec_timer
e evrec_extended
x evrec_sysex
echo int32
raw evrec_raw
generic evrec_generic
] [varlen]
evrec [
s evrec_short
n evrec_note
l evrec_long
v evrec_voice
t evrec_timer
e evrec_extended
x evrec_sysex
echo int32
raw evrec_raw
generic evrec_generic
]
evrec_short {
code const[SEQ_MIDIPUTC, int8]
parm1 evrec_short_parm1
dev int8[0:SNDRV_SEQ_OSS_MAX_MIDI_DEVS]
parm2 int8
}
evrec_short_parm1 [
SEQ_MIDIPUTC int8[MIDI_CMD_NOTE_OFF:MIDI_CMD_COMMON_RESET]
generic int8
]
evrec_note {
code flags[evrec_note_code, int8]
chn int8
note evrec_note_note
vel int8
}
evrec_note_note [
SEQ_NOTEON midi_note
generic int8
]
midi_note [
note int8[0:127]
special const[255, int8]
]
evrec_timer {
code flags[evrec_timer_code, int8]
cmd flags[evrec_timer_cmd, int8]
dummy1 int8
dummy2 int8
time evrec_timer_time
}
evrec_timer_time [
TMR_WAIT_ABS const[0, int32]
generic int32
]
evrec_extended {
code const[SEQ_EXTENDED, int8]
cmd flags[evrec_extended_cmd, int8]
dev int8[0:15]
chn int8
p1 evrec_extended_p1
p2 int8
p3 int8
p4 int8
}
evrec_extended_p1 [
SEQ_CONTROLLER flags[evrec_extended_p1_flags, int8]
SEQ_NOTEON midi_note
generic int8
]
evrec_long {
code const[EV_CHN_COMMON, int8]
dev int8[0:15]
cmd flags[evrec_long_cmd, int8]
chn int8[0:31]
p1 int8
p2 int8
val int16
}
evrec_voice {
code const[EV_CHN_VOICE, int8]
dev int8[0:15]
cmd flags[evrec_voice_cmd, int8]
chn int8[0:31]
note evrec_voice_note
parm int8
dummy int16
}
evrec_voice_note [
MIDI_NOTEON midi_note
generic int8
]
evrec_sysex {
code const[EV_SYSEX, int8]
dev int8[0:15]
buf array[int8, 6]
}
evrec_raw {
code flags[evrec_raw_code, int8]
dev int8[0:15]
arr array[int8, 6]
}
evrec_generic {
code flags[evrec_generic_flags, int8]
}
synth_type_flags = SYNTH_TYPE_FM, SYNTH_TYPE_SAMPLE, SYNTH_TYPE_MIDI
synth_subtype_flags = FM_TYPE_ADLIB, FM_TYPE_OPL3, MIDI_TYPE_MPU401
capabilities_flags = SYNTH_CAP_PERCMODE, SYNTH_CAP_OPL3, SYNTH_CAP_INPUT
evrec_extended_cmd = SEQ_NOTEOFF, SEQ_NOTEON, SEQ_PGMCHANGE, SEQ_AFTERTOUCH, SEQ_BALANCE, SEQ_CONTROLLER, SEQ_VOLMODE
evrec_extended_p1_flags = CTRL_PITCH_BENDER, CTRL_PITCH_BENDER_RANGE
evrec_voice_cmd = MIDI_NOTEON, MIDI_NOTEOFF, MIDI_KEY_PRESSURE
evrec_timer_code = EV_TIMING, SEQ_SYNCTIMER
evrec_timer_cmd = TMR_ECHO, TMR_STOP, TMR_CONTINUE, TMR_TEMPO, TMR_WAIT_REL, TMR_WAIT_ABS, TMR_START
evrec_long_cmd = MIDI_PGM_CHANGE, MIDI_CTL_CHANGE, MIDI_PITCH_BEND, MIDI_CHN_PRESSURE
evrec_note_code = SEQ_NOTEOFF, SEQ_NOTEON, SEQ_PGMCHANGE
evrec_generic_flags = EV_SEQ_LOCAL, SEQ_ECHO, SEQ_WAIT
evrec_raw_code = SEQ_VOLMODE, SEQ_PRIVATE
|