Skip to content

Commit c850897

Browse files
committed
tools include UAPI: Sync sound/asound.h copy with the kernel sources
Picking the changes from: 3774591 ("ALSA: timer: Introduce virtual userspace-driven timers") Which entails no changes in the tooling side as it only introduces new SNDRV_TIMER_IOCTL_ ioctls, and the ones tracked by scripts in tools/perf/trace/beauty/ are only SNDRV_PCM_IOCTL_ and SNDRV_CTL_IOCTL_, we still need to support SNDRV_TIMER_IOCTL_ ones, but that probably will be one of the first for a BTF enumeration based approach :-) This silences this perf tools build warning: diff -u tools/perf/trace/beauty/include/uapi/sound/asound.h include/uapi/sound/asound.h Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ivan Orlov <ivan.orlov0322@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/lkml/ZvrB-g_E7g2ArlYW@x1 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 424aafb commit c850897

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

  • tools/perf/trace/beauty/include/uapi/sound

tools/perf/trace/beauty/include/uapi/sound/asound.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ struct snd_ump_block_info {
869869
* Timer section - /dev/snd/timer
870870
*/
871871

872-
#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
872+
#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8)
873873

874874
enum {
875875
SNDRV_TIMER_CLASS_NONE = -1,
@@ -894,6 +894,7 @@ enum {
894894
#define SNDRV_TIMER_GLOBAL_RTC 1 /* unused */
895895
#define SNDRV_TIMER_GLOBAL_HPET 2
896896
#define SNDRV_TIMER_GLOBAL_HRTIMER 3
897+
#define SNDRV_TIMER_GLOBAL_UDRIVEN 4
897898

898899
/* info flags */
899900
#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
@@ -974,6 +975,18 @@ struct snd_timer_status {
974975
};
975976
#endif
976977

978+
/*
979+
* This structure describes the userspace-driven timer. Such timers are purely virtual,
980+
* and can only be triggered from software (for instance, by userspace application).
981+
*/
982+
struct snd_timer_uinfo {
983+
/* To pretend being a normal timer, we need to know the resolution in ns. */
984+
__u64 resolution;
985+
int fd;
986+
unsigned int id;
987+
unsigned char reserved[16];
988+
};
989+
977990
#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
978991
#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
979992
#define SNDRV_TIMER_IOCTL_TREAD_OLD _IOW('T', 0x02, int)
@@ -990,6 +1003,8 @@ struct snd_timer_status {
9901003
#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
9911004
#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
9921005
#define SNDRV_TIMER_IOCTL_TREAD64 _IOW('T', 0xa4, int)
1006+
#define SNDRV_TIMER_IOCTL_CREATE _IOWR('T', 0xa5, struct snd_timer_uinfo)
1007+
#define SNDRV_TIMER_IOCTL_TRIGGER _IO('T', 0xa6)
9931008

9941009
#if __BITS_PER_LONG == 64
9951010
#define SNDRV_TIMER_IOCTL_TREAD SNDRV_TIMER_IOCTL_TREAD_OLD

0 commit comments

Comments
 (0)