From patchwork Sun May 19 20:37:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164551 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4810279ili; Sun, 19 May 2019 14:25:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMg/btF7Q8QnbyyoTMz0zcG9Lkk6TjorzwcuVIzC9WAJyKb2FkUy9RhTpSKyVMwHZzi83a X-Received: by 2002:a17:906:2cd1:: with SMTP id r17mr55510823ejr.101.1558301113203; Sun, 19 May 2019 14:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558301113; cv=none; d=google.com; s=arc-20160816; b=hBAF1/gYou1O2vj3MHBYbvq+ohqhHE278z68JkvfRFCimBWlEivtZb5gMijQqDi6xJ vVUfmaWPb7mR6H3RT84zKSSvLn5HSZDCvGuQbevUhJqLRwv2UpUGRK2v27FF+e+7MgaL h+YIusNoQtYWL6iHHoC6cE/O7XZ/yDNb4A8yuzfnS8FDorgEm4jUAh/aXt+fRWwD8ln4 3KCzWzaOq7/kMjzkrz2lI5Ee7u3wmId8gs45+QOdXPVH79C6b+oiqtZbOX0KLvHeRMiu V5YWZKNdhqNGBMi2ceXdlc3jawTOghLtbAHjWXm6TTcSXbRSAuYMxQj/AXvXtJt1FSlH qmkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=Y5HxahaYaY6QYC1uo4aAY7RPOmMGvLOX7tv8PUypEZk=; b=iOTh1+sUmH0Z1fPP+rGUJqbj3Kp5Dhw8YnXnCMQQbVMt5ywoQGFp3j354MW0WhYE+3 1MSA8PCBJEW8oJHORfdM13aFNscdloyMzIwySBedgrW1gw2UGJ2tOkbMPO+KPVscvLIY wr/e1CQtBw2Bt29nsJL8Ylf9XKCa3b6uh6qjRK6w3cR/EJjWGl/y2lZqOb7/mejhkYoM xtrcK+VH+ytkoe+RCigm0cmPe5GFH2TfCqOkf6jlSIh2UXY8nAJ5YH2uhTLPH+YAJ49/ zw04QbyyHGlw/NLjUzWCn7HzcLTbXIaGGvRX3Jyl/tOALmoIcFSFTkED6LCUQ8KK5R80 TmXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DoYXlx3P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w4si539619eju.53.2019.05.19.14.25.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 19 May 2019 14:25:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DoYXlx3P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:53819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSTIu-0002Ut-1D for patch@linaro.org; Sun, 19 May 2019 17:25:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSSZz-0003vo-8Y for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSSZy-0004rK-4v for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:47 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:38181) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSSZx-0004qY-V9 for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:46 -0400 Received: by mail-pg1-x541.google.com with SMTP id j26so5741184pgl.5 for ; Sun, 19 May 2019 13:38:45 -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; bh=Y5HxahaYaY6QYC1uo4aAY7RPOmMGvLOX7tv8PUypEZk=; b=DoYXlx3PoHm8K+tZgACald1wGeogE569sqfxk9pncSL5eWSgZiCOOAfBTZUTBk7KuF 05qBqU1l1+cXBY7RkbZ3GSsZgV/jWVTMILzW3HDstXMXcaRdU+sljGNESKbrz8T91oJN RqDb+1eozWltuCG0t8tjjiM8nOZO8jBVL+vqe86sCTwjkc6TorTRvlV1IVNCXzMVLuec yXZ7pM1qHmQoeTnurS3HNCXlqIuYrdcTy9zfSb81RJvh85FApQbIaCf5NYdNIY1i4zuM P3LW+i1k+52A1bOFnU/9mygqWT9fz4wMoytl5uxThSeXiuPltdpQjfAcKQFjPefsI2FM XolA== 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; bh=Y5HxahaYaY6QYC1uo4aAY7RPOmMGvLOX7tv8PUypEZk=; b=p6rTunQPXRxfQkVlcagCD/xHYB45UWkXrA2RXuAZw3/b3jDFjpFtzL95p8dzKhC59v 5Js0XH5B3r6/0V7bPZSP3KwsF4B3iNB0wS3c0KWYSSi9MxD/BzSGCK1GlqfepmvLrsfV ueuv8BN0P8dD7Q8sDSb9BkJJMFI6pfLcFnCzP5aC77uNRUqTGA4SPMzMrIe7NmdWvMbG yZ/S2jEodZVctvQXDatqfoIXNmD8rfXqmBUiv6CM/jATvsg5lfQUE0c9SB4YzJoowRbU kIdfBgJwkRgB54Nb518NCuhYyOiVxe6Fp3A+AuDOGn65L+O1eKaDv3L15SYGR7MvOhfQ 8TBQ== X-Gm-Message-State: APjAAAX9qBBYQARh0cPUnmASYtpG76OcTg/VL+3NYkjsRqYcNlZ7oab6 P1uizuKFwQ7CZoMNpWE7dODbHap+LZE= X-Received: by 2002:a62:117:: with SMTP id 23mr47169063pfb.156.1558298324723; Sun, 19 May 2019 13:38:44 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id i7sm11397448pfo.19.2019.05.19.13.38.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 May 2019 13:38:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 19 May 2019 13:37:13 -0700 Message-Id: <20190519203726.20729-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190519203726.20729-1-richard.henderson@linaro.org> References: <20190519203726.20729-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::541 Subject: [Qemu-devel] [PATCH v7 61/74] linux-user: Split out rt_sigtimedwait 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: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- linux-user/syscall-defs.h | 1 + linux-user/syscall-sig.inc.c | 37 ++++++++++++++++++++++++++++++++++++ linux-user/syscall.c | 36 ----------------------------------- linux-user/strace.list | 3 --- 4 files changed, 38 insertions(+), 39 deletions(-) -- 2.17.1 diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h index 2b930f5599..24289ed413 100644 --- a/linux-user/syscall-defs.h +++ b/linux-user/syscall-defs.h @@ -197,6 +197,7 @@ SYSCALL_DEF(rt_sigaction, ARG_SIGNAL, ARG_PTR, ARG_PTR, ARG_DEC); SYSCALL_DEF(rt_sigpending, ARG_PTR, ARG_DEC); SYSCALL_DEF(rt_sigprocmask, ARG_SIGPROCMASKHOW, ARG_PTR, ARG_PTR, ARG_DEC); SYSCALL_DEF(rt_sigsuspend, ARG_PTR, ARG_DEC); +SYSCALL_DEF(rt_sigtimedwait, ARG_PTR, ARG_PTR, ARG_PTR, ARG_DEC); #if !defined(SYSCALL_TABLE) || defined(TARGET_NR_semctl) SYSCALL_DEF(semctl, ARG_DEC, ARG_DEC, ARG_DEC, ARG_HEX); #endif diff --git a/linux-user/syscall-sig.inc.c b/linux-user/syscall-sig.inc.c index 23ea14e2a6..5f2c0ba499 100644 --- a/linux-user/syscall-sig.inc.c +++ b/linux-user/syscall-sig.inc.c @@ -215,6 +215,43 @@ SYSCALL_IMPL(rt_sigsuspend) return ret; } +SYSCALL_IMPL(rt_sigtimedwait) +{ + sigset_t set; + struct timespec uts, *puts = NULL; + siginfo_t uinfo; + abi_long ret; + void *p; + + if (arg4 != sizeof(target_sigset_t)) { + return -TARGET_EINVAL; + } + p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1); + if (!p) { + return -TARGET_EFAULT; + } + target_to_host_sigset(&set, p); + unlock_user(p, arg1, 0); + if (arg3) { + puts = &uts; + target_to_host_timespec(puts, arg3); + } + + ret = get_errno(safe_rt_sigtimedwait(&set, &uinfo, puts, SIGSET_T_SIZE)); + if (!is_error(ret)) { + if (arg2) { + p = lock_user(VERIFY_WRITE, arg2, sizeof(target_siginfo_t), 0); + if (!p) { + return -TARGET_EFAULT; + } + host_to_target_siginfo(p, &uinfo); + unlock_user(p, arg2, sizeof(target_siginfo_t)); + } + ret = host_to_target_signal(ret); + } + return ret; +} + #ifdef TARGET_NR_sigaction SYSCALL_IMPL(sigaction) { diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 00f4ba8753..8a05d3e32a 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4240,42 +4240,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, void *p; switch(num) { - case TARGET_NR_rt_sigtimedwait: - { - sigset_t set; - struct timespec uts, *puts; - siginfo_t uinfo; - - if (arg4 != sizeof(target_sigset_t)) { - return -TARGET_EINVAL; - } - - if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1))) - return -TARGET_EFAULT; - target_to_host_sigset(&set, p); - unlock_user(p, arg1, 0); - if (arg3) { - puts = &uts; - target_to_host_timespec(puts, arg3); - } else { - puts = NULL; - } - ret = get_errno(safe_rt_sigtimedwait(&set, &uinfo, puts, - SIGSET_T_SIZE)); - if (!is_error(ret)) { - if (arg2) { - p = lock_user(VERIFY_WRITE, arg2, sizeof(target_siginfo_t), - 0); - if (!p) { - return -TARGET_EFAULT; - } - host_to_target_siginfo(p, &uinfo); - unlock_user(p, arg2, sizeof(target_siginfo_t)); - } - ret = host_to_target_signal(ret); - } - } - return ret; case TARGET_NR_rt_sigqueueinfo: { siginfo_t uinfo; diff --git a/linux-user/strace.list b/linux-user/strace.list index 26df8b25cd..0b2c057673 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -932,9 +932,6 @@ #ifdef TARGET_NR_rt_sigreturn { TARGET_NR_rt_sigreturn, "rt_sigreturn" , NULL, NULL, NULL }, #endif -#ifdef TARGET_NR_rt_sigtimedwait -{ TARGET_NR_rt_sigtimedwait, "rt_sigtimedwait" , NULL, NULL, NULL }, -#endif #ifdef TARGET_NR_rt_tgsigqueueinfo { TARGET_NR_rt_tgsigqueueinfo, "rt_tgsigqueueinfo" , NULL, print_rt_tgsigqueueinfo, NULL }, #endif