qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Peter Crosthwaite <crosthwaitepeter@gmail.com>
Cc: peter.maydell@linaro.org,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	claudio.fontana@huawei.com, qemu-devel@nongnu.org,
	rth@twiddle.net, afaerber@suse.de, egdar.iglesias@gmail.com
Subject: Re: [Qemu-devel] [PATCH v3 7/7] disas: cris: QOMify target specific disas setup
Date: Fri, 29 May 2015 15:22:53 +1000	[thread overview]
Message-ID: <20150529052253.GI17116@toto> (raw)
In-Reply-To: <fbdcb0f5121ae0b08fea1b825d1a57dc72bdaf43.1432506704.git.crosthwaite.peter@gmail.com>

On Sun, May 24, 2015 at 03:47:20PM -0700, Peter Crosthwaite wrote:
> Move the target_disas() cris specifics to the QOM disas_set_info hook
> and delete the cris specific code in disas.c.
> 
> This also now adds support for monitor disas to cris.
> 
> E.g.
> (qemu) xp 0x40004000
> 0000000040004000: 0x1e6f25f0
> 
> And before this patch:
> (qemu) xp/i 0x40004000
> 0x40004000: Asm output not supported on this arch
> 
> After:
> (qemu) xp/i 0x40004000
> 0x40004000:  di
> (qemu) xp/i 0x40004002
> 0x40004002:  move.d 0xb003c004,$r1
> 
> Note: second example is 6-byte misaligned instruction!
> 
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>

Thanks Peter

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>


> ---
>  disas.c           |  8 --------
>  target-cris/cpu.c | 16 ++++++++++++++++
>  2 files changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/disas.c b/disas.c
> index 937e08b..69a6066 100644
> --- a/disas.c
> +++ b/disas.c
> @@ -257,14 +257,6 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code,
>  #elif defined(TARGET_ALPHA)
>      s.info.mach = bfd_mach_alpha_ev6;
>      s.info.print_insn = print_insn_alpha;
> -#elif defined(TARGET_CRIS)
> -    if (flags != 32) {
> -        s.info.mach = bfd_mach_cris_v0_v10;
> -        s.info.print_insn = print_insn_crisv10;
> -    } else {
> -        s.info.mach = bfd_mach_cris_v32;
> -        s.info.print_insn = print_insn_crisv32;
> -    }
>  #elif defined(TARGET_S390X)
>      s.info.mach = bfd_mach_s390_64;
>      s.info.print_insn = print_insn_s390;
> diff --git a/target-cris/cpu.c b/target-cris/cpu.c
> index 16cfba9..d555ea0 100644
> --- a/target-cris/cpu.c
> +++ b/target-cris/cpu.c
> @@ -161,6 +161,20 @@ static void cris_cpu_set_irq(void *opaque, int irq, int level)
>  }
>  #endif
>  
> +static void cris_disas_set_info(CPUState *cpu, disassemble_info *info)
> +{
> +    CRISCPU *cc = CRIS_CPU(cpu);
> +    CPUCRISState *env = &cc->env;
> +
> +    if (env->pregs[PR_VR] != 32) {
> +        info->mach = bfd_mach_cris_v0_v10;
> +        info->print_insn = print_insn_crisv10;
> +    } else {
> +        info->mach = bfd_mach_cris_v32;
> +        info->print_insn = print_insn_crisv32;
> +    }
> +}
> +
>  static void cris_cpu_initfn(Object *obj)
>  {
>      CPUState *cs = CPU(obj);
> @@ -292,6 +306,8 @@ static void cris_cpu_class_init(ObjectClass *oc, void *data)
>  
>      cc->gdb_num_core_regs = 49;
>      cc->gdb_stop_before_watchpoint = true;
> +
> +    cc->disas_set_info = cris_disas_set_info;
>  }
>  
>  static const TypeInfo cris_cpu_type_info = {
> -- 
> 1.9.1
> 
> 

      reply	other threads:[~2015-05-29  5:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-24 22:47 [Qemu-devel] [PATCH v3 0/7] Unify and QOMify (target|monitor)_disas Peter Crosthwaite
2015-05-24 22:47 ` [Qemu-devel] [PATCH v3 1/7] disas: Add print_insn to disassemble info Peter Crosthwaite
2015-05-24 22:47 ` [Qemu-devel] [PATCH v3 2/7] disas: QOMify target specific setup Peter Crosthwaite
2015-05-24 22:47 ` [Qemu-devel] [PATCH v3 3/7] disas: arm-a64: Make printfer and stream variable Peter Crosthwaite
2015-06-24  3:32   ` Peter Crosthwaite
2015-05-24 22:47 ` [Qemu-devel] [PATCH v3 4/7] disas: arm: QOMify target specific disas setup Peter Crosthwaite
2015-05-24 22:47 ` [Qemu-devel] [PATCH v3 5/7] disas: microblaze: " Peter Crosthwaite
2015-05-29  4:43   ` Peter Crosthwaite
2015-05-29  4:45   ` Edgar E. Iglesias
2015-05-24 22:47 ` [Qemu-devel] [PATCH v3 6/7] disas: cris: Fix 0 buffer length case Peter Crosthwaite
2015-05-29  5:21   ` Edgar E. Iglesias
2015-05-24 22:47 ` [Qemu-devel] [PATCH v3 7/7] disas: cris: QOMify target specific disas setup Peter Crosthwaite
2015-05-29  5:22   ` Edgar E. Iglesias [this message]

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=20150529052253.GI17116@toto \
    --to=edgar.iglesias@gmail.com \
    --cc=afaerber@suse.de \
    --cc=claudio.fontana@huawei.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=crosthwaitepeter@gmail.com \
    --cc=egdar.iglesias@gmail.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).