From nobody Tue Nov 11 16:00:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1564406017; cv=none; d=zoho.com; s=zohoarc; b=j0ONuuAcJEife0Vrvsdm6ZybKvgZUP+c/aKsAYqdj405ssCIg1ybQtfKEILtov7A/UvwxeVsqnxEXu2oKumTN37iju3iymSQCA8HUa4BPvUwVn/BMzGpxjuX4ptZC0L/rhhi75oNlnf+zVG8iauOQR8ebg2OBhtUtH+6iT9Wu84= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564406017; 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:ARC-Authentication-Results; bh=wrqBcwmVODiPlDhMip3RN7gK53qCb7ZxoDvRG15XMWI=; b=fwhxXJu7CUAyOi44QoGhuoGbhXOCU5MrDYI5wVbfl/MDtAH+clY+n/fP8xcNdWcf05uMxuIydNvepgZkzsSxNx6WwDMH9mG5lqThuGlwunL8b31JSw4KiKvhHNAai2JKSo/2t9QIOrkHodCk2BY12gjVx5Yi7P1URVXcC0LPX3k= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1564406017670976.3032677098187; Mon, 29 Jul 2019 06:13:37 -0700 (PDT) Received: from localhost ([::1]:52068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5T6-0007NK-PJ for importer@patchew.org; Mon, 29 Jul 2019 09:13:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40769) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5Qn-0003Dw-W0 for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs5Qm-0003L2-W4 for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:13 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:48967 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 1hs5Qm-0001TV-Pg for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:12 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 17ED01A214A; Mon, 29 Jul 2019 15:10:10 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id EE7AB1A20A2; Mon, 29 Jul 2019 15:10:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2019 15:09:45 +0200 Message-Id: <1564405791-9147-2-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH for 4.1 v2 1/7] linux user: Add support for FDFLUSH ioctl 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: Yunqiang Su , laurent@vivier.eu, amarkovic@wavecomp.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" From: Yunqiang Su FDFLUSH is used for flushing buffers of floppy drives. Support in QEMU is needed because some of Debian packages use this ioctl while running post-build tests. One such example is 'tar' package. Signed-off-by: Yunqiang Su Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier --- linux-user/ioctls.h | 2 ++ linux-user/syscall.c | 1 + linux-user/syscall_defs.h | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 3281c97..fb7b014 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -112,6 +112,8 @@ IOCTL(BLKZEROOUT, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2))) #endif =20 + IOCTL(FDFLUSH, 0, TYPE_NULL) + #ifdef FIBMAP IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8367cb1..ee80175 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -87,6 +87,7 @@ #include #include #include +#include #if defined(CONFIG_FIEMAP) #include #endif diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 0662270..fb30bce 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -883,6 +883,10 @@ struct target_pollfd { #define TARGET_BLKROTATIONAL TARGET_IO(0x12, 126) #define TARGET_BLKZEROOUT TARGET_IO(0x12, 127) =20 +/* From */ + +#define TARGET_FDFLUSH TARGET_IO(2, 0x4b) + #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ #define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used fo= r bmap */ =20 --=20 2.7.4 From nobody Tue Nov 11 16:00:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1564406090; cv=none; d=zoho.com; s=zohoarc; b=KGKPEuvS3iFajGRi4GwxlueK6da8HxkB+8togc7j+ClFYa+IJ8q/o2fuL1oKr71u1j6aBRRoTTVldNb1JxLtkei5h03m2BCtrDvJaur/HZ+m2Ht4EQcJs3+6Rccu7u3MNSWyAQ8HH5DXqgPfJSzKdwxmFdI2Ksbc7/vB73K71Ms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564406090; 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:ARC-Authentication-Results; bh=gd3SOqCk3dAuAzTX30s1Ek92/ZPwG93H0HmhfXwyhhE=; b=LIH2uRhynJDpiAwYfDepZGBmM5Rp+WXJK4nEINzOcTBNj6h34jzvpvAvL/EmPsZ9+xSgqmOWq8HjNH/UtkMQoVzn8Bh/zdP+0j6EWT/TLTL31l+7nJjxHzFoJY0cJyLnEb9jP7AkuYyyWdLnMwtAbjys9n8TndzDek47xW1cgYs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1564406090975158.16510702541814; Mon, 29 Jul 2019 06:14:50 -0700 (PDT) Received: from localhost ([::1]:52082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5UI-0001KN-2o for importer@patchew.org; Mon, 29 Jul 2019 09:14:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40785) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5Qq-0003KY-4Y for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs5Qp-0003O5-7L for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:16 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:49393 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 1hs5Qp-0001VT-16 for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:15 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 335091A2150; Mon, 29 Jul 2019 15:10:12 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 198C51A20A2; Mon, 29 Jul 2019 15:10:12 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2019 15:09:46 +0200 Message-Id: <1564405791-9147-3-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH for 4.1 v2 2/7] linux-user: Add support for FDMSGON and FDMSGOFF ioctls 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: laurent@vivier.eu, amarkovic@wavecomp.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" From: Aleksandar Markovic FDMSGON and FDMSGOFF switch informational messages of floppy drives on and off. Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier --- linux-user/ioctls.h | 2 ++ linux-user/syscall_defs.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index fb7b014..9978163 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -112,6 +112,8 @@ IOCTL(BLKZEROOUT, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2))) #endif =20 + IOCTL(FDMSGON, 0, TYPE_NULL) + IOCTL(FDMSGOFF, 0, TYPE_NULL) IOCTL(FDFLUSH, 0, TYPE_NULL) =20 #ifdef FIBMAP diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index fb30bce..cd97e9b 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -885,6 +885,8 @@ struct target_pollfd { =20 /* From */ =20 +#define TARGET_FDMSGON TARGET_IO(2, 0x45) +#define TARGET_FDMSGOFF TARGET_IO(2, 0x46) #define TARGET_FDFLUSH TARGET_IO(2, 0x4b) =20 #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ --=20 2.7.4 From nobody Tue Nov 11 16:00:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1564406093; cv=none; d=zoho.com; s=zohoarc; b=ioHpbm2id8b+RSdZEVbBU57ILuLsCs1y4QXjkgAhmTju8vILJRG66reupwc3x2kCiNcmbip5f0OfNAA4nWo4GkFJ8fayHV5cpCjETWPXr9JuB7HhuyC1eSVui3FUpd2QYwkEdVTKetkv3IEuu1nx67siub+UppR/UGuwm57JA6w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564406093; 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:ARC-Authentication-Results; bh=z9G0qlajjd7o6Go49W6tLBJoq66sA4pRHVx0vJkzW3M=; b=OvFZS+Kp0qLyYGunUAdSVcQirN/wWQvkGeS7dMGhXkS7LHikH4O3DKQldOP+6+bx6GwpH2eaoTO3bdoE8RsNxgtYsCbaPEV8iEPKmF9MHSsixEEJ0P2iWcY1hjiUPckwC8ebEXOvCZ8joQIePZ4GWuO1gSdzKRUjqIOQZwGsuZs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1564406093102617.6700681546303; Mon, 29 Jul 2019 06:14:53 -0700 (PDT) Received: from localhost ([::1]:52086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5UK-0001PT-6K for importer@patchew.org; Mon, 29 Jul 2019 09:14:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40812) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5Qs-0003RG-AZ for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs5Qr-0003Qd-Cc for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:18 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:49889 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 1hs5Qr-0001Y1-6K for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:17 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 557E51A2199; Mon, 29 Jul 2019 15:10:14 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 3CA981A20A2; Mon, 29 Jul 2019 15:10:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2019 15:09:47 +0200 Message-Id: <1564405791-9147-4-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH for 4.1 v2 3/7] linux-user: Add support for FDRESET, FDRAWCMD, FDTWADDLE, and FDEJECT ioctls 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: laurent@vivier.eu, amarkovic@wavecomp.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" From: Aleksandar Markovic FDRESET, FDRAWCMD, FDTWADDLE, and FDEJECT ioctls are misc commands for controlling a floppy drive. Signed-off-by: Aleksandar Markovic --- 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 9978163..ab4ef2e 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -115,6 +115,10 @@ IOCTL(FDMSGON, 0, TYPE_NULL) IOCTL(FDMSGOFF, 0, TYPE_NULL) IOCTL(FDFLUSH, 0, TYPE_NULL) + IOCTL(FDRESET, 0, TYPE_NULL) + IOCTL(FDRAWCMD, 0, TYPE_NULL) + IOCTL(FDTWADDLE, 0, TYPE_NULL) + IOCTL(FDEJECT, 0, TYPE_NULL) =20 #ifdef FIBMAP IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index cd97e9b..4185391 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -888,6 +888,10 @@ struct target_pollfd { #define TARGET_FDMSGON TARGET_IO(2, 0x45) #define TARGET_FDMSGOFF TARGET_IO(2, 0x46) #define TARGET_FDFLUSH TARGET_IO(2, 0x4b) +#define TARGET_FDRESET TARGET_IO(2, 0x54) +#define TARGET_FDRAWCMD TARGET_IO(2, 0x58) +#define TARGET_FDTWADDLE TARGET_IO(2, 0x59) +#define TARGET_FDEJECT TARGET_IO(2, 0x5a) =20 #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ #define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used fo= r bmap */ --=20 2.7.4 From nobody Tue Nov 11 16:00:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1564406065; cv=none; d=zoho.com; s=zohoarc; b=Mb+pRUWNJAmJjcf6Via5SOLnRBq/1KS3orc8cMDro78fLumKDEjk2YfwE0Byb8rxKa+jWv5zBXaYAx/I5L2uAnnfVnxtmXhBmYglE9klLE1Cl6UfRrbvVzmY/sODRhrqOTyR/m/Z+4nGGVuTRznH7G+LeB6APjW4kZgILcdqQzY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564406065; 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:ARC-Authentication-Results; bh=5JqfVkcfyUbaLfF8X0BKRyauqcXoUC1lC8KRRVzLHns=; b=UjjigO3qgiEFeL+vWBc/7Ed4rXBu2L+Nhv+/Gi8G5Rvys/h4r0vNaIvN8Zgk14L95qggEXoQzS1kE6/FiBx5Cnzx6JlanrGoErjbevkQ4Vx74EyDxE2Zo0xCyR+j4icom7rH7n6Z5gPRaXEj5QaN5jJ1UvqsGYpY0ATxG1HQcpo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1564406065618641.234416423113; Mon, 29 Jul 2019 06:14:25 -0700 (PDT) Received: from localhost ([::1]:52072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5Ts-0008UI-L9 for importer@patchew.org; Mon, 29 Jul 2019 09:14:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40826) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5Qu-0003Wu-8Y for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs5Qt-0003VF-8O for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:20 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:50065 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 1hs5Qt-0001cC-1z for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:19 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 611321A21BB; Mon, 29 Jul 2019 15:10:16 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 4891F1A20A2; Mon, 29 Jul 2019 15:10:16 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2019 15:09:48 +0200 Message-Id: <1564405791-9147-5-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH for 4.1 v2 4/7] linux-user: Add support for FDFMTBEG, FDFMTTRK, and FDFMTEND ioctls 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: laurent@vivier.eu, amarkovic@wavecomp.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" From: Aleksandar Markovic FDFMTBEG, FDFMTTRK, and FDFMTEND ioctls provide means for controlling formatting of a floppy drive. Signed-off-by: Aleksandar Markovic --- linux-user/ioctls.h | 3 +++ linux-user/syscall_defs.h | 3 +++ linux-user/syscall_types.h | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index ab4ef2e..e393ad6 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -114,6 +114,9 @@ =20 IOCTL(FDMSGON, 0, TYPE_NULL) IOCTL(FDMSGOFF, 0, TYPE_NULL) + IOCTL(FDFMTBEG, 0, TYPE_NULL) + IOCTL(FDFMTTRK, IOC_W, MK_PTR(MK_STRUCT(STRUCT_format_descr))) + IOCTL(FDFMTEND, 0, TYPE_NULL) IOCTL(FDFLUSH, 0, TYPE_NULL) IOCTL(FDRESET, 0, TYPE_NULL) IOCTL(FDRAWCMD, 0, TYPE_NULL) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 4185391..1ca115d 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -887,6 +887,9 @@ struct target_pollfd { =20 #define TARGET_FDMSGON TARGET_IO(2, 0x45) #define TARGET_FDMSGOFF TARGET_IO(2, 0x46) +#define TARGET_FDFMTBEG TARGET_IO(2, 0x47) +#define TARGET_FDFMTTRK TARGET_IOW(2, 0x48, struct target_format_desc= r) +#define TARGET_FDFMTEND TARGET_IO(2, 0x49) #define TARGET_FDFLUSH TARGET_IO(2, 0x4b) #define TARGET_FDRESET TARGET_IO(2, 0x54) #define TARGET_FDRAWCMD TARGET_IO(2, 0x58) diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index 4e36983..d82d1a5 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -261,6 +261,11 @@ STRUCT(blkpg_ioctl_arg, TYPE_INT, /* datalen */ TYPE_PTRVOID) /* data */ =20 +STRUCT(format_descr, + TYPE_INT, /* device */ + TYPE_INT, /* head */ + TYPE_INT) /* track */ + #if defined(CONFIG_USBFS) /* usb device ioctls */ STRUCT(usbdevfs_ctrltransfer, --=20 2.7.4 From nobody Tue Nov 11 16:00:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1564406012; cv=none; d=zoho.com; s=zohoarc; b=cbEZfsWD4ID5Mu+E9xFze0UMlx3r5OZLfdTc3bmbf259HUxk5JIMF4uMjVXbJXkhnvjhC66kOpyy6Oa/RAtzdN4J18PIXR4PiD8jFVEYpnS3jKdDT0iXhVZpRwRGmQ1r8Mvzbi2723lq3ZmVcLcyj3YDwIUnqzdLY/nM8n5CTus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564406012; 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:ARC-Authentication-Results; bh=NcZxaboLcVMSllcLf0GfYD4m4GT/qrsjPme3YSexVCQ=; b=GhQhmHKA6YC6o7TFs0Ji7XqJVdJsZzJE5Bimt1/Pge673vg88jW3cJbwID9sTARJKPql+eToQTVEIRSjEvRkQpwQa81dCHjlBRG6kUctQnCd//0Wx9gOeOXWjansOLKygYzyC2JbdNWF3+H5OMMRcldSsLe109tU+Xr9fCUwr40= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1564406012521246.92635071388747; Mon, 29 Jul 2019 06:13:32 -0700 (PDT) Received: from localhost ([::1]:52064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5T1-0007GO-Ja for importer@patchew.org; Mon, 29 Jul 2019 09:13:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40734) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5Ql-000368-5O for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs5Qk-0003GP-2K for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:11 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:51387 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 1hs5Qj-0003DD-Re for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:10 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 4C84A1A210C; Mon, 29 Jul 2019 15:10:17 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 34F701A20A2; Mon, 29 Jul 2019 15:10:17 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2019 15:09:49 +0200 Message-Id: <1564405791-9147-6-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH for 4.1 v2 5/7] linux-user: Add support for FDSETEMSGTRESH, FDSETMAXERRS, and FDGETMAXERRS ioctls 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: laurent@vivier.eu, amarkovic@wavecomp.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" From: Aleksandar Markovic FDSETEMSGTRESH, FDSETMAXERRS, and FDGETMAXERRS ioctls are commands for controlling error reporting of a floppy drive. Signed-off-by: Aleksandar Markovic --- linux-user/ioctls.h | 2 ++ linux-user/syscall_defs.h | 19 +++++++++++++++++++ linux-user/syscall_types.h | 7 +++++++ 3 files changed, 28 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index e393ad6..6551938 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -118,6 +118,8 @@ IOCTL(FDFMTTRK, IOC_W, MK_PTR(MK_STRUCT(STRUCT_format_descr))) IOCTL(FDFMTEND, 0, TYPE_NULL) IOCTL(FDFLUSH, 0, TYPE_NULL) + IOCTL(FDSETMAXERRS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_floppy_max_errors)= )) + IOCTL(FDGETMAXERRS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_floppy_max_errors)= )) IOCTL(FDRESET, 0, TYPE_NULL) IOCTL(FDRAWCMD, 0, TYPE_NULL) IOCTL(FDTWADDLE, 0, TYPE_NULL) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 1ca115d..36256b0 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -885,12 +885,31 @@ struct target_pollfd { =20 /* From */ =20 +struct target_floppy_max_errors { + abi_uint abort; + abi_uint read_track; + abi_uint reset; + abi_uint recal; + abi_uint reporting; +}; + +struct target_format_descr { + abi_uint device; + abi_uint head; + abi_uint track; +}; + #define TARGET_FDMSGON TARGET_IO(2, 0x45) #define TARGET_FDMSGOFF TARGET_IO(2, 0x46) #define TARGET_FDFMTBEG TARGET_IO(2, 0x47) #define TARGET_FDFMTTRK TARGET_IOW(2, 0x48, struct target_format_desc= r) #define TARGET_FDFMTEND TARGET_IO(2, 0x49) +#define TARGET_FDSETEMSGTRESH TARGET_IO(2, 0x4a) #define TARGET_FDFLUSH TARGET_IO(2, 0x4b) +#define TARGET_FDSETMAXERRS TARGET_IOW(2, 0x4c, = \ + struct target_floppy_max_errors) +#define TARGET_FDGETMAXERRS TARGET_IOR(2, 0x0e, = \ + struct target_floppy_max_errors) #define TARGET_FDRESET TARGET_IO(2, 0x54) #define TARGET_FDRAWCMD TARGET_IO(2, 0x58) #define TARGET_FDTWADDLE TARGET_IO(2, 0x59) diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index d82d1a5..5ba7c34 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -261,6 +261,13 @@ STRUCT(blkpg_ioctl_arg, TYPE_INT, /* datalen */ TYPE_PTRVOID) /* data */ =20 +STRUCT(floppy_max_errors, + TYPE_INT, /* abort */ + TYPE_INT, /* read_track */ + TYPE_INT, /* reset */ + TYPE_INT, /* recal */ + TYPE_INT) /* reporting */ + STRUCT(format_descr, TYPE_INT, /* device */ TYPE_INT, /* head */ --=20 2.7.4 From nobody Tue Nov 11 16:00:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1564405978; cv=none; d=zoho.com; s=zohoarc; b=UtjrFQz6A2WPjnYOkapqxDPp0w+oMSjMoCjrffa1rdr9feXUD92fsBk7EusuqAZj2uoGmPprknKI88HJPe22J6X41oamP6nJ874SLAXlfC5Qt16sM4AaSoeQBB3Y2Q+22fKG31NoDwYpNn1OOonVbZ9/FLelrj2L8gMbY7zP0T4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564405978; 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:ARC-Authentication-Results; bh=voigIMwfiDaaOV6+h6XKKDN/4oViZW7Gk1LretETu4M=; b=CCkYh1Hb6HDIHs83jB/li3H7bdDeoA9clYKkzRb3Ko9VrOFKn1uFlBJ1+yMbR4FZhh5C8ijUdQF/EoBMg0+VUVBM/Z2IORVban40kQ5KRHoaAqweC6gimcTFgWi1S+ywD22KuWlwCXO2N9pxFKrv6kIEJTRoBEjspOlWYhLLfR8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1564405978992521.2276242059439; Mon, 29 Jul 2019 06:12:58 -0700 (PDT) Received: from localhost ([::1]:52054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5SU-0005xG-1g for importer@patchew.org; Mon, 29 Jul 2019 09:12:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40736) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5Ql-00036D-6h for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs5Qk-0003H7-6T for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:11 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:51389 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 1hs5Qk-0003DW-0A for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:10 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 2338F1A21DC; Mon, 29 Jul 2019 15:10:18 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 09EEC1A20A2; Mon, 29 Jul 2019 15:10:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2019 15:09:50 +0200 Message-Id: <1564405791-9147-7-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH for 4.1 v2 6/7] linux-user: Add support for RNDRESEEDCRNG ioctl 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: laurent@vivier.eu, amarkovic@wavecomp.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" From: Aleksandar Markovic RNDRESEEDCRNG is a newer ioctl (added in kernel 4.17), and an "ifdef" guard is used for that reason in this patch. Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier --- linux-user/ioctls.h | 3 +++ linux-user/syscall_defs.h | 1 + 2 files changed, 4 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 6551938..c1fcf7b 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -259,6 +259,9 @@ IOCTL(RNDADDTOENTCNT, IOC_W, MK_PTR(TYPE_INT)) IOCTL(RNDZAPENTCNT, 0, TYPE_NULL) IOCTL(RNDCLEARPOOL, 0, TYPE_NULL) +#ifdef RNDRESEEDCRNG + IOCTL(RNDRESEEDCRNG, 0, TYPE_NULL) +#endif =20 IOCTL(CDROMPAUSE, 0, TYPE_NULL) IOCTL(CDROMSTART, 0, TYPE_NULL) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 36256b0..85b732b 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -850,6 +850,7 @@ struct target_pollfd { #define TARGET_RNDADDTOENTCNT TARGET_IOW('R', 0x01, int) #define TARGET_RNDZAPENTCNT TARGET_IO('R', 0x04) #define TARGET_RNDCLEARPOOL TARGET_IO('R', 0x06) +#define TARGET_RNDRESEEDCRNG TARGET_IO('R', 0x07) =20 /* From */ =20 --=20 2.7.4 From nobody Tue Nov 11 16:00:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1564405942; cv=none; d=zoho.com; s=zohoarc; b=lPO4H1/G9w7oDDtX8N46ifhI1uJ+Iqsmx8Grsbd+fLAagbZXzxkfVGb78wZoMHFMP7COHN79knDQD2DRkUfqn/WwmOHy48awoivn3j2ZxHhZotIItB+RoSiEV9MV8bqhzt7MKxz31p2Ii5y+CyXYYYx1+y5rM49FpWawsR7KXPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564405942; 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:ARC-Authentication-Results; bh=KrL1OWm8Crc2oacE9KjnY506mBLWpQ81sx5wzBi/HY0=; b=DDeQ+f359S0xKmTNT0DMSMV9CeIhEYVOj5cRNhT5fNUrUhIiB1yX+0pAoTUP6SvcRlV1RFfltuzcvD/Hk1BWN7w963cBL6aR81ieVSVTB6lzXYySAdE865fkTs5cq+gdF+x4JK4oI7AzMP0K1TTCTlcZM/ultwOPDiVg4w9Gnt4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1564405942698633.6198886752098; Mon, 29 Jul 2019 06:12:22 -0700 (PDT) Received: from localhost ([::1]:52048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5Rt-0004mW-Om for importer@patchew.org; Mon, 29 Jul 2019 09:12:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40755) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs5Qm-0003Ac-Lr for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs5Ql-0003JZ-Dh for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:12 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:51405 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 1hs5Ql-0003HZ-7c for qemu-devel@nongnu.org; Mon, 29 Jul 2019 09:11:11 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 14D801A21DD; Mon, 29 Jul 2019 15:10:19 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id F0D531A20A2; Mon, 29 Jul 2019 15:10:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2019 15:09:51 +0200 Message-Id: <1564405791-9147-8-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1564405791-9147-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH for 4.1 v2 7/7] linux-user: Add support for semtimedop() syscall 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: Aleksandar Rikalo , laurent@vivier.eu, amarkovic@wavecomp.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" From: Aleksandar Rikalo Add support for semtimedop() emulation. It is based on invocation of safe_semtimedop(). Conversion is left out of safe_semtimedop(), since other safe_xxx() usually don't contain similar conversions. Signed-off-by: Aleksandar Rikalo Signed-off-by: Aleksandar Markovic --- linux-user/syscall.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ee80175..c7b08f5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6650,7 +6650,39 @@ static inline abi_long host_to_target_statx(struct t= arget_statx *host_stx, return 0; } #endif +#ifdef TARGET_NR_semtimedop +static inline abi_long do_semtimedop(int semid, abi_long ptr, unsigned nso= ps, + abi_long timeout) +{ + struct sembuf *sops; + struct timespec ts, *pts; + abi_long ret; + + if (timeout) { + pts =3D &ts; + if (target_to_host_timespec(pts, timeout)) { + return -TARGET_EFAULT; + } + } else { + pts =3D NULL; + } =20 + sops =3D g_malloc(sizeof(struct sembuf) * nsops); + if (sops =3D=3D NULL) { + return -TARGET_EFAULT; + } + + if (target_to_host_sembuf(sops, ptr, nsops)) { + g_free(sops); + return -TARGET_EFAULT; + } + + ret =3D get_errno(safe_semtimedop(semid, sops, nsops, pts)); + g_free(sops); + + return ret; +} +#endif =20 /* ??? Using host futex calls even when target atomic operations are not really atomic probably breaks things. However implementing @@ -9194,6 +9226,10 @@ static abi_long do_syscall1(void *cpu_env, int num, = abi_long arg1, case TARGET_NR_semop: return do_semop(arg1, arg2, arg3); #endif +#ifdef TARGET_NR_semtimedop + case TARGET_NR_semtimedop: + return do_semtimedop(arg1, arg2, arg3, arg4); +#endif #ifdef TARGET_NR_semctl case TARGET_NR_semctl: return do_semctl(arg1, arg2, arg3, arg4); --=20 2.7.4