From nobody Mon Feb 9 17:37:14 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=1579117401; cv=none; d=zohomail.com; s=zohoarc; b=fg7U2w8EgoxkNAE2PXCc+Hx2vZmAX6J4z85h19jFBElbrhtFyZrowTu30CvTWAlw0sYc7ATnp4B+V0ubp5rVa2s6CE+5xLJw6bm52EuijwoZZVZllKv58WmAnKlyNfdWmquPYoRvK7YtRGX+rSkOLP8gy6ayjjUpRhHiQPsQqNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579117401; 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=z1t12ysenJo7W/ajbMU8uUm2zvceLKwgWMlg6RjqgXk=; b=lL/rkhvgbX3TWL5emLhWCc55bDNK7Qh4XKKcluaWKNLohLyXO5rLFk54A8nIsketAExKfc7Ftoy7VZrKGHliqvFEo5zEhk4Qe16RmEsNkJTZdOSKHj+VBi72ALmCrBsQd1wGIf35a95Bk0iQd/MEu8Td5sGtji6v/M5hh1PeGmI= 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 1579117401140418.3920566548114; Wed, 15 Jan 2020 11:43:21 -0800 (PST) Received: from localhost ([::1]:59800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iroZT-000620-KZ for importer@patchew.org; Wed, 15 Jan 2020 14:43:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38725) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iroTh-0005kX-FM for qemu-devel@nongnu.org; Wed, 15 Jan 2020 14:37:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iroTc-0004uq-Th for qemu-devel@nongnu.org; Wed, 15 Jan 2020 14:37:20 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:43311 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 1iroTc-0004oO-JN for qemu-devel@nongnu.org; Wed, 15 Jan 2020 14:37:16 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 7FEA31A2158; 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 4945A1A21E3; 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 12/13] linux-user: Add support for selected alsa timer instructions using ioctls Date: Wed, 15 Jan 2020 20:36:46 +0100 Message-Id: <1579117007-7565-13-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 functionalities of following ioctls: SNDRV_TIMER_IOCTL_START - Start selected alsa timer Starts the timer device that is selected. The third ioctl's argument is ignored. Before calling this ioctl, the ioctl "SNDRV_TIMER_IOCTL_SELECT" should be called first to select the timer that is to be started. If no timer is selected, the error EBADFD ("File descriptor in bad shape") is returned. SNDRV_TIMER_IOCTL_STOP - Stop selected alsa timer Stops the timer device that is selected. The third ioctl's argument is ignored. Before calling this ioctl, the ioctl "SNDRV_TIMER_IOCTL_SELECT" should be called first to select the timer that is to be stopped. If no timer is selected, the error EBADFD ("File descriptor in bad shape") is returned. SNDRV_TIMER_IOCTL_CONTINUE - Continue selected alsa timer Continues the timer device that is selected. The third ioctl's argument= is ignored. Before calling this ioctl, the ioctl "SNDRV_TIMER_IOCTL_SELECT" should be called first to select the timer that is to be continued. If = no timer is selected, the error EBADFD ("File descriptor in bad shape") is returned. SNDRV_TIMER_IOCTL_PAUSE - Pause selected alsa timer Pauses the timer device that is selected. The third ioctl's argument is ignored. Before calling this ioctl, the ioctl "SNDRV_TIMER_IOCTL_SELECT" should be called first to select the timer that is to be paused. If no timer is selected, the error EBADFD ("File descriptor in bad shape") is returned. Implementation notes: Since all of the implemented ioctls have NULL as their third argument, their implementation was straightforward. Reviewed-by: Laurent Vivier Signed-off-by: Filip Bozuta --- linux-user/ioctls.h | 4 ++++ linux-user/syscall_defs.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 43e7e5d..75a2f0e 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -466,6 +466,10 @@ MK_PTR(MK_STRUCT(STRUCT_snd_timer_params))) IOCTL(SNDRV_TIMER_IOCTL_STATUS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_snd_timer_status))) + IOCTL(SNDRV_TIMER_IOCTL_START, 0, TYPE_NULL) + IOCTL(SNDRV_TIMER_IOCTL_STOP, 0, TYPE_NULL) + IOCTL(SNDRV_TIMER_IOCTL_CONTINUE, 0, TYPE_NULL) + IOCTL(SNDRV_TIMER_IOCTL_PAUSE, 0, TYPE_NULL) =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 d5f5cad..2d86d78 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2505,6 +2505,10 @@ struct target_snd_timer_status { struct snd_timer_params) #define TARGET_SNDRV_TIMER_IOCTL_STATUS TARGET_IOR('T', 0x14, = \ struct target_snd_timer_st= atus) +#define TARGET_SNDRV_TIMER_IOCTL_START TARGET_IO('T', 0xa0) +#define TARGET_SNDRV_TIMER_IOCTL_STOP TARGET_IO('T', 0xa1) +#define TARGET_SNDRV_TIMER_IOCTL_CONTINUE TARGET_IO('T', 0xa2) +#define TARGET_SNDRV_TIMER_IOCTL_PAUSE TARGET_IO('T', 0xa3) =20 /* vfat ioctls */ #define TARGET_VFAT_IOCTL_READDIR_BOTH TARGET_IORU('r', 1) --=20 2.7.4