From patchwork Wed May 4 20:11:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 618617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r0TnJ4p2Yz9t4h for ; Thu, 5 May 2016 06:15:48 +1000 (AEST) Received: from localhost ([::1]:49997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ay3Cx-0003wG-3V for incoming@patchwork.ozlabs.org; Wed, 04 May 2016 16:15:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ay3C6-000290-Er for qemu-devel@nongnu.org; Wed, 04 May 2016 16:14:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ay3Bu-0003h7-PV for qemu-devel@nongnu.org; Wed, 04 May 2016 16:14:45 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:29710) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ay3Bu-0003Ux-Fg for qemu-devel@nongnu.org; Wed, 04 May 2016 16:14:38 -0400 Received: from Quad.localdomain (unknown [IPv6:2a01:e34:eeee:5240:12c3:7bff:fe6b:9a76]) by smtp1-g21.free.fr (Postfix) with ESMTPS id 53333B00488; Wed, 4 May 2016 20:08:06 +0200 (CEST) From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 4 May 2016 22:11:57 +0200 Message-Id: <1462392752-17703-18-git-send-email-laurent@vivier.eu> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1462392752-17703-1-git-send-email-laurent@vivier.eu> References: <1462392752-17703-1-git-send-email-laurent@vivier.eu> X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 212.27.42.1 Subject: [Qemu-devel] [PATCH 17/52] target-m68k: Print flags properly X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , rth@twiddle.net, schwab@linux-m68k.org, agraf@suse.de, gerg@uclinux.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Laurent Vivier --- target-m68k/cpu.h | 1 + target-m68k/helper.c | 2 +- target-m68k/translate.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h index 8dafaab..b2d9f3a 100644 --- a/target-m68k/cpu.h +++ b/target-m68k/cpu.h @@ -129,6 +129,7 @@ int cpu_m68k_exec(CPUState *cpu); is returned if the signal was handled by the virtual CPU. */ int cpu_m68k_signal_handler(int host_signum, void *pinfo, void *puc); +uint32_t cpu_m68k_flush_flags(CPUM68KState *env, int op); typedef enum { CC_OP_DYNAMIC, /* Use env->cc_op */ diff --git a/target-m68k/helper.c b/target-m68k/helper.c index c3e4380..e9ec8bc 100644 --- a/target-m68k/helper.c +++ b/target-m68k/helper.c @@ -131,7 +131,7 @@ void m68k_cpu_init_gdb(M68kCPU *cpu) /* TODO: Add [E]MAC registers. */ } -static uint32_t cpu_m68k_flush_flags(CPUM68KState *env, int op) +uint32_t cpu_m68k_flush_flags(CPUM68KState *env, int op) { int flags; uint32_t src; diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 82c22b2..a116c17 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -3141,8 +3141,8 @@ void m68k_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf, i, u.l.upper, u.l.lower, *(double *)&u.d); } cpu_fprintf (f, "PC = %08x ", env->pc); - sr = env->sr; - cpu_fprintf (f, "SR = %04x %c%c%c%c%c ", sr, (sr & 0x10) ? 'X' : '-', + sr = env->sr | cpu_m68k_flush_flags(env, env->cc_op) | env->cc_x * CCF_X; + 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, "FPRESULT = %12g\n", *(double *)&env->fp_result);