qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>,
	Thomas Huth <huth@tuxfamily.org>,
	Laurent Vivier <laurent@vivier.eu>
Subject: [Qemu-devel] [PATCH v6 17/17] target/m68k: fix m68k_cpu_dump_state()
Date: Wed,  3 Jan 2018 00:41:08 +0100	[thread overview]
Message-ID: <20180102234108.32713-18-laurent@vivier.eu> (raw)
In-Reply-To: <20180102234108.32713-1-laurent@vivier.eu>

Display correctly the Trace bits for 680x0
(2 bits instead of 1 for Coldfire).

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/m68k/cpu.h       | 3 ++-
 target/m68k/translate.c | 9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
index 759b30d389..2985b039e1 100644
--- a/target/m68k/cpu.h
+++ b/target/m68k/cpu.h
@@ -219,7 +219,8 @@ typedef enum {
 #define SR_I  0x0700
 #define SR_M  0x1000
 #define SR_S  0x2000
-#define SR_T  0x8000
+#define SR_T_SHIFT 14
+#define SR_T  0xc000
 
 #define M68K_SSP    0
 #define M68K_USP    1
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 9088e87b97..06840c5d00 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -5937,9 +5937,12 @@ void m68k_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
     }
     cpu_fprintf (f, "PC = %08x   ", env->pc);
     sr = env->sr | cpu_m68k_get_ccr(env);
-    cpu_fprintf(f, "SR = %04x %c%c%c%c%c ", sr, (sr & CCF_X) ? 'X' : '-',
-                (sr & CCF_N) ? 'N' : '-', (sr & CCF_Z) ? 'Z' : '-',
-                (sr & CCF_V) ? 'V' : '-', (sr & CCF_C) ? 'C' : '-');
+    cpu_fprintf(f, "SR = %04x T:%x I:%x %c%c %c%c%c%c%c\n",
+                sr, (sr & SR_T) >> SR_T_SHIFT, (sr & SR_I) >> SR_I_SHIFT,
+                (sr & SR_S) ? 'S' : 'U', (sr & SR_M) ? '%' : 'I',
+                (sr & CCF_X) ? 'X' : '-', (sr & CCF_N) ? 'N' : '-',
+                (sr & CCF_Z) ? 'Z' : '-', (sr & CCF_V) ? 'V' : '-',
+                (sr & CCF_C) ? 'C' : '-');
     cpu_fprintf(f, "FPSR = %08x %c%c%c%c ", env->fpsr,
                 (env->fpsr & FPSR_CC_A) ? 'A' : '-',
                 (env->fpsr & FPSR_CC_I) ? 'I' : '-',
-- 
2.14.3

      parent reply	other threads:[~2018-01-02 23:41 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-02 23:40 [Qemu-devel] [PATCH v6 00/17] target/m68k: supervisor mode (part 1) Laurent Vivier
2018-01-02 23:40 ` [Qemu-devel] [PATCH v6 01/17] target-m68k: sync CC_OP before gen_jmp_tb() Laurent Vivier
2018-01-02 23:40 ` [Qemu-devel] [PATCH v6 02/17] target/m68k: fix gen_get_ccr() Laurent Vivier
2018-01-02 23:40 ` [Qemu-devel] [PATCH v6 03/17] linux-user, m68k: correctly manage SR in context Laurent Vivier
2018-01-02 23:40 ` [Qemu-devel] [PATCH v6 04/17] target/m68k: use insn_pc to generate instruction fault address Laurent Vivier
2018-01-02 23:40 ` [Qemu-devel] [PATCH v6 05/17] target/m68k: add CPU_LOG_INT trace Laurent Vivier
2018-01-03  9:53   ` Philippe Mathieu-Daudé
2018-01-03 21:44   ` Richard Henderson
2018-01-02 23:40 ` [Qemu-devel] [PATCH v6 06/17] target/m68k: manage 680x0 stack frames Laurent Vivier
2018-01-02 23:40 ` [Qemu-devel] [PATCH v6 07/17] target/m68k: add chk and chk2 Laurent Vivier
2018-01-03 21:52   ` Richard Henderson
2018-01-03 23:40     ` Laurent Vivier
2018-01-04  0:32       ` Richard Henderson
2018-01-02 23:40 ` [Qemu-devel] [PATCH v6 08/17] target/m68k: add move16 Laurent Vivier
2018-01-03 21:54   ` Richard Henderson
2018-01-02 23:41 ` [Qemu-devel] [PATCH v6 09/17] target/m68k: softmmu cleanup Laurent Vivier
2018-01-02 23:41 ` [Qemu-devel] [PATCH v6 10/17] target/m68k: add cpush/cinv Laurent Vivier
2018-01-02 23:41 ` [Qemu-devel] [PATCH v6 11/17] target/m68k: add reset Laurent Vivier
2018-01-02 23:41 ` [Qemu-devel] [PATCH v6 12/17] target/m68k: implement fsave/frestore Laurent Vivier
2018-01-02 23:41 ` [Qemu-devel] [PATCH v6 13/17] target/m68k: move CCR/SR functions Laurent Vivier
2018-01-02 23:41 ` [Qemu-devel] [PATCH v6 14/17] target/m68k: add 680x0 "move to SR" instruction Laurent Vivier
2018-01-02 23:41 ` [Qemu-devel] [PATCH v6 15/17] target/m68k: add andi/ori/eori to SR/CCR Laurent Vivier
2018-01-02 23:41 ` [Qemu-devel] [PATCH v6 16/17] target/m68k: add the Interrupt Stack Pointer Laurent Vivier
2018-01-03 21:58   ` Richard Henderson
2018-01-02 23:41 ` Laurent Vivier [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=20180102234108.32713-18-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=huth@tuxfamily.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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 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).