Skip to content

Commit 6b6b5f2

Browse files
fellairtarasmadan
authored andcommitted
sys/linux: update descriptions in dev_snd_timer.txt
A few things done here: - Add new userspace-driven ioctls (and necessary structs as well): SNDRV_TIMER_IOCTL_CREATE SNDRV_TIMER_IOCTL_TRIGGER - Change a few object pointers' directions to better reflect their intent (mostly inout). - Split old SNDRV_TIMER_IOCTL_TREAD into two: SNDRV_TIMER_IOCTL_TREAD_OLD and SNDRV_TIMER_IOCTL_TREAD64 the way it is done in the kernel. - Remove TODO descriptions concerning SNDCTL_TMR_START etc. as they are described elsewhere, and as far as I can tell, are not necessary here.
1 parent fd5e6e6 commit 6b6b5f2

File tree

3 files changed

+32
-17
lines changed

3 files changed

+32
-17
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,4 @@ Ji Hyeon Jeong
139139
Rivos Inc.
140140
Alexandre Ghiti
141141
Jeongjun Park
142+
Nikita Zhandarovich

sys/linux/dev_snd_timer.txt

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,29 @@ resource fd_sndtimer[fd]
1212
openat$sndtimer(fd const[AT_FDCWD], file ptr[in, string["/dev/snd/timer"]], flags flags[open_flags]) fd_sndtimer
1313

1414
ioctl$SNDRV_TIMER_IOCTL_PVERSION(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_PVERSION], arg ptr[out, int32])
15-
ioctl$SNDRV_TIMER_IOCTL_NEXT_DEVICE(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_NEXT_DEVICE], arg ptr[in, snd_timer_id])
16-
ioctl$SNDRV_TIMER_IOCTL_TREAD(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_TREAD], arg ptr[in, int32[0:1]])
17-
ioctl$SNDRV_TIMER_IOCTL_GINFO(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_GINFO], arg ptr[in, snd_timer_ginfo])
15+
ioctl$SNDRV_TIMER_IOCTL_NEXT_DEVICE(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_NEXT_DEVICE], arg ptr[inout, snd_timer_id])
16+
ioctl$SNDRV_TIMER_IOCTL_TREAD_OLD(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_TREAD_OLD], arg ptr[in, int32[0:1]])
17+
ioctl$SNDRV_TIMER_IOCTL_GINFO(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_GINFO], arg ptr[inout, snd_timer_ginfo])
1818
ioctl$SNDRV_TIMER_IOCTL_GPARAMS(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_GPARAMS], arg ptr[in, snd_timer_gparams])
19-
ioctl$SNDRV_TIMER_IOCTL_GSTATUS(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_GSTATUS], arg ptr[in, snd_timer_gstatus])
19+
ioctl$SNDRV_TIMER_IOCTL_GSTATUS(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_GSTATUS], arg ptr[inout, snd_timer_gstatus])
2020
ioctl$SNDRV_TIMER_IOCTL_SELECT(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_SELECT], arg ptr[in, snd_timer_select])
21-
ioctl$SNDRV_TIMER_IOCTL_INFO(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_INFO], arg buffer[out])
21+
ioctl$SNDRV_TIMER_IOCTL_INFO(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_INFO], arg ptr[out, snd_timer_info])
2222
ioctl$SNDRV_TIMER_IOCTL_PARAMS(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_PARAMS], arg ptr[in, snd_timer_params])
2323
ioctl$SNDRV_TIMER_IOCTL_STATUS32(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_STATUS32], arg ptr[out, snd_timer_status[int32]])
2424
ioctl$SNDRV_TIMER_IOCTL_STATUS64(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_STATUS64], arg ptr[out, snd_timer_status[int64]])
2525
ioctl$SNDRV_TIMER_IOCTL_START(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_START])
2626
ioctl$SNDRV_TIMER_IOCTL_STOP(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_STOP])
2727
ioctl$SNDRV_TIMER_IOCTL_CONTINUE(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_CONTINUE])
2828
ioctl$SNDRV_TIMER_IOCTL_PAUSE(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_PAUSE])
29+
ioctl$SNDRV_TIMER_IOCTL_TREAD64(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_TREAD64], arg ptr[in, int32[0:1]])
30+
31+
# ioctls for userspace-driven timers
32+
ioctl$SNDRV_TIMER_IOCTL_CREATE(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_CREATE], arg ptr[inout, snd_timer_uinfo])
33+
ioctl$SNDRV_TIMER_IOCTL_TRIGGER(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_TRIGGER])
2934

3035
snd_timer_flags = SNDRV_TIMER_PSFLG_AUTO, SNDRV_TIMER_PSFLG_EXCLUSIVE, SNDRV_TIMER_PSFLG_EARLY_EVENT
3136
snd_timer_filter = SNDRV_TIMER_EVENT_RESOLUTION, SNDRV_TIMER_EVENT_TICK, SNDRV_TIMER_EVENT_START, SNDRV_TIMER_EVENT_STOP, SNDRV_TIMER_EVENT_CONTINUE, SNDRV_TIMER_EVENT_PAUSE, SNDRV_TIMER_EVENT_EARLY, SNDRV_TIMER_EVENT_SUSPEND, SNDRV_TIMER_EVENT_RESUME, SNDRV_TIMER_EVENT_MSTART, SNDRV_TIMER_EVENT_MSTOP, SNDRV_TIMER_EVENT_MCONTINUE, SNDRV_TIMER_EVENT_MPAUSE, SNDRV_TIMER_EVENT_MSUSPEND, SNDRV_TIMER_EVENT_MRESUME
3237

