qemu-patch-raspberry4/linux-user
Filip Bozuta aca7708eab linux-user: Add support for getting/setting specified alsa timer parameters using ioctls
This patch implements functionalities of following ioctls:

SNDRV_TIMER_IOCTL_GINFO - Getting information about specified timer

    Read information about the specified timer. The information about the
    timer is returned in the following structure:

        struct snd_timer_ginfo {
            struct snd_timer_id tid;      /* requested timer ID */
            unsigned int flags;           /* timer flags - SNDRV_TIMER_FLG_* */
            int card;                     /* card number */
            unsigned char id[64];         /* timer identification */
            unsigned char name[80];       /* timer name */
            unsigned long reserved0;      /* reserved for future use */
            unsigned long resolution;     /* average period resolution in ns */
            unsigned long resolution_min; /* minimal period resolution in ns */
            unsigned long resolution_max; /* maximal period resolution in ns */
            unsigned int clients;         /* active timer clients */
            unsigned char reserved[32];   /* reserved */
        };

    A pointer to this structure should be passed as the third ioctl's argument.
    Before calling the ioctl, the field "tid" should be initialized with the id
    information for the timer which information is to be obtained. After the
    ioctl call, the rest of the structure fields are filled with values from
    the timer device with the specified id. If there is no device with the
    specified id, the error ENODEV ("No such device") is returned.

