From patchwork Wed May 31 13:08:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9757001 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 46A23602F0 for ; Wed, 31 May 2017 13:12:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42ECD281F9 for ; Wed, 31 May 2017 13:12:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37D792836F; Wed, 31 May 2017 13:12:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4A7D62834A for ; Wed, 31 May 2017 13:12:22 +0000 (UTC) Received: from localhost ([::1]:59335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG3QD-0001CK-6V for patchwork-qemu-devel@patchwork.kernel.org; Wed, 31 May 2017 09:12:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG3Mp-0007eU-4Z for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dG3Mo-0003fj-20 for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:51 -0400 Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]:36000) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dG3Mn-0003fb-Qp for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:49 -0400 Received: by mail-lf0-x22e.google.com with SMTP id h4so8619342lfj.3 for ; Wed, 31 May 2017 06:08:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Un363IfAX6y9hiVbXegmwIPScrZmfJR7QE/OxkIGBIg=; b=fPTf0BSViFqtliHCibpEJLgx27ZLwl8OrNZVvu19NtRwXYWwxbh0lSMn+c93O1XjqK yYzzddL4HWJkmYJewswaLFp0s1QETTy9y9w5jbzL21GqDsVcMAciGnA5suGq5ok5Ooe4 /OdvIszr7qTo0uE4lGyPb7KIyve+XRF2dzJqU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Un363IfAX6y9hiVbXegmwIPScrZmfJR7QE/OxkIGBIg=; b=Pt3rKbzxTT+SK2Z1hxJalSZGvKr6BuJL/1ubi18KeJz/XdypuOzf/IZjQObVxCy9H4 3Z/P+IzvfcWAQk4bb3nE3gYaBbEm7FvaT+7P3bEkSbrkZoog7BMXIoATAcRsaWg51p6r vng2xf3Ec5G7odVOC/rnkzkMg/k512alsHISLqW8P2LaDY4iokcXAynv627+TqRJ5/5A YyXVpgV4o382YhccRE0Vz6E7hbeJo+XgXBSHuIEiHspdUg8dI9jWFC+uwDeVcQtK02zI +z990gQSTS1c1YAVON6rq0W2mkzBaomQ6M1ghb4H90tNVRh3K42XC4TTGU48pNw2dRiP ir2A== X-Gm-Message-State: AODbwcBEqzT50Sbern5QlNMJjrbp67l+nyo2IK2Z75SJhfXnee98sX+b PlxWpk9Vkj4S/TT1UIKW8A== X-Received: by 10.25.196.207 with SMTP id u198mr7600383lff.20.1496236128299; Wed, 31 May 2017 06:08:48 -0700 (PDT) Received: from localhost.localdomain (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id o101sm3741766lfg.3.2017.05.31.06.08.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2017 06:08:47 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 31 May 2017 16:08:24 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::22e Subject: [Qemu-devel] [PULL 12/15] linux-user: add support for rt_tgsigqueueinfo() system call X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Milo=C5=A1=20Stojanovi=C4=87?= , stefanha@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Miloš Stojanović Add a new system call: rt_tgsigqueueinfo(). This system call is similar to rt_sigqueueinfo(), but instead of sending the signal and data to the whole thread group with the ID equal to the argument tgid, it sends it to a single thread within that thread group. The ID of the thread is specified by the tid argument. The implementation is based on the rt_sigqueueinfo() in linux-user mode, where the tid is added as the second argument and the previous second and third argument become arguments three and four, respectively. Signed-off-by: Miloš Stojanović Conflicts: linux-user/syscall.c Signed-off-by: Riku Voipio --- linux-user/syscall.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 3373853bb9..925ae11ea6 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -238,6 +238,7 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ #define __NR_sys_getdents64 __NR_getdents64 #define __NR_sys_getpriority __NR_getpriority #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo +#define __NR_sys_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo #define __NR_sys_syslog __NR_syslog #define __NR_sys_futex __NR_futex #define __NR_sys_inotify_init __NR_inotify_init @@ -275,6 +276,8 @@ _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo, loff_t *, res, uint, wh); #endif _syscall3(int, sys_rt_sigqueueinfo, pid_t, pid, int, sig, siginfo_t *, uinfo) +_syscall4(int, sys_rt_tgsigqueueinfo, pid_t, pid, pid_t, tid, int, sig, + siginfo_t *, uinfo) _syscall3(int,sys_syslog,int,type,char*,bufp,int,len) #ifdef __NR_exit_group _syscall1(int,exit_group,int,error_code) @@ -8872,6 +8875,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ret = get_errno(sys_rt_sigqueueinfo(arg1, arg2, &uinfo)); } break; + case TARGET_NR_rt_tgsigqueueinfo: + { + siginfo_t uinfo; + + p = lock_user(VERIFY_READ, arg4, sizeof(target_siginfo_t), 1); + if (!p) { + goto efault; + } + target_to_host_siginfo(&uinfo, p); + unlock_user(p, arg4, 0); + ret = get_errno(sys_rt_tgsigqueueinfo(arg1, arg2, arg3, &uinfo)); + } + break; #ifdef TARGET_NR_sigreturn case TARGET_NR_sigreturn: if (block_signals()) {