33-
# TODO: Add descriptions
34-
_ = SNDCTL_TMR_START, SNDCTL_TMR_STOP, SNDCTL_TMR_TIMEBASE, SNDCTL_TMR_CONTINUE, SNDCTL_TMR_TEMPO, SNDCTL_TMR_SOURCE, SNDCTL_TMR_METRONOME, SNDCTL_TMR_SELECT
35-
3638
snd_timer_id_str = "id0", "id1"
3739
snd_timer_name = "timer0", "timer1"
3840

@@ -89,6 +91,23 @@ type snd_timer_status[TYPE] {
8991
pad2 array[const[0, int8], 64]
9092
}
9193

94+
snd_timer_info {
95+
flags int32
96+
card int32
97+
id string[snd_timer_id_str, 64]
98+
name string[snd_timer_name, 80]
99+
pad1 const[0, intptr]
100+
res intptr
101+
pad2 array[const[0, int8], 32]
102+
}
103+
104+
snd_timer_uinfo {
105+
res intptr
106+
tfd fd
107+
id string[snd_timer_id_str, 64]
108+
pad1 array[const[0, int8], 16]
109+
}
110+
92111
define SND_TIMER_STATUS32_SIZE 88
93112
define SND_TIMER_STATUS64_SIZE 96
94113
define SNDRV_TIMER_IOCTL_STATUS32 _IOR('T', 0x14, char[SND_TIMER_STATUS32_SIZE])

sys/linux/dev_snd_timer.txt.const

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
# Code generated by syz-sysgen. DO NOT EDIT.
22
arches = 386, amd64, arm, arm64, mips64le, ppc64le, riscv64, s390x
33
AT_FDCWD = 18446744073709551516
4-
SNDCTL_TMR_CONTINUE = 21508, mips64le:ppc64le:536892420
5-
SNDCTL_TMR_METRONOME = 1074025479, mips64le:ppc64le:2147767303
6-
SNDCTL_TMR_SELECT = 1074025480, mips64le:ppc64le:2147767304
7-
SNDCTL_TMR_SOURCE = 3221509126
8-
SNDCTL_TMR_START = 21506, mips64le:ppc64le:536892418
9-
SNDCTL_TMR_STOP = 21507, mips64le:ppc64le:536892419
10-
SNDCTL_TMR_TEMPO = 3221509125
11-
SNDCTL_TMR_TIMEBASE = 3221509121
124
SNDRV_TIMER_EVENT_CONTINUE = 4
135
SNDRV_TIMER_EVENT_EARLY = 6
146
SNDRV_TIMER_EVENT_MCONTINUE = 14
@@ -25,6 +17,7 @@ SNDRV_TIMER_EVENT_STOP = 3
2517
SNDRV_TIMER_EVENT_SUSPEND = 7
2618
SNDRV_TIMER_EVENT_TICK = 1
2719
SNDRV_TIMER_IOCTL_CONTINUE = 21666, mips64le:ppc64le:536892578
20+
SNDRV_TIMER_IOCTL_CREATE = 3223344293
2821
SNDRV_TIMER_IOCTL_GINFO = 3237499907, 386:arm:3235927043
2922
SNDRV_TIMER_IOCTL_GPARAMS = 1078481924, 386:arm:1077695492, mips64le:ppc64le:2152223748
3023
SNDRV_TIMER_IOCTL_GSTATUS = 3226489861, 386:arm:3225441285
@@ -38,7 +31,9 @@ SNDRV_TIMER_IOCTL_START = 21664, mips64le:ppc64le:536892576
3831
SNDRV_TIMER_IOCTL_STATUS32 = 2153272340, mips64le:ppc64le:1079530516
3932
SNDRV_TIMER_IOCTL_STATUS64 = 2153796628, mips64le:ppc64le:1080054804
4033
SNDRV_TIMER_IOCTL_STOP = 21665, mips64le:ppc64le:536892577
41-
SNDRV_TIMER_IOCTL_TREAD = 1074025474, 386:arm:???, mips64le:ppc64le:2147767298
34+
SNDRV_TIMER_IOCTL_TREAD64 = 1074025636, mips64le:ppc64le:2147767460
35+
SNDRV_TIMER_IOCTL_TREAD_OLD = 1074025474, mips64le:ppc64le:2147767298
36+
SNDRV_TIMER_IOCTL_TRIGGER = 21670, mips64le:ppc64le:536892582
4237
SNDRV_TIMER_PSFLG_AUTO = 1
4338
SNDRV_TIMER_PSFLG_EARLY_EVENT = 4
4439
SNDRV_TIMER_PSFLG_EXCLUSIVE = 2

0 commit comments

Comments
 (0)