From patchwork Tue Feb 9 11:38:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 8260541 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CB1B0BEEE5 for ; Tue, 9 Feb 2016 11:50:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 221BB20114 for ; Tue, 9 Feb 2016 11:50:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA2542025A for ; Tue, 9 Feb 2016 11:50:43 +0000 (UTC) Received: from localhost ([::1]:54689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT6od-0005BB-76 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Feb 2016 06:50:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT6cc-000850-SA for qemu-devel@nongnu.org; Tue, 09 Feb 2016 06:38:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aT6ca-00035f-Dq for qemu-devel@nongnu.org; Tue, 09 Feb 2016 06:38:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT6ca-00035S-7W for qemu-devel@nongnu.org; Tue, 09 Feb 2016 06:38:16 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id D8C58C0A9CC8; Tue, 9 Feb 2016 11:38:15 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u19BcA3w006275 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 9 Feb 2016 06:38:14 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F35343006AF5; Tue, 9 Feb 2016 12:38:04 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 9 Feb 2016 12:38:02 +0100 Message-Id: <1455017883-25867-31-git-send-email-armbru@redhat.com> In-Reply-To: <1455017883-25867-1-git-send-email-armbru@redhat.com> References: <1455017883-25867-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , James Hogan Subject: [Qemu-devel] [PULL 30/31] qapi: Fix compilation failure on MIPS and SPARC X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Blake Commit 86f4b687 broke compilation on MIPS and SPARC, which have a preprocessor pollution of '#define mips 1' and '#define sparc 1', respectively. Treat it the same way as we do for the pollution with 'unix', so that QMP remains backwards compatible and only the C code needs to use the alternative 'q_mips', 'q_sparc' spelling. CC: James Hogan CC: Peter Maydell Signed-off-by: Eric Blake Tested-by: James Hogan Signed-off-by: Markus Armbruster --- cpus.c | 10 +++++----- hmp.c | 8 +++++--- scripts/qapi.py | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cpus.c b/cpus.c index 882b618..898426c 100644 --- a/cpus.c +++ b/cpus.c @@ -1576,13 +1576,13 @@ CpuInfoList *qmp_query_cpus(Error **errp) info->value->u.ppc->nip = env->nip; #elif defined(TARGET_SPARC) info->value->arch = CPU_INFO_ARCH_SPARC; - info->value->u.sparc = g_new0(CpuInfoSPARC, 1); - info->value->u.sparc->pc = env->pc; - info->value->u.sparc->npc = env->npc; + info->value->u.q_sparc = g_new0(CpuInfoSPARC, 1); + info->value->u.q_sparc->pc = env->pc; + info->value->u.q_sparc->npc = env->npc; #elif defined(TARGET_MIPS) info->value->arch = CPU_INFO_ARCH_MIPS; - info->value->u.mips = g_new0(CpuInfoMIPS, 1); - info->value->u.mips->PC = env->active_tc.PC; + info->value->u.q_mips = g_new0(CpuInfoMIPS, 1); + info->value->u.q_mips->PC = env->active_tc.PC; #elif defined(TARGET_TRICORE) info->value->arch = CPU_INFO_ARCH_TRICORE; info->value->u.tricore = g_new0(CpuInfoTricore, 1); diff --git a/hmp.c b/hmp.c index 3e2a989..c6419da 100644 --- a/hmp.c +++ b/hmp.c @@ -319,11 +319,13 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict) monitor_printf(mon, " nip=0x%016" PRIx64, cpu->value->u.ppc->nip); break; case CPU_INFO_ARCH_SPARC: - monitor_printf(mon, " pc=0x%016" PRIx64, cpu->value->u.sparc->pc); - monitor_printf(mon, " npc=0x%016" PRIx64, cpu->value->u.sparc->npc); + monitor_printf(mon, " pc=0x%016" PRIx64, + cpu->value->u.q_sparc->pc); + monitor_printf(mon, " npc=0x%016" PRIx64, + cpu->value->u.q_sparc->npc); break; case CPU_INFO_ARCH_MIPS: - monitor_printf(mon, " PC=0x%016" PRIx64, cpu->value->u.mips->PC); + monitor_printf(mon, " PC=0x%016" PRIx64, cpu->value->u.q_mips->PC); break; case CPU_INFO_ARCH_TRICORE: monitor_printf(mon, " PC=0x%016" PRIx64, cpu->value->u.tricore->PC); diff --git a/scripts/qapi.py b/scripts/qapi.py index 7519cf8..f40dc9e 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -1482,7 +1482,7 @@ def c_name(name, protect=True): 'and', 'and_eq', 'bitand', 'bitor', 'compl', 'not', 'not_eq', 'or', 'or_eq', 'xor', 'xor_eq']) # namespace pollution: - polluted_words = set(['unix', 'errno']) + polluted_words = set(['unix', 'errno', 'mips', 'sparc']) name = name.translate(c_name_trans) if protect and (name in c89_words | c99_words | c11_words | gcc_words | cpp_words | polluted_words):