qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, edgari@xilinx.com, rth@twiddle.net,
	claudio.fontana@huawei.com, edgar.iglesias@gmail.com
Subject: [Qemu-devel] [PATCH v2 5/7] disas: microblaze: QOMify target specific disas setup
Date: Sat,  9 May 2015 13:11:15 -0700	[thread overview]
Message-ID: <7a0432a8431635b20b50c31e23a521c030ebef8e.1431200693.git.crosthwaite.peter@gmail.com> (raw)
In-Reply-To: <cover.1431200693.git.crosthwaite.peter@gmail.com>
In-Reply-To: <cover.1431200693.git.crosthwaite.peter@gmail.com>

Move the target_disas() MB specifics to the QOM disas_set_info hook
and delete the MB specific code in disas.c.

This also now adds support for monitor disas to Microblaze.

E.g.
(qemu) xp 0x90000000
0000000090000000: 0x94208001

And before this patch:
(qemu) xp/i 0x90000000
0x90000000: Asm output not supported on this arch

After:
(qemu) xp/i 0x90000000
0x90000000:  mfs    r1, rmsr

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 disas.c                 | 3 ---
 target-microblaze/cpu.c | 8 ++++++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/disas.c b/disas.c
index 1700537..087f4b4 100644
--- a/disas.c
+++ b/disas.c
@@ -269,9 +269,6 @@ void target_disas(FILE *out, CPUArchState *env, target_ulong code,
 #elif defined(TARGET_S390X)
     s.info.mach = bfd_mach_s390_64;
     s.info.print_insn = print_insn_s390;
-#elif defined(TARGET_MICROBLAZE)
-    s.info.mach = bfd_arch_microblaze;
-    s.info.print_insn = print_insn_microblaze;
 #elif defined(TARGET_MOXIE)
     s.info.mach = bfd_arch_moxie;
     s.info.print_insn = print_insn_moxie;
diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c
index 67e3182..89b8363 100644
--- a/target-microblaze/cpu.c
+++ b/target-microblaze/cpu.c
@@ -111,6 +111,12 @@ static void mb_cpu_reset(CPUState *s)
 #endif
 }
 
+static void mb_disas_set_info(CPUState *cpu, disassemble_info *info)
+{
+    info->mach = bfd_arch_microblaze;
+    info->print_insn = print_insn_microblaze;
+}
+
 static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
 {
     CPUState *cs = CPU(dev);
@@ -183,6 +189,8 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data)
     dc->vmsd = &vmstate_mb_cpu;
     dc->props = mb_properties;
     cc->gdb_num_core_regs = 32 + 5;
+
+    cc->disas_set_info = mb_disas_set_info;
 }
 
 static const TypeInfo mb_cpu_type_info = {
-- 
1.9.1

  parent reply	other threads:[~2015-05-09 20:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-09 20:11 [Qemu-devel] [PATCH v2 0/7] Unify and QOMify (target|monitor)_disas Peter Crosthwaite
2015-05-09 20:11 ` [Qemu-devel] [PATCH v2 1/7] disas: Add print_insn to disassemble info Peter Crosthwaite
2015-05-11 15:51   ` Richard Henderson
2015-05-09 20:11 ` [Qemu-devel] [PATCH v2 2/7] disas: QOMify target specific setup Peter Crosthwaite
2015-05-11 14:46   ` Paolo Bonzini
2015-05-11 15:50     ` Richard Henderson
2015-05-11 15:51   ` Richard Henderson
2015-05-09 20:11 ` [Qemu-devel] [PATCH v2 3/7] disas: arm-a64: Make printfer and stream variable Peter Crosthwaite
2015-05-11 15:57   ` Richard Henderson
2015-05-24 21:28     ` Peter Crosthwaite
2015-05-09 20:11 ` [Qemu-devel] [PATCH v2 4/7] disas: arm: QOMify target specific disas setup Peter Crosthwaite
2015-05-18 16:31   ` Peter Maydell
2015-05-24 21:42     ` Peter Crosthwaite
2015-05-09 20:11 ` Peter Crosthwaite [this message]
2015-05-09 20:11 ` [Qemu-devel] [PATCH v2 6/7] disas: cris: Fix 0 buffer length case Peter Crosthwaite
2015-05-09 20:11 ` [Qemu-devel] [PATCH v2 7/7] disas: cris: QOMify target specific disas setup Peter Crosthwaite
2015-05-15  4:52 ` [Qemu-devel] [PATCH v2 0/7] Unify and QOMify (target|monitor)_disas Peter Crosthwaite
2015-05-15 13:33   ` Richard Henderson
2015-05-15 17:02     ` Peter Crosthwaite
2015-05-15 21:01     ` Peter Crosthwaite
2015-05-15 23:13       ` 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=7a0432a8431635b20b50c31e23a521c030ebef8e.1431200693.git.crosthwaite.peter@gmail.com \
    --to=crosthwaitepeter@gmail.com \
    --cc=claudio.fontana@huawei.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=edgari@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --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).