From patchwork Tue Feb 6 19:14:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 127088 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3220880ljc; Tue, 6 Feb 2018 11:42:14 -0800 (PST) X-Google-Smtp-Source: AH8x227K9QPXwTZG8KxF21FkXJjAibClXTO9KpOiSAJGbTjlcgy/ZJVvQjerS0nl4FXmwFgicXT1 X-Received: by 10.37.49.214 with SMTP id x205mr2276639ybx.402.1517946134430; Tue, 06 Feb 2018 11:42:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517946134; cv=none; d=google.com; s=arc-20160816; b=F1+NYY5GfCNQOjrSYVFf3Do6rjvg7Ch88Z5DJGz1uZkGDwmzUa5fLV8lOjtxTU7UUT XgEdruwZhLOkD+GqVxNaW8F1sV/nKeZkEBUz/A3blQSmoJ1oistdZMm+xK8vgZEsPEbA 5pHfLnEGvo2PjjG5JUnFnY7RrTg2P9FzRtJr++8OFwcrBlbyfoI8N6DUhhSgs6on+ExO Rs2NxPil4w/uFstGsHJEXW9ZA+qCqiGQGwifKBVrDSFcZdtmIsNamI0dlVVGYckErkBS BESywXKZZ14juXnTpPpYlcOLOm1VLFYmlc9joHdTH+n4SRLC9UHG/QXdlTSsUULg2ZQy FBXg== 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:message-id:references :in-reply-to:date:to:from:arc-authentication-results; bh=l6hdOuZnnJignk20Fq9yaGDKjwQHmhfg/r33Q+SDwt8=; b=mYXlHZsRhoYPWF2+AeNhFEOZVSFTtm+APkVTExUkIHn0wLizwHNiGZe6Qc6JZgD5UZ ZTqYk8Rq4BtgHgQqFkqJ44MsUp8sZ7TgsEPVVXiwqFUgpNJn3jGfW4ugXXTN70WXUjEq +Q2SgIelHD1W/pOpbsfCQUGkQDEn1vWTHAZrlU10bGCBSb982p6KxhY+C8xh1QU1vLVj N6qldM9mmarEcmh9yxhqhN57TbqikvFW+BDYYXqI+4KrNDBDMWU14bS6aRhYshqhlSJN Sxv1e+tkwU2AUiA/pG8Sfqf4ZNWUn7qTw8C37RekLOanRzh2D9qYzb9g3c+JlKB4bKh6 UMQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a80si28488ywe.604.2018.02.06.11.42.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 06 Feb 2018 11:42:14 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([::1]:53507 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej989-0002Lx-N9 for patch@linaro.org; Tue, 06 Feb 2018 14:42:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej8ip-0005N2-8l for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:16:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej8im-00082p-3l for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:16:03 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45810 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej8il-000826-VO for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:16:00 -0500 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w16JEJTh078803 for ; Tue, 6 Feb 2018 14:15:59 -0500 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fyj9209pt-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 06 Feb 2018 14:15:58 -0500 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Feb 2018 14:15:57 -0500 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 6 Feb 2018 14:15:56 -0500 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w16JFtA448693330; Tue, 6 Feb 2018 19:15:55 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 77DB0AC041; Tue, 6 Feb 2018 14:17:16 -0500 (EST) Received: from localhost (unknown [9.80.97.150]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 3D22EAC03A; Tue, 6 Feb 2018 14:17:16 -0500 (EST) From: Michael Roth To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 13:14:56 -0600 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180206191515.25830-1-mdroth@linux.vnet.ibm.com> References: <20180206191515.25830-1-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18020619-0048-0000-0000-000002332F4B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008485; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000248; SDB=6.00985885; UDB=6.00500282; IPR=6.00765252; BA=6.00005813; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019407; XFM=3.00000015; UTC=2018-02-06 19:15:57 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18020619-0049-0000-0000-00004409E779 Message-Id: <20180206191515.25830-36-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-06_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802060241 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 35/54] linux-user/signal.c: Rename MC_* defines 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 , qemu-stable@nongnu.org, christian.ehrhardt@canonical.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The SPARC code in linux-user/signal.c defines a set of MC_* constants. On some SPARC hosts these are also defined by sys/ucontext.h, resulting in build failures: linux-user/signal.c:2786:0: error: "MC_NGREG" redefined [-Werror] #define MC_NGREG 19 In file included from /usr/include/signal.h:302:0, from include/qemu/osdep.h:86, from linux-user/signal.c:19: /usr/include/sparc64-linux-gnu/sys/ucontext.h:59:0: note: this is the location of the previous definition # define MC_NGREG __MC_NGREG Rename all these constants to SPARC_MC_* to avoid the clash. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell Message-id: 1517318239-15764-1-git-send-email-peter.maydell@linaro.org (cherry picked from commit 8ebb314b957403c1c9a3f1cf995f73c6ae9d5d10) Signed-off-by: Michael Roth --- linux-user/signal.c | 118 ++++++++++++++++++++++++++-------------------------- 1 file changed, 59 insertions(+), 59 deletions(-) -- 2.11.0 diff --git a/linux-user/signal.c b/linux-user/signal.c index cf35473671..b858f1b0f1 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -2758,29 +2758,29 @@ long do_rt_sigreturn(CPUSPARCState *env) } #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) -#define MC_TSTATE 0 -#define MC_PC 1 -#define MC_NPC 2 -#define MC_Y 3 -#define MC_G1 4 -#define MC_G2 5 -#define MC_G3 6 -#define MC_G4 7 -#define MC_G5 8 -#define MC_G6 9 -#define MC_G7 10 -#define MC_O0 11 -#define MC_O1 12 -#define MC_O2 13 -#define MC_O3 14 -#define MC_O4 15 -#define MC_O5 16 -#define MC_O6 17 -#define MC_O7 18 -#define MC_NGREG 19 +#define SPARC_MC_TSTATE 0 +#define SPARC_MC_PC 1 +#define SPARC_MC_NPC 2 +#define SPARC_MC_Y 3 +#define SPARC_MC_G1 4 +#define SPARC_MC_G2 5 +#define SPARC_MC_G3 6 +#define SPARC_MC_G4 7 +#define SPARC_MC_G5 8 +#define SPARC_MC_G6 9 +#define SPARC_MC_G7 10 +#define SPARC_MC_O0 11 +#define SPARC_MC_O1 12 +#define SPARC_MC_O2 13 +#define SPARC_MC_O3 14 +#define SPARC_MC_O4 15 +#define SPARC_MC_O5 16 +#define SPARC_MC_O6 17 +#define SPARC_MC_O7 18 +#define SPARC_MC_NGREG 19 typedef abi_ulong target_mc_greg_t; -typedef target_mc_greg_t target_mc_gregset_t[MC_NGREG]; +typedef target_mc_greg_t target_mc_gregset_t[SPARC_MC_NGREG]; struct target_mc_fq { abi_ulong *mcfq_addr; @@ -2840,8 +2840,8 @@ void sparc64_set_context(CPUSPARCState *env) goto do_sigsegv; } grp = &ucp->tuc_mcontext.mc_gregs; - __get_user(pc, &((*grp)[MC_PC])); - __get_user(npc, &((*grp)[MC_NPC])); + __get_user(pc, &((*grp)[SPARC_MC_PC])); + __get_user(npc, &((*grp)[SPARC_MC_NPC])); if ((pc | npc) & 3) { goto do_sigsegv; } @@ -2864,26 +2864,26 @@ void sparc64_set_context(CPUSPARCState *env) } env->pc = pc; env->npc = npc; - __get_user(env->y, &((*grp)[MC_Y])); - __get_user(tstate, &((*grp)[MC_TSTATE])); + __get_user(env->y, &((*grp)[SPARC_MC_Y])); + __get_user(tstate, &((*grp)[SPARC_MC_TSTATE])); env->asi = (tstate >> 24) & 0xff; cpu_put_ccr(env, tstate >> 32); cpu_put_cwp64(env, tstate & 0x1f); - __get_user(env->gregs[1], (&(*grp)[MC_G1])); - __get_user(env->gregs[2], (&(*grp)[MC_G2])); - __get_user(env->gregs[3], (&(*grp)[MC_G3])); - __get_user(env->gregs[4], (&(*grp)[MC_G4])); - __get_user(env->gregs[5], (&(*grp)[MC_G5])); - __get_user(env->gregs[6], (&(*grp)[MC_G6])); - __get_user(env->gregs[7], (&(*grp)[MC_G7])); - __get_user(env->regwptr[UREG_I0], (&(*grp)[MC_O0])); - __get_user(env->regwptr[UREG_I1], (&(*grp)[MC_O1])); - __get_user(env->regwptr[UREG_I2], (&(*grp)[MC_O2])); - __get_user(env->regwptr[UREG_I3], (&(*grp)[MC_O3])); - __get_user(env->regwptr[UREG_I4], (&(*grp)[MC_O4])); - __get_user(env->regwptr[UREG_I5], (&(*grp)[MC_O5])); - __get_user(env->regwptr[UREG_I6], (&(*grp)[MC_O6])); - __get_user(env->regwptr[UREG_I7], (&(*grp)[MC_O7])); + __get_user(env->gregs[1], (&(*grp)[SPARC_MC_G1])); + __get_user(env->gregs[2], (&(*grp)[SPARC_MC_G2])); + __get_user(env->gregs[3], (&(*grp)[SPARC_MC_G3])); + __get_user(env->gregs[4], (&(*grp)[SPARC_MC_G4])); + __get_user(env->gregs[5], (&(*grp)[SPARC_MC_G5])); + __get_user(env->gregs[6], (&(*grp)[SPARC_MC_G6])); + __get_user(env->gregs[7], (&(*grp)[SPARC_MC_G7])); + __get_user(env->regwptr[UREG_I0], (&(*grp)[SPARC_MC_O0])); + __get_user(env->regwptr[UREG_I1], (&(*grp)[SPARC_MC_O1])); + __get_user(env->regwptr[UREG_I2], (&(*grp)[SPARC_MC_O2])); + __get_user(env->regwptr[UREG_I3], (&(*grp)[SPARC_MC_O3])); + __get_user(env->regwptr[UREG_I4], (&(*grp)[SPARC_MC_O4])); + __get_user(env->regwptr[UREG_I5], (&(*grp)[SPARC_MC_O5])); + __get_user(env->regwptr[UREG_I6], (&(*grp)[SPARC_MC_O6])); + __get_user(env->regwptr[UREG_I7], (&(*grp)[SPARC_MC_O7])); __get_user(fp, &(ucp->tuc_mcontext.mc_fp)); __get_user(i7, &(ucp->tuc_mcontext.mc_i7)); @@ -2971,25 +2971,25 @@ void sparc64_get_context(CPUSPARCState *env) } /* XXX: tstate must be saved properly */ - // __put_user(env->tstate, &((*grp)[MC_TSTATE])); - __put_user(env->pc, &((*grp)[MC_PC])); - __put_user(env->npc, &((*grp)[MC_NPC])); - __put_user(env->y, &((*grp)[MC_Y])); - __put_user(env->gregs[1], &((*grp)[MC_G1])); - __put_user(env->gregs[2], &((*grp)[MC_G2])); - __put_user(env->gregs[3], &((*grp)[MC_G3])); - __put_user(env->gregs[4], &((*grp)[MC_G4])); - __put_user(env->gregs[5], &((*grp)[MC_G5])); - __put_user(env->gregs[6], &((*grp)[MC_G6])); - __put_user(env->gregs[7], &((*grp)[MC_G7])); - __put_user(env->regwptr[UREG_I0], &((*grp)[MC_O0])); - __put_user(env->regwptr[UREG_I1], &((*grp)[MC_O1])); - __put_user(env->regwptr[UREG_I2], &((*grp)[MC_O2])); - __put_user(env->regwptr[UREG_I3], &((*grp)[MC_O3])); - __put_user(env->regwptr[UREG_I4], &((*grp)[MC_O4])); - __put_user(env->regwptr[UREG_I5], &((*grp)[MC_O5])); - __put_user(env->regwptr[UREG_I6], &((*grp)[MC_O6])); - __put_user(env->regwptr[UREG_I7], &((*grp)[MC_O7])); + // __put_user(env->tstate, &((*grp)[SPARC_MC_TSTATE])); + __put_user(env->pc, &((*grp)[SPARC_MC_PC])); + __put_user(env->npc, &((*grp)[SPARC_MC_NPC])); + __put_user(env->y, &((*grp)[SPARC_MC_Y])); + __put_user(env->gregs[1], &((*grp)[SPARC_MC_G1])); + __put_user(env->gregs[2], &((*grp)[SPARC_MC_G2])); + __put_user(env->gregs[3], &((*grp)[SPARC_MC_G3])); + __put_user(env->gregs[4], &((*grp)[SPARC_MC_G4])); + __put_user(env->gregs[5], &((*grp)[SPARC_MC_G5])); + __put_user(env->gregs[6], &((*grp)[SPARC_MC_G6])); + __put_user(env->gregs[7], &((*grp)[SPARC_MC_G7])); + __put_user(env->regwptr[UREG_I0], &((*grp)[SPARC_MC_O0])); + __put_user(env->regwptr[UREG_I1], &((*grp)[SPARC_MC_O1])); + __put_user(env->regwptr[UREG_I2], &((*grp)[SPARC_MC_O2])); + __put_user(env->regwptr[UREG_I3], &((*grp)[SPARC_MC_O3])); + __put_user(env->regwptr[UREG_I4], &((*grp)[SPARC_MC_O4])); + __put_user(env->regwptr[UREG_I5], &((*grp)[SPARC_MC_O5])); + __put_user(env->regwptr[UREG_I6], &((*grp)[SPARC_MC_O6])); + __put_user(env->regwptr[UREG_I7], &((*grp)[SPARC_MC_O7])); w_addr = TARGET_STACK_BIAS+env->regwptr[UREG_I6]; fp = i7 = 0;