github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/dev_snd_timer.txt (about)

     1  # Copyright 2015 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <uapi/asm/ioctl.h>
     5  include <uapi/linux/fcntl.h>
     6  include <uapi/linux/time.h>
     7  include <uapi/sound/asound.h>
     8  include <uapi/linux/soundcard.h>
     9  
    10  resource fd_sndtimer[fd]
    11  
    12  openat$sndtimer(fd const[AT_FDCWD], file ptr[in, string["/dev/snd/timer"]], flags flags[open_flags]) fd_sndtimer
    13  
    14  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])
    18  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])
    20  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])
    22  ioctl$SNDRV_TIMER_IOCTL_PARAMS(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_PARAMS], arg ptr[in, snd_timer_params])
    23  ioctl$SNDRV_TIMER_IOCTL_STATUS32(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_STATUS32], arg ptr[out, snd_timer_status[int32]])
    24  ioctl$SNDRV_TIMER_IOCTL_STATUS64(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_STATUS64], arg ptr[out, snd_timer_status[int64]])
    25  ioctl$SNDRV_TIMER_IOCTL_START(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_START])
    26  ioctl$SNDRV_TIMER_IOCTL_STOP(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_STOP])
    27  ioctl$SNDRV_TIMER_IOCTL_CONTINUE(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_CONTINUE])
    28  ioctl$SNDRV_TIMER_IOCTL_PAUSE(fd fd_sndtimer, cmd const[SNDRV_TIMER_IOCTL_PAUSE])
    29  
    30  snd_timer_flags = SNDRV_TIMER_PSFLG_AUTO, SNDRV_TIMER_PSFLG_EXCLUSIVE, SNDRV_TIMER_PSFLG_EARLY_EVENT
    31  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
    32  
    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  
    36  snd_timer_id_str = "id0", "id1"
    37  snd_timer_name = "timer0", "timer1"
    38  
    39  snd_timer_ginfo {
    40  	tid	snd_timer_id
    41  	flags	int32
    42  	card	int32
    43  	id	string[snd_timer_id_str, 64]
    44  	name	string[snd_timer_name, 80]
    45  	pad1	const[0, intptr]
    46  	res	intptr
    47  	resmin	intptr
    48  	resmax	intptr
    49  	clients	int32
    50  	pad2	array[const[0, int8], 32]
    51  }
    52  
    53  snd_timer_gparams {
    54  	tid	snd_timer_id
    55  	periodn	intptr
    56  	periodd	intptr
    57  	pad	array[const[0, int8], 32]
    58  }
    59  
    60  snd_timer_gstatus {
    61  	tid	snd_timer_id
    62  	res	intptr
    63  	resnum	intptr
    64  	resden	intptr
    65  	pad	array[const[0, int8], 32]
    66  }
    67  
    68  snd_timer_select {
    69  	tid	snd_timer_id
    70  	pad	array[const[0, int8], 32]
    71  }
    72  
    73  snd_timer_params {
    74  	flags	flags[snd_timer_flags, int32]
    75  	ticks	int32
    76  	qsize	int32
    77  	pad1	const[0, int32]
    78  	filter	flags[snd_timer_filter, int32]
    79  	pad2	array[const[0, int8], 60]
    80  }
    81  
    82  type snd_timer_status[TYPE] {
    83  	tstamp_sec	TYPE
    84  	tstamp_nsec	TYPE
    85  	resolution	int32
    86  	lost		int32
    87  	overrun		int32
    88  	queue		int32
    89  	pad2		array[const[0, int8], 64]
    90  }
    91  
    92  define SND_TIMER_STATUS32_SIZE	88
    93  define SND_TIMER_STATUS64_SIZE	96
    94  define SNDRV_TIMER_IOCTL_STATUS32	_IOR('T', 0x14, char[SND_TIMER_STATUS32_SIZE])
    95  define SNDRV_TIMER_IOCTL_STATUS64	_IOR('T', 0x14, char[SND_TIMER_STATUS64_SIZE])