From: Richard Henderson <rth@twiddle.net>
To: khansa@kics.edu.pk
Cc: peter.maydell@linaro.org, riku.voipio@iki.fi,
qemu-devel@nongnu.org, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH 4/4] Addition of Cavium instruction in disassembler
Date: Mon, 15 Aug 2011 09:37:54 -0700 [thread overview]
Message-ID: <4E494B62.9040407@twiddle.net> (raw)
In-Reply-To: <1313407533-25740-5-git-send-email-khansa@kics.edu.pk>
On 08/15/2011 04:25 AM, khansa@kics.edu.pk wrote:
> index 1334b8e..0137657 100644
> --- a/disas.c
> +++ b/disas.c
> @@ -140,6 +140,7 @@ print_insn_thumb1(bfd_vma pc, disassemble_info *info)
> i386 - nonzero means 16 bit code
> arm - nonzero means thumb code
> ppc - nonzero means little endian
> + mips64 - zero means standard MIPS ISA, 1 means Octeon CPU.
...
> +++ b/target-mips/translate.c
> @@ -12860,6 +12860,9 @@ done_generating:
> LOG_DISAS("\n");
> if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) {
> qemu_log("IN: %s\n", lookup_symbol(pc_start));
> + if (env->insn_flags & CPU_OCTEON)
> + log_target_disas(pc_start, ctx.pc - pc_start, 1);
> + else
> log_target_disas(pc_start, ctx.pc - pc_start, 0);
disas.c has access to cpu.h. You'd do well to avoid a magic number
here and pass along env->insn_flags right from the beginning, and...
> @@ -196,6 +197,9 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags)
> print_insn = print_insn_m68k;
> #elif defined(TARGET_MIPS)
> #ifdef TARGET_WORDS_BIGENDIAN
> + if (flags)
> + disasm_info.flags = flags << 16;
> + print_insn = print_insn_big_mips;
> print_insn = print_insn_big_mips;
Notice anything funny here in the last two lines?
Notice anything incorrect about the coding style?
It's a bit sad that we're limited to pre-GPLv3, because we're going
to get more and more out of sync with the binutils disassembler.
But that said, let's not go out of our way to totally change the style.
Give mips-dis.c access to target-mips/mips-defs.h. Map between that
and the existing membership field in struct mips_opcode. Put some
real code back into OPCODE_IS_MEMBER.
r~
next prev parent reply other threads:[~2011-08-15 16:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-15 11:25 [Qemu-devel] [PATCH 0/4] MIPS64 user mode emulation in QEMU with Cavium specific instruction support khansa
2011-08-15 11:25 ` [Qemu-devel] [PATCH 1/4] linux-user:Support for MIPS64 user mode emulation in QEMU khansa
2011-08-15 15:32 ` Richard Henderson
2011-08-15 11:25 ` [Qemu-devel] [PATCH 2/4] Octeon cpu definitions in target-mips and Octeon specific changes in set_thread_area syscall khansa
2011-08-15 15:43 ` Richard Henderson
2011-08-17 7:00 ` Khansa Butt
2011-08-17 15:03 ` Richard Henderson
2011-08-15 11:25 ` [Qemu-devel] [PATCH 3/4] target-mips:Support for Cavium specific instructions khansa
2011-08-15 16:18 ` Richard Henderson
2011-08-15 11:25 ` [Qemu-devel] [PATCH 4/4] Addition of Cavium instruction in disassembler khansa
2011-08-15 16:37 ` Richard Henderson [this message]
2011-08-17 6:52 ` Khansa Butt
2011-08-17 15:18 ` Richard Henderson
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=4E494B62.9040407@twiddle.net \
--to=rth@twiddle.net \
--cc=aurelien@aurel32.net \
--cc=khansa@kics.edu.pk \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/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).