From patchwork Sun May 19 20:36:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164526 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4797112ili; Sun, 19 May 2019 14:06:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqw33Ul7EpZ8z0DePdrfQRzxIsBpe0sYyEebdZKYiF5DJIDusS57fWx4G+9aSViAcr6QC6sP X-Received: by 2002:a17:906:1b57:: with SMTP id p23mr40819256ejg.24.1558299994248; Sun, 19 May 2019 14:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558299994; cv=none; d=google.com; s=arc-20160816; b=p1bpHO1dn0Ln2HJ+zi7Yc6SGKLseDyao4i+mXDDuENTFdiBmpkWLCanS5eYA5FB8So 4CbB7frpQufgntd2E90HPm2m6YKlxxa8QecK5q89NH6MBWF5CZPA7QLvehvIJxrPwKt8 pxW+HuXG8zgaZnMvpjO7mdRePPUY8QcGcPWPv01tg7jZkbTYEw8NX6bws8E9ra4hSPAW 5lisYgoS6Zs/GQTt+l1PzROptadPbMeciqXG6PnGMVvIwU++D2dEPSKqA2Om8zcECoyC lhgGqs+fxSex6459wt82/7qHoBx5JpvXIsIz5PzHQ8A4MP7tyHQcgZBDnZ4dVR6Fl4tV Tu3A== 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=zGbVnBZ7x7Ulj+gsvlvNaeMFujeF8l5vm6cHIrbAA7c=; b=OQtSvXGCsiaD8uQGPFWt356YXD+QJGMrtgXY0ED3EiQXMMLZfwp0G5svc5Zkd+Bsb+ 19VymCoouqN+d2YCT3ntQlb7DzRbzp/yxOa56FMznZr81fVOxihd8Upz9UwsIETcCa3J 9Rx1N0PF0VeGC8PdfyMSQpTZjOlHTh3OrMfoTcaRe6034PnehmKmnI3Wmc9IPvPh/O5/ wfwykPaj6OQ/nJcRUHLZGfSrhRrOcRByxcrYc2J2SYj20v5Kd6lVbWsv2UpkE5hGPB1c aUQhTuI6T1DSXnoDqqMzmCGYdlmJBfWFL6i50tbgLrHflSMKaP1RU/EAFzsDXbrZESg+ l22A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=u4vBdPKi; 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 m35si1157015edd.142.2019.05.19.14.06.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 19 May 2019 14:06:34 -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=u4vBdPKi; 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]:53532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hST0r-0001wa-1x for patch@linaro.org; Sun, 19 May 2019 17:06:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSSZb-0003b4-33 for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSSZX-0004I8-9k for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:21 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:34960) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSSZT-0004BC-Ho for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:17 -0400 Received: by mail-pf1-x441.google.com with SMTP id t87so6175238pfa.2 for ; Sun, 19 May 2019 13:38:14 -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=zGbVnBZ7x7Ulj+gsvlvNaeMFujeF8l5vm6cHIrbAA7c=; b=u4vBdPKixyBIqFlT8YlHC5VIlOngyb5q7cjyC+o8gfIuqzEG8w2crdWj/NDd3DRc+M 6ng+lrb0c1+8G+UaVeWUjmF85CB2VEF33yuSUKX17+VOaPEC0c6hThwZF9Qk2b7Bs7bn eVXY9iBg3685j6UGcpSU/KzYQweyjjdW4DP9J8hXhxyuJyTuFueMvUgt6zt1mNHg01Eo 08EQgG4nO/6hqBZP/AOvV4cUfCC4Ar3b6w6KAOyFxOQ3Coj7KjrXUa1v7pPPbFAuMcvE 7Vsx/dRxl9RMs3bSutzkMN8fFWWPYHjVjNjXhim7DwgfLeAPm/TIPUPlHUeK6mrrMDHV MJFw== 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=zGbVnBZ7x7Ulj+gsvlvNaeMFujeF8l5vm6cHIrbAA7c=; b=GXwdLJ7tmH9UUdim/9sB0PNv8DJe6oeYHeOxo9a30zF2i0YkGIF+8qy/CXa1Ky7OdK zKbk+gwrmw3SeavcnjYS3wGTIshZLeZGFd7pHoPJ5pauTOJLMNCU7cx1498Ih036PJsT yB7E70VyDNsKIWYCb/5iLA1vh2zCftNV/i0KKU7UeOeuwXym4AK1G7IPBDiYIQdxSPZw yNVBhboUu87NjToSioGrAAbS2ShMQG9JMVXUYHrjWET8jSnxOKTfjzgYig42RZNcD+R6 BvE9kzElIrxJHBOJjO3AUqt7uPQo4xlAXD70PyfYt/wXrnyMgtBjHQknSuYmTCqWqLp+ TDFA== X-Gm-Message-State: APjAAAU3tU/RJMSgs7m1bCBFKgW6xvwP+2FGjG6amX09F56c92y4ct7d Hq/UXPaCOag36r+4yyzUkWlf0Hy3F7I= X-Received: by 2002:a63:6ac1:: with SMTP id f184mr72583935pgc.25.1558298293401; Sun, 19 May 2019 13:38:13 -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.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 May 2019 13:38:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 19 May 2019 13:36:46 -0700 Message-Id: <20190519203726.20729-35-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::441 Subject: [Qemu-devel] [PATCH v7 34/74] 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.1 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 ae56ecbbc7..96e77ea38f 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5380,17 +5380,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: { @@ -9224,6 +9213,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 d0646b9424..2a65457c76 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