From nobody Mon Feb 9 16:12:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1579117139; cv=none; d=zohomail.com; s=zohoarc; b=iPB0ZPzrmrzwZWNaYHBvsd5hM1oSGhKfUfjB2b7D+bJgv3Ex+FlwM0g4N10LPjxKVNnOJhQH5GA/oS1qo0h1dXb7j3OgAQxudUN1eVVV5bHKfklB/QcHEgh4oz2UTsKrWFonGPfJ+3d9AXQmZfMb6K3VakJSaof2xDofgPssBDA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579117139; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=iaUIzB2T7ku0MVrMmlWS0025Vr77c8z8RLtF0M8Qkfw=; b=ZITCojZnQPBFbgC6I6gbhHHAKxTsKpxA1mXTJiNQg3aanwGJjO4lcrDcQz4XeOWLttSHDwP5Wo6axwzfl/U0SKS+TTbMja19Y6s1nJyU9+V9fFdbqsaoGZOfWF7P9rgSOkpXTXlH+a4dXoiUiUA2g2PT194W50yImmBx9bqC8Y0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579117139767931.6866767499516; Wed, 15 Jan 2020 11:38:59 -0800 (PST) Received: from localhost ([::1]:59726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iroVG-0007r3-7G for importer@patchew.org; Wed, 15 Jan 2020 14:38:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38642) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iroTa-0005eu-08 for qemu-devel@nongnu.org; Wed, 15 Jan 2020 14:37:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iroTU-0004pr-DG for qemu-devel@nongnu.org; Wed, 15 Jan 2020 14:37:11 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:43310 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iroTS-0004nx-IU for qemu-devel@nongnu.org; Wed, 15 Jan 2020 14:37:07 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 70BD61A21BC; Wed, 15 Jan 2020 20:36:53 +0100 (CET) Received: from rtrkw493-lin.domain.local (rtrkw493-lin.domain.local [10.10.14.93]) by mail.rt-rk.com (Postfix) with ESMTPSA id 32A331A2158; Wed, 15 Jan 2020 20:36:53 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Filip Bozuta To: qemu-devel@nongnu.org Subject: [PATCH v8 10/13] linux-user: Add support for selecting alsa timer using ioctl Date: Wed, 15 Jan 2020 20:36:44 +0100 Message-Id: <1579117007-7565-11-git-send-email-Filip.Bozuta@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579117007-7565-1-git-send-email-Filip.Bozuta@rt-rk.com> References: <1579117007-7565-1-git-send-email-Filip.Bozuta@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, berrange@redhat.com, arnd@arndb.de, richard.henderson@linaro.org, laurent@vivier.eu, jcmvbkbc@gmail.com, amarkovic@wavecomp.com, philmd@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch implements functionality of following ioctl: SNDRV_TIMER_IOCTL_SELECT - Selecting timer Selects the timer which id is specified. The timer id is specified in t= he following strcuture: struct snd_timer_select { struct snd_timer_id id; /* timer ID */ unsigned char reserved[32]; /* reserved */ }; A pointer to this structure should be passed as the third ioctl's argum= ent. Before calling the ioctl, the field "tid" should be initialized with th= e id information for the timer which is to be selected. If there is no timer device with the specified id, the error ENODEV ("No such device") is returned. Implementation notes: Ioctl implemented in this patch has a pointer to a 'struct snd_timer_select' as its third argument. That is the reason why a corresponding definition was added in 'linux-user/syscall_types.h'. The rest of the implementation was straightforward. Reviewed-by: Laurent Vivier Signed-off-by: Filip Bozuta --- linux-user/ioctls.h | 2 ++ linux-user/syscall_defs.h | 7 +++++++ linux-user/syscall_types.h | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 989eb9b..7652117 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -459,6 +459,8 @@ MK_PTR(MK_STRUCT(STRUCT_snd_timer_gparams))) IOCTL(SNDRV_TIMER_IOCTL_GSTATUS, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_snd_timer_gstatus))) + IOCTL(SNDRV_TIMER_IOCTL_SELECT, IOC_W, + MK_PTR(MK_STRUCT(STRUCT_snd_timer_select))) =20 IOCTL(HDIO_GETGEO, IOC_R, MK_PTR(MK_STRUCT(STRUCT_hd_geometry))) IOCTL(HDIO_GET_UNMASKINTR, IOC_R, MK_PTR(TYPE_INT)) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index a675b92..39b9739 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2462,6 +2462,11 @@ struct target_snd_timer_gstatus { unsigned char reserved[32]; }; =20 +struct target_snd_timer_select { + struct target_snd_timer_id id; + unsigned char reserved[32]; +}; + /* alsa timer ioctls */ #define TARGET_SNDRV_TIMER_IOCTL_PVERSION TARGET_IOR('T', 0x00, int) #define TARGET_SNDRV_TIMER_IOCTL_NEXT_DEVICE TARGET_IOWR('T', 0x01, = \ @@ -2473,6 +2478,8 @@ struct target_snd_timer_gstatus { struct target_snd_timer_gp= arams) #define TARGET_SNDRV_TIMER_IOCTL_GSTATUS TARGET_IOWR('T', 0x05, = \ struct target_snd_timer_gs= tatus) +#define TARGET_SNDRV_TIMER_IOCTL_SELECT TARGET_IOW('T', 0x10, = \ + struct target_snd_timer_se= lect) =20 /* vfat ioctls */ #define TARGET_VFAT_IOCTL_READDIR_BOTH TARGET_IORU('r', 1) diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index 4e90716..767632d 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -116,6 +116,10 @@ STRUCT(snd_timer_gstatus, TYPE_ULONG, /* resolution_den */ MK_ARRAY(TYPE_CHAR, 32)) /* reserved */ =20 +STRUCT(snd_timer_select, + MK_STRUCT(STRUCT_snd_timer_id), /* id */ + MK_ARRAY(TYPE_CHAR, 32)) /* reserved */ + /* loop device ioctls */ STRUCT(loop_info, TYPE_INT, /* lo_number */ --=20 2.7.4