qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: James Hogan <james.hogan@imgtec.com>,
	Michael Roth <mdroth@linux.vnet.ibm.com>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	armbru@redhat.com, Luiz Capitulino <lcapitulino@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH] qapi: Fix compilation failure on MIPS
Date: Tue,  2 Feb 2016 07:51:41 -0700	[thread overview]
Message-ID: <1454424701-26111-1-git-send-email-eblake@redhat.com> (raw)

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 <james.hogan@imgtec.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 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);
-- 
2.5.0

             reply	other threads:[~2016-02-02 14:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 14:51 Eric Blake [this message]
2016-02-02 15:06 ` [Qemu-devel] [PATCH] qapi: Fix compilation failure on MIPS James Hogan
2016-02-02 16:14 ` Markus Armbruster
2016-02-02 17:26 ` Peter Maydell
2016-02-02 17:45   ` Eric Blake
2016-02-02 18:16     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454424701-26111-1-git-send-email-eblake@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=james.hogan@imgtec.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).