@@ -12,27 +12,29 @@ resource fd_sndtimer[fd]
1212openat$sndtimer(fd const[AT_FDCWD], file ptr[in, string["/dev/snd/timer"]], flags flags[open_flags]) fd_sndtimer
1313
1414ioctl$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])
1818ioctl$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])
2020ioctl$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 ])
2222ioctl$SNDRV_TIMER_IOCTL_PARAMS(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_PARAMS], arg ptr[in, snd_timer_params])
2323ioctl$SNDRV_TIMER_IOCTL_STATUS32(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_STATUS32], arg ptr[out, snd_timer_status[int32]])
2424ioctl$SNDRV_TIMER_IOCTL_STATUS64(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_STATUS64], arg ptr[out, snd_timer_status[int64]])
2525ioctl$SNDRV_TIMER_IOCTL_START(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_START])
2626ioctl$SNDRV_TIMER_IOCTL_STOP(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_STOP])
2727ioctl$SNDRV_TIMER_IOCTL_CONTINUE(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_CONTINUE])
2828ioctl$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
3035snd_timer_flags = SNDRV_TIMER_PSFLG_AUTO, SNDRV_TIMER_PSFLG_EXCLUSIVE, SNDRV_TIMER_PSFLG_EARLY_EVENT
3136snd_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-
3638snd_timer_id_str = "id0", "id1"
3739snd_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+
92111define SND_TIMER_STATUS32_SIZE 88
93112define SND_TIMER_STATUS64_SIZE 96
94113define SNDRV_TIMER_IOCTL_STATUS32 _IOR('T', 0x14, char[SND_TIMER_STATUS32_SIZE])
0 commit comments