From patchwork Sun May 19 20:36:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164513 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4789648ili; Sun, 19 May 2019 13:57:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZlqT3CauB+/ppu1IhQpWRJgxTOH3wl27oZ0M2B5UnTDjAKEIV+KILlt3ko2OR5DwMB4+h X-Received: by 2002:a50:9405:: with SMTP id p5mr71417392eda.111.1558299422777; Sun, 19 May 2019 13:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558299422; cv=none; d=google.com; s=arc-20160816; b=roAA4YPLA6QK97O69rwte63w/uaUsB0TisYIg/i6JCmnYxwVeIyZZLIYLf4kR/x+VN D4zagapW5+d3EolqxAWqOYpvQKQzsEpw6SB6DOiMBLxZ1y8x0wVSN8NB2murFJVuUwkC 9N0rT/k3+QaBoLHi0GmUi62CalCdpB1zz9uNiIRwWK/87hdslw2cifsAqyAk9JZc1mdH 3njXJJc2kunddaxPcBzkheeardW+Gf4r49IDEoprkG6m01sfWRwlxnkdDLMLsixgXkVl pF38eHztOsrP9h3t5mvt6qVTissRU4CEn9BHfE+GPeJYnJUREmwgV68zvw1igvnF4zG1 BaLw== 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=O0n99AE5tNLgI5sw9XY04BuwTLwo+9pblzvHaGIq2Io=; b=jQsgaQbmtduzwUJXAPvwh9lDeSiN/PYZqb3LQ4tBH4c2NOtfreFyxZn88m+ePgQzUU LLr5XX96058uWJ3zZh38EMBZn2Xt9nagRZhQcQDpkBiGmHCAPb7DldOS3mdfXnxusi8+ KpqHHH+vrcA6uDLnz5tFN3+6x2uGzkgbEKwYhjz+hze4vsBOAe2s7TuSkcxkW+cpE8MF ESHcqd7BLWu08vEFs0fu0HfqZUcNyBCXu821XpSf0RT10SpdeZ3Up8/Uf78I2Jw2UxpW rGHdp1TdtO56eeEjT6cCeM81lxutLixl2+I71qd/H6NB11JOPorRRAQJglpGuj3BKc+q CoKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KDyaYmLe; 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 b11si11395354eda.406.2019.05.19.13.57.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 19 May 2019 13:57:02 -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=KDyaYmLe; 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]:53384 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSSrd-00022M-Ke for patch@linaro.org; Sun, 19 May 2019 16:57:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSSZP-0003Ux-Pq for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSSZO-00046X-1n for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:11 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:35574) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSSZN-00045Z-SC for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:09 -0400 Received: by mail-pl1-x642.google.com with SMTP id p1so336469plo.2 for ; Sun, 19 May 2019 13:38:09 -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=O0n99AE5tNLgI5sw9XY04BuwTLwo+9pblzvHaGIq2Io=; b=KDyaYmLeMB/Lq790sWs17F/wY9hB5NqTGzlcS7bVGZbIg9MYUjVb989BAFRRIFW/we FyYXn+8izZQ2c1QP+wPD5EuEqSRxDh5rSnU/PY6POtKptC8mcGG5oLDMXZVkJTZfMR1Q p8gTcpdONvb2iL+uttUKRnUNEF/dlc+1SJ/reitNFLIj5kYHatkF2mCh0yE1DB/yg+Xa PkLzJ+rQAqdrqpDTCPt/nYLFQ5RmmzcYJK9qp/CLXuamq2FMN+iBk+fQT/B7PZqaxlK7 T9s/DAGhjrQdRcaycjSDVv1wO1yj9xd1TMdxkvJbY8qSKTSVAaosenku+0EE0RXFRcX/ mDpA== 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=O0n99AE5tNLgI5sw9XY04BuwTLwo+9pblzvHaGIq2Io=; b=qpWZeMGg6WyGW9pK1zxejP110y9n7ig8E6Qowny99wL58dhKc9dIxYRTk1Bti6fWeh NghTvFzQ2039S+IClIYzUDN4esPuKlAu2dbTUu5uMcYABDY5f8FInMeOrirrfLFu1cUW U432Wnkgn2G0PAlNSsf4TGrSvQvQaQr3zt+qFaa4k6ru/LuhahixElQxApMAmNwU+p+u VaS63saTdqxPnB2wMcoR51BsUdywUa4xBRrCUXJoPm4GQkTLQIvKTSW1Y2yg/mXjbMrF +vkd0eC+pEsP4Tvq4uYcSkQOLwrxvOBRj5yWqBEvVjMYy7lQMARr23Blav1Rhyw0y+Uc 30Iw== X-Gm-Message-State: APjAAAWf+eZuxuYz7RF5vcdSAT7xO1qJshHTtaNbxlxn5SwKzjbAZT1D rWV1wrOnTxfemfYboCiUJR2f5s4uu18= X-Received: by 2002:a17:902:7617:: with SMTP id k23mr28206500pll.175.1558298288656; Sun, 19 May 2019 13:38:08 -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.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 May 2019 13:38:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 19 May 2019 13:36:42 -0700 Message-Id: <20190519203726.20729-31-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::642 Subject: [Qemu-devel] [PATCH v7 30/74] linux-user: Split out getpid, getppid, getxpid 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 | 9 +++++++++ linux-user/syscall-proc.inc.c | 23 +++++++++++++++++++++++ linux-user/syscall.c | 14 -------------- linux-user/strace.list | 9 --------- 4 files changed, 32 insertions(+), 23 deletions(-) -- 2.17.1 diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h index 3453e7afdf..d163bbf409 100644 --- a/linux-user/syscall-defs.h +++ b/linux-user/syscall-defs.h @@ -36,6 +36,15 @@ SYSCALL_DEF(fchmodat, ARG_ATDIRFD, ARG_STR, ARG_MODEFLAG); #ifdef TARGET_NR_fork SYSCALL_DEF(fork); #endif +#ifdef TARGET_NR_getpid +SYSCALL_DEF(getpid); +#endif +#ifdef TARGET_NR_getppid +SYSCALL_DEF(getppid); +#endif +#ifdef TARGET_NR_getxpid +SYSCALL_DEF(getxpid); +#endif #ifdef TARGET_NR_ipc SYSCALL_DEF_ARGS(ipc, ARG_HEX, ARG_DEC, ARG_DEC, ARG_HEX, ARG_PTR, ARG_HEX); #endif diff --git a/linux-user/syscall-proc.inc.c b/linux-user/syscall-proc.inc.c index fd114d1f03..4d8d385b38 100644 --- a/linux-user/syscall-proc.inc.c +++ b/linux-user/syscall-proc.inc.c @@ -438,6 +438,29 @@ SYSCALL_IMPL(fork) } #endif +#ifdef TARGET_NR_getpid +SYSCALL_IMPL(getpid) +{ + return getpid(); +} +#endif + +#ifdef TARGET_NR_getppid +SYSCALL_IMPL(getppid) +{ + return getppid(); +} +#endif + +#ifdef TARGET_NR_getxpid +SYSCALL_IMPL(getxpid) +{ + /* Alpha specific */ + cpu_env->ir[IR_A4] = getppid(); + return getpid(); +} +#endif + /* * Map host to target signal numbers for the wait family of syscalls. * Assume all other status bits are the same. diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9eff91d67e..29ea56deee 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5380,16 +5380,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, void *p; switch(num) { -#if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA) - /* Alpha specific */ - case TARGET_NR_getxpid: - ((CPUAlphaState *)cpu_env)->ir[IR_A4] = getppid(); - return get_errno(getpid()); -#endif -#ifdef TARGET_NR_getpid - case TARGET_NR_getpid: - return get_errno(getpid()); -#endif case TARGET_NR_mount: { /* need to look at the data field */ @@ -5721,10 +5711,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; } #endif -#ifdef TARGET_NR_getppid /* not on alpha */ - case TARGET_NR_getppid: - return get_errno(getppid()); -#endif #ifdef TARGET_NR_getpgrp case TARGET_NR_getpgrp: return get_errno(getpgrp()); diff --git a/linux-user/strace.list b/linux-user/strace.list index fb37c72a1f..3e898ea307 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -298,15 +298,9 @@ #ifdef TARGET_NR_getpgrp { TARGET_NR_getpgrp, "getpgrp" , NULL, NULL, NULL }, #endif -#ifdef TARGET_NR_getpid -{ TARGET_NR_getpid, "getpid" , "%s()", NULL, NULL }, -#endif #ifdef TARGET_NR_getpmsg { TARGET_NR_getpmsg, "getpmsg" , NULL, NULL, NULL }, #endif -#ifdef TARGET_NR_getppid -{ TARGET_NR_getppid, "getppid" , "%s()", NULL, NULL }, -#endif #ifdef TARGET_NR_getpriority { TARGET_NR_getpriority, "getpriority", "%s(%#x,%#x)", NULL, NULL }, #endif @@ -365,9 +359,6 @@ #ifdef TARGET_NR_getxgid { TARGET_NR_getxgid, "getxgid" , NULL, NULL, NULL }, #endif -#ifdef TARGET_NR_getxpid -{ TARGET_NR_getxpid, "getxpid" , NULL, NULL, NULL }, -#endif #ifdef TARGET_NR_getxuid { TARGET_NR_getxuid, "getxuid" , NULL, NULL, NULL }, #endif