From patchwork Fri Jan 18 21:31:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 156072 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3741994jaa; Fri, 18 Jan 2019 13:53:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN7+LH22UUQ4+CQxpFUUnOGvmMaZAi1aCe5fNWOUkr+bWU1zYdORldiBynsHEHFrPGOVlczR X-Received: by 2002:a05:6000:8a:: with SMTP id m10mr17773038wrx.79.1547848399102; Fri, 18 Jan 2019 13:53:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547848399; cv=none; d=google.com; s=arc-20160816; b=qA5X+6vasXQLaHZc8vw9TDdVW4JZIF2DOY6YX0iCnS82OKTrBWQP9yU7BxJjPTqdCm BkhL8jJSDIP9Dw4E/tEr8nIRZaEnCYex1NGgqphx+Oh2BqO9L85D7nLOXCtcvN5O4LEq CKbivP0VG18C1o+JEn0ylXxoPytzXhH1Zf8+3PQ9BOvHt9/tVIxy5YwkbLxYyb2rlvBa hlK9LBmGxpVuTzP+4rxM9XgQIUjc7us5WOMQccaL79RgCCcMofVKnk/irUgGlmRNng88 T8hcTkXBLZrSLyNZKOJSgzIuSF7gKI4ELMQ5y1ZWCEHApODYZQ6lw65goIBxwAtfKs+n C+UA== 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=3H+95VtDDX2rcLMDnBtfg92YRSY78G9AsnE1EvNA9Jo=; b=NXgnOKqLdpGQueoFqkVm6u+azBaujFJq2B9q4efbhqFEBPaz0v8+Y+VrkMrprNzvej u2G09SqkCX3DaYZPmcGvzC+tkzJEBnLusDhneBc6ym53JlB5aEsgYsgeXolHTK5BvzFk i3wCB8RqvI7mTG8MeXTL0oFWVLBIt9o2VUAk51qPENPyZ02NOb8PPFXMctxa1WpflKYZ bAh8vNJBNOZqUN7Hr1kflrbMuCr3lsTqtyWVNRkXDTlTg4P46V5n+WdgEIeUvXli9rTd wiI/rQTD8JzMw2/ODml6Gey4cl4eGcFbK/KUL7lGELvIXi6P7NORNSl+hwc/z/Ed16rE hvZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DkDiJawZ; 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 m63si28321591wmf.145.2019.01.18.13.53.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 18 Jan 2019 13:53:19 -0800 (PST) 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=DkDiJawZ; 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]:47672 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkc4j-0004V6-Uh for patch@linaro.org; Fri, 18 Jan 2019 16:53:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkbl1-0005ay-1L for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:32:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkbkz-0005Dp-5f for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:32:54 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:37788) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gkbkx-0005AG-A3 for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:32:51 -0500 Received: by mail-pf1-x442.google.com with SMTP id y126so7208025pfb.4 for ; Fri, 18 Jan 2019 13:32:50 -0800 (PST) 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=3H+95VtDDX2rcLMDnBtfg92YRSY78G9AsnE1EvNA9Jo=; b=DkDiJawZtTzP+nrgRTmxQYprrt93SIvVykrykcsufkKGNaN4JiFDhXocTMNIo6ofFL mlEWVK2iLnJlZM6O3CYN7EXpK7Xr8jOqvOP9LoZiakQU9URXXnYBrJDxJ5YLBTMEJE9V gaq46ASEjYbmuN3VZOxCk74/IFwhgW13++A+4= 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=3H+95VtDDX2rcLMDnBtfg92YRSY78G9AsnE1EvNA9Jo=; b=ocdDD63FYbWrbx33QGTfWTdnqHMyUYZfePblwQ7KTQ+bg5Qiq2dmHnCPe6QLq1O1B6 3xvuqmGNmfC/fxAz0MPpY2nIFdXqDBRoyxBLQ++F2NVrJkIh/LTr/Dx+ux24yJ+9jRqo 2L4TZ2wgdoVyLUbG8gewg2QbmRjWVbQlnMDyaM9i73cAtkFoAuGygtF+bBYWjBy+iFjB I0XRlz3gnvRLaLnndTasor6yoIMcGUG3CUNCfmqYZISxGBX8ZWEpWK846A/SCxq0rYsJ I9YSlskydyMZgGpdC7Biw1v8WPdL4TW9kMT2BcpmAeCH1EVlaZ02CNMe1Ie91w3ttvtq SJRg== X-Gm-Message-State: AJcUukcNjogQKTiQeKMwH8Jp9bpWGtrOmDuQfCwSZ8egr+b7qzb94TSt JennPDLZtXuk5RKKPrRsf33mLLEuq3M= X-Received: by 2002:a63:7044:: with SMTP id a4mr18936839pgn.359.1547847168771; Fri, 18 Jan 2019 13:32:48 -0800 (PST) Received: from cloudburst.twiddle.net ([2001:8000:10e0:a000:c673:a6b6:fdef:1933]) by smtp.gmail.com with ESMTPSA id v12sm5833667pgg.41.2019.01.18.13.32.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 13:32:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 19 Jan 2019 08:31:08 +1100 Message-Id: <20190118213122.22865-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190118213122.22865-1-richard.henderson@linaro.org> References: <20190118213122.22865-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::442 Subject: [Qemu-devel] [PATCH v6 35/49] linux-user: Split out alarm, pause 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 | 6 ++++++ linux-user/syscall-sig.inc.c | 36 ++++++++++++++++++++++++++++++++++++ linux-user/syscall.c | 12 +----------- linux-user/strace.list | 6 ------ 4 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 linux-user/syscall-sig.inc.c -- 2.17.2 diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h index 6ca82af397..9d0dd7457b 100644 --- a/linux-user/syscall-defs.h +++ b/linux-user/syscall-defs.h @@ -16,6 +16,9 @@ * along with this program; if not, see . */ +#ifdef TARGET_NR_alarm +SYSCALL_DEF(alarm, ARG_DEC); +#endif SYSCALL_DEF_FULL(brk, .impl = impl_brk, .print_ret = print_syscall_ptr_ret, .arg_type = { ARG_PTR }); @@ -106,6 +109,9 @@ SYSCALL_DEF(open, ARG_STR, ARG_OPENFLAG, ARG_MODEFLAG); #endif SYSCALL_DEF(openat, ARG_ATDIRFD, ARG_STR, ARG_OPENFLAG, ARG_MODEFLAG); SYSCALL_DEF(open_by_handle_at, ARG_DEC, ARG_PTR, ARG_OPENFLAG); +#ifdef TARGET_NR_pause +SYSCALL_DEF(pause); +#endif SYSCALL_DEF_FULL(pread64, .impl = impl_pread64, .args = args_pread64_pwrite64, .arg_type = { ARG_DEC, ARG_PTR, ARG_DEC, ARG_DEC64 }); diff --git a/linux-user/syscall-sig.inc.c b/linux-user/syscall-sig.inc.c new file mode 100644 index 0000000000..f4e43eb00e --- /dev/null +++ b/linux-user/syscall-sig.inc.c @@ -0,0 +1,36 @@ +/* + * Linux signal related syscalls + * Copyright (c) 2003 Fabrice Bellard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifdef TARGET_NR_alarm +SYSCALL_IMPL(alarm) +{ + return alarm(arg1); +} +#endif + +#ifdef TARGET_NR_pause +SYSCALL_IMPL(pause) +{ + if (!block_signals()) { + CPUState *cpu = ENV_GET_CPU(cpu_env); + TaskState *ts = cpu->opaque; + sigsuspend(&ts->signal_mask); + } + return -TARGET_EINTR; +} +#endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index c0ce4068b6..f3ea9600c8 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5327,17 +5327,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, void *p; switch(num) { -#ifdef TARGET_NR_alarm /* not on alpha */ - case TARGET_NR_alarm: - return alarm(arg1); -#endif -#ifdef TARGET_NR_pause /* not on alpha */ - case TARGET_NR_pause: - if (!block_signals()) { - sigsuspend(&((TaskState *)cpu->opaque)->signal_mask); - } - return -TARGET_EINTR; -#endif #ifdef TARGET_NR_utime case TARGET_NR_utime: { @@ -9135,6 +9124,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #include "syscall-ipc.inc.c" #include "syscall-mem.inc.c" #include "syscall-proc.inc.c" +#include "syscall-sig.inc.c" #include "syscall-time.inc.c" #undef SYSCALL_IMPL diff --git a/linux-user/strace.list b/linux-user/strace.list index a5f308c497..b119b7a20c 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -25,9 +25,6 @@ #ifdef TARGET_NR_afs_syscall { TARGET_NR_afs_syscall, "afs_syscall" , NULL, NULL, NULL }, #endif -#ifdef TARGET_NR_alarm -{ TARGET_NR_alarm, "alarm" , NULL, NULL, NULL }, -#endif #ifdef TARGET_NR_aplib { TARGET_NR_aplib, "aplib" , NULL, NULL, NULL }, #endif @@ -872,9 +869,6 @@ #ifdef TARGET_NR_osf_waitid { TARGET_NR_osf_waitid, "osf_waitid" , NULL, NULL, NULL }, #endif -#ifdef TARGET_NR_pause -{ TARGET_NR_pause, "pause" , NULL, NULL, NULL }, -#endif #ifdef TARGET_NR_pciconfig_iobase { TARGET_NR_pciconfig_iobase, "pciconfig_iobase" , NULL, NULL, NULL }, #endif