From patchwork Tue Feb 2 14:51:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 8191321 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 54ECE9FBE9 for ; Tue, 2 Feb 2016 14:52:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A421220306 for ; Tue, 2 Feb 2016 14:52:04 +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 CD1A0202F2 for ; Tue, 2 Feb 2016 14:52:03 +0000 (UTC) Received: from localhost ([::1]:57574 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQcJH-0005wN-AA for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Feb 2016 09:52:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQcJ7-0005wC-11 for qemu-devel@nongnu.org; Tue, 02 Feb 2016 09:51:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQcJ2-0004XO-TA for qemu-devel@nongnu.org; Tue, 02 Feb 2016 09:51:52 -0500 Received: from resqmta-po-07v.sys.comcast.net ([96.114.154.166]:39024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQcJ2-0004X8-Nd for qemu-devel@nongnu.org; Tue, 02 Feb 2016 09:51:48 -0500 Received: from resomta-po-18v.sys.comcast.net ([96.114.154.242]) by resqmta-po-07v.sys.comcast.net with comcast id DSqQ1s0025E3ZMc01SrmEA; Tue, 02 Feb 2016 14:51:46 +0000 Received: from red.redhat.com ([24.10.254.122]) by resomta-po-18v.sys.comcast.net with comcast id DSri1s00N2fD5rL01SrlzY; Tue, 02 Feb 2016 14:51:46 +0000 From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 2 Feb 2016 07:51:41 -0700 Message-Id: <1454424701-26111-1-git-send-email-eblake@redhat.com> X-Mailer: git-send-email 2.5.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1454424706; bh=H6bZPozuRS8OPEscR8jz+FwE/uUZWGhmPsHnYlBY3CY=; h=Received:Received:From:To:Subject:Date:Message-Id; b=O9QWyDAUtIk/JDBTgO/eGhodvLXKoN2tx/poUa4fr4MdH6aA1wBnPvGk2fLEBQGje p1Phl3Pl7J79+Liz86PbRgaYov/HJP0u7qzzl62eVSFgFN78pDa/t0JVwT08T0Kugw gq0gBf6LFsZtAaTKvJfn01FaJJ83rIip0GeRK8Qi6mLXyBHZZ+IBSHnVFdgaFsHHxW b3ictjH0HUe/EwF+ZgfTV2xtjKvtDGYhMnFEQi8hbg869nMbo4DP1/DUItrkrWFfzr eJmH8YLhZX79gKluSH3m2nyogE7zE/TIFcmSEO0TVGpiby5quUhlEbUs8WIbsKxGJy 1j7uY6YejqRvw== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 96.114.154.166 Cc: James Hogan , Michael Roth , Peter Crosthwaite , armbru@redhat.com, Luiz Capitulino , Paolo Bonzini , Richard Henderson Subject: [Qemu-devel] [PATCH] qapi: Fix compilation failure on MIPS 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Commit 86f4b687 broke compilation on MIPS, which has a preprocessor pollution of '#define mips 1'. 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' spelling. CC: James Hogan Signed-off-by: Eric Blake Tested-by: James Hogan --- scripts/qapi.py | 2 +- cpus.c | 4 ++-- hmp.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index d199222..7f114c4 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']) name = name.translate(c_name_trans) if protect and (name in c89_words | c99_words | c11_words | gcc_words | cpp_words | polluted_words): diff --git a/cpus.c b/cpus.c index 882b618..c8a2317 100644 --- a/cpus.c +++ b/cpus.c @@ -1581,8 +1581,8 @@ CpuInfoList *qmp_query_cpus(Error **errp) info->value->u.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 a4b74df..ef98344 100644 --- a/hmp.c +++ b/hmp.c @@ -322,7 +322,7 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict) monitor_printf(mon, " npc=0x%016" PRIx64, cpu->value->u.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);