All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	James Hogan <james.hogan@imgtec.com>
Subject: [Qemu-devel] [PULL 30/31] qapi: Fix compilation failure on MIPS and SPARC
Date: Tue,  9 Feb 2016 12:38:02 +0100	[thread overview]
Message-ID: <1455017883-25867-31-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1455017883-25867-1-git-send-email-armbru@redhat.com>

From: Eric Blake <eblake@redhat.com>

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 <james.hogan@imgtec.com>
CC: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Eric Blake <eblake@redhat.com>
Tested-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 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):
-- 
2.4.3

  parent reply	other threads:[~2016-02-09 11:38 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 11:37 [Qemu-devel] [PULL 00/31] QAPI patches for 2016-02-09 Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 01/31] qapi: Use Python 2.6 "except E as ..." syntax Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 02/31] scripts/qmp: " Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 03/31] Revert "tracetool: use Python 2.4-compatible exception handling syntax" Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 04/31] tests: Use Python 2.6 "except E as ..." syntax Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 05/31] qobject: Document more shortcomings in our number handling Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 06/31] qapi: Avoid use of misnamed DO_UPCAST() Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 07/31] qapi: Drop dead dealloc visitor variable Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 08/31] qapi: Dealloc visitor does not need a type_size() Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 09/31] qapi: Drop dead parameter in gen_params() Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 10/31] hmp: Drop pointless allocation during qapi visit Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 11/31] hmp: Cache use of qapi visitor Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 12/31] vl: Ensure qapi visitor properly ends struct visit Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 13/31] balloon: Improve use of qapi visitor Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 14/31] qapi: Improve generated event " Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 15/31] qapi: Track all failures between visit_start/stop Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 16/31] qapi-visit: Kill unused visit_end_union() Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 17/31] qapi: Prefer type_int64 over type_int in visitors Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 18/31] qapi: Make all visitors supply uint64 callbacks Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 19/31] qapi: Consolidate visitor small integer callbacks Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 20/31] qapi: Don't cast Enum* to int* Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 21/31] qom: Use typedef for Visitor Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 22/31] qapi: Swap visit_* arguments for consistent 'name' placement Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 23/31] qom: Swap 'name' next to visitor in ObjectPropertyAccessor Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 24/31] qapi: Swap 'name' in visit_* callbacks to match public API Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 25/31] qapi: Drop unused 'kind' for struct/enum visit Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 26/31] qapi: Tighten qmp_input_end_list() Markus Armbruster
2016-02-09 11:37 ` [Qemu-devel] [PULL 27/31] qapi: Drop unused error argument for list and implicit struct Markus Armbruster
2016-02-09 11:38 ` [Qemu-devel] [PULL 28/31] qmp: Fix reference-counting of qnull on empty output visit Markus Armbruster
2016-02-09 11:38 ` [Qemu-devel] [PULL 29/31] qmp: Don't abuse stack to track qmp-output root Markus Armbruster
2016-02-09 11:38 ` Markus Armbruster [this message]
2016-02-09 11:38 ` [Qemu-devel] [PULL 31/31] qapi: Add missing JSON files in build dependencies Markus Armbruster
2016-02-09 13:08 ` [Qemu-devel] [PULL 00/31] QAPI patches for 2016-02-09 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=1455017883-25867-31-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=james.hogan@imgtec.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.