SNDRV_TIMER_IOCTL_GPARAMS - Setting precise period duration

    Sets timer precise period duration numerator and denominator in seconds. The
    period duration is set in the following structure:

        struct snd_timer_gparams {
            struct snd_timer_id tid;    /* requested timer ID */
            unsigned long period_num;   /* period duration - numerator */
            unsigned long period_den;   /* period duration - denominator */
            unsigned char reserved[32]; /* reserved */
        };

    A pointer to this structure should be passed as the third ioctl's argument.
    Before calling the ioctl, the field "tid" should be initialized with the id
    information for the timer which period duration is to be set. Also, the
    fileds "period_num" and "period_den" should be filled with the period
    duration numerator and denominator values that are to be set respectively.
    If there is no device with the specified id, the error ENODEV ("No such
    device") is returned.

SNDRV_TIMER_IOCTL_GSTATUS - Getting current period resolution

    Read timer current period resolution in nanoseconds and period resolution
    numerator and denominator in seconds. The period resolution information is
    returned in the following structure:

    struct snd_timer_gstatus {
        struct snd_timer_id tid;        /* requested timer ID */
        unsigned long resolution;       /* current period resolution in ns */
        unsigned long resolution_num;   /* period resolution - numerator */
        unsigned long resolution_den;   /* period resolution - denominator */
        unsigned char reserved[32];     /* reserved for future use */
    };

    A pointer to this structure should be passed as the third ioctl's argument.
    Before calling the ioctl, the field "tid" should be initialized with the id
    information for the timer which period resolution is to be obtained. After
    the ioctl call, the rest of the structure fields are filled with values
    from the timer device with the specified id. If there is no device with the
    specified id, the error ENODEV ("No such device") is returned.

Implementation notes:

    All ioctls in this patch have pointer to some kind of a structure as their
    third argument. That is the reason why corresponding definitions were added
    in 'linux-user/syscall_types.h'. All of these strcutures have some fields
    that are of type 'unsigned long'. That is the reason why separate target
    structures were defined in 'linux-user/syscall_defs.h'. Also, all of the
    structures have a field with type 'struct snd_timer_id' which is the reason
    why a separate target structure 'struct target_snd_timer_id' was also
    defined. The rest of the implementation was straightforward.

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Filip Bozuta <Filip.Bozuta@rt-rk.com>
Message-Id: <1579117007-7565-10-git-send-email-Filip.Bozuta@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-02-19 11:17:40 +01:00
..
aarch64 target/arm: only update pc after semihosting completes 2020-01-09 11:41:29 +00:00
alpha linux-user: alpha: Update syscall numbers to kernel 5.5 level 2020-02-17 10:28:50 +01:00
arm linux-user: Use `qemu_log' for non-strace logging 2020-02-19 11:17:40 +01:00
cris linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
generic linux-user: Introduce TARGET_HAVE_ARCH_STRUCT_FLOCK 2019-07-02 16:56:46 +02:00
host linux-user: Add safe_syscall for riscv64 host 2018-12-26 06:40:02 +11:00
hppa linux-user: add missing TARGET_SIGRTMIN for hppa 2020-02-12 18:56:22 +01:00
i386 linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
m68k linux-user: m68k: Update syscall numbers to kernel 5.5 level 2020-02-17 10:28:50 +01:00
microblaze linux-user: microblaze: Update syscall numbers to kernel 5.5 level 2020-02-17 10:28:50 +01:00
mips linux-user: mips: Update syscall numbers to kernel 5.5 level 2020-02-17 10:28:50 +01:00
mips64 linux-user: mips: Update syscall numbers to kernel 5.5 level 2020-02-17 10:28:50 +01:00
nios2 linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
openrisc linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
ppc target/ppc: Implement the VTB for HV access 2019-12-17 10:39:48 +11:00
riscv linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
s390x linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
sh4 linux-user: sh4: Update syscall numbers to kernel 5.5 level 2020-02-17 10:28:50 +01:00
sparc linux-user/sparc: Fix cpu_clone_regs_* 2019-11-06 13:44:19 +01:00
sparc64 Supply missing header guards 2019-06-12 13:20:21 +02:00
tilegx linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
x86_64 linux-user: x86_64: Update syscall numbers to kernel 5.5 level 2020-02-17 10:28:50 +01:00
xtensa linux-user: xtensa: Remove unused constant TARGET_NR_syscall_count 2020-02-17 10:28:50 +01:00
cpu_loop-common.h cpu: Replace ENV_GET_CPU with env_cpu 2019-06-10 07:03:34 -07:00
elfload.c linux-user: Reserve space for brk 2020-01-22 15:00:03 +01:00
errno_defs.h Supply missing header guards 2019-06-12 13:20:21 +02:00
exit.c build: move TARGET_GPROF to config-host.mak 2020-02-12 16:29:27 +01:00
fd-trans.c linux-user: Use `qemu_log' for non-strace logging 2020-02-19 11:17:40 +01:00
fd-trans.h linux-user: move TargetFdTrans functions to their own file 2018-09-25 22:36:47 +02:00
flat.h Supply missing header guards 2019-06-12 13:20:21 +02:00
flatload.c linux-user/flatload: fix initial stack pointer alignment 2018-10-30 11:23:32 -07:00
ioctls.h linux-user: Add support for getting/setting specified alsa timer parameters using ioctls 2020-02-19 11:17:40 +01:00
linux_loop.h linux-user: Add loop control ioctls 2016-07-19 15:22:33 +03:00
linuxload.c avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
main.c linux-user: remove gemu_log from the linux-user tree 2020-02-19 11:17:40 +01:00
Makefile.objs linux-user/m68k: remove simulator syscall interface 2019-06-26 17:14:41 +02:00
mmap.c linux-user: convert target_munmap debug to a tracepoint 2019-12-19 08:20:16 +00:00
qemu.h linux-user: remove gemu_log from the linux-user tree 2020-02-19 11:17:40 +01:00
safe-syscall.S linux-user: Provide safe_syscall for fixing races between signals and syscalls 2016-05-27 14:49:51 +03:00
signal-common.h linux-user: Make sigaltstack stacks per-thread 2019-07-26 19:24:33 +02:00
signal.c linux-user: Use `qemu_log' for strace 2020-02-19 11:17:40 +01:00
socket.h Supply missing header guards 2019-06-12 13:20:21 +02:00
strace.c linux-user: Use `qemu_log' for strace 2020-02-19 11:17:40 +01:00
strace.list linux-user/strace: Improve output of various syscalls 2020-02-19 11:17:40 +01:00
syscall.c linux-user: Add support for getting alsa timer version and id 2020-02-19 11:17:40 +01:00
syscall_defs.h linux-user: Add support for getting/setting specified alsa timer parameters using ioctls 2020-02-19 11:17:40 +01:00
syscall_types.h linux-user: Add support for getting/setting specified alsa timer parameters using ioctls 2020-02-19 11:17:40 +01:00
target_flat.h Supply missing header guards 2019-06-12 13:20:21 +02:00
trace-events linux-user: fix use of SIGRTMIN 2020-02-12 18:56:41 +01:00
uaccess.c avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
uname.c cpu: Replace ENV_GET_CPU with env_cpu 2019-06-10 07:03:34 -07:00
uname.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
vm86.c linux-user: Use `qemu_log' for non-strace logging 2020-02-19 11:17:40 +01:00