qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Glauber Costa <gcosta@redhat.com>
To: qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH 6/6] cpu-exec-dump
Date: Tue, 27 May 2008 12:18:25 -0300	[thread overview]
Message-ID: <1211901505-30519-7-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <1211901505-30519-6-git-send-email-gcosta@redhat.com>

enclose the cpu dumping logic in cpu_exec() inside cpu_exec_dump()

---
 cpu-exec.c            |   30 +-----------------------------
 target-alpha/helper.c |    5 +++++
 target-arm/helper.c   |    5 +++++
 target-cris/helper.c  |    5 +++++
 target-i386/helper.c  |    8 ++++++++
 target-m68k/helper.c  |   10 ++++++++++
 target-mips/helper.c  |    5 +++++
 target-ppc/helper.c   |    4 ++++
 target-sh4/helper.c   |    5 +++++
 target-sparc/helper.c |    9 +++++++++
 10 files changed, 57 insertions(+), 29 deletions(-)

Index: qemu/cpu-exec.c
===================================================================
--- qemu.orig/cpu-exec.c
+++ qemu/cpu-exec.c
@@ -369,35 +369,7 @@ int cpu_exec(CPUState *env1)
                 if ((loglevel & CPU_LOG_TB_CPU)) {
                     /* restore flags in standard format */
                     regs_to_env();
-#if defined(TARGET_I386)
-                    env->eflags = env->eflags | cc_table[CC_OP].compute_all() | (DF & DF_MASK);
-                    cpu_dump_state(env, logfile, fprintf, X86_DUMP_CCOP);
-                    env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
-#elif defined(TARGET_ARM)
-                    cpu_dump_state(env, logfile, fprintf, 0);
-#elif defined(TARGET_SPARC)
-		    REGWPTR = env->regbase + (env->cwp * 16);
-		    env->regwptr = REGWPTR;
-                    cpu_dump_state(env, logfile, fprintf, 0);
-#elif defined(TARGET_PPC)
-                    cpu_dump_state(env, logfile, fprintf, 0);
-#elif defined(TARGET_M68K)
-                    cpu_m68k_flush_flags(env, env->cc_op);
-                    env->cc_op = CC_OP_FLAGS;
-                    env->sr = (env->sr & 0xffe0)
-                              | env->cc_dest | (env->cc_x << 4);
-                    cpu_dump_state(env, logfile, fprintf, 0);
-#elif defined(TARGET_MIPS)
-                    cpu_dump_state(env, logfile, fprintf, 0);
-#elif defined(TARGET_SH4)
-		    cpu_dump_state(env, logfile, fprintf, 0);
-#elif defined(TARGET_ALPHA)
-                    cpu_dump_state(env, logfile, fprintf, 0);
-#elif defined(TARGET_CRIS)
-                    cpu_dump_state(env, logfile, fprintf, 0);
-#else
-#error unsupported target CPU
-#endif
+                    cpu_exec_dump(env);
                 }
 #endif
                 tb = tb_find_fast();
Index: qemu/target-alpha/helper.c
===================================================================
--- qemu.orig/target-alpha/helper.c
+++ qemu/target-alpha/helper.c
@@ -466,3 +466,8 @@ void arch_handle_interrupt_request(CPUSt
         reset_tb();
     }
 }
+
+void cpu_exec_dump(CPUState *env)
+{
+    cpu_dump_state(env, logfile, fprintf, 0);
+}
Index: qemu/target-arm/helper.c
===================================================================
--- qemu.orig/target-arm/helper.c
+++ qemu/target-arm/helper.c
@@ -2555,3 +2555,8 @@ void arch_handle_interrupt_request(CPUSt
         reset_tb();
     }
 }
+
+void cpu_exec_dump(CPUState *env)
+{
+    cpu_dump_state(env, logfile, fprintf, 0);
+}
Index: qemu/target-cris/helper.c
===================================================================
--- qemu.orig/target-cris/helper.c
+++ qemu/target-cris/helper.c
@@ -197,3 +197,8 @@ void arch_handle_interrupt_request(CPUSt
         reset_tb();
     }
 }
+
+void cpu_exec_dump(CPUState *env)
+{
+    cpu_dump_state(env, logfile, fprintf, 0);
+}
Index: qemu/target-i386/helper.c
===================================================================
--- qemu.orig/target-i386/helper.c
+++ qemu/target-i386/helper.c
@@ -4767,6 +4767,14 @@ void cpu_reset_mmu(CPUState *env)
     }
 #endif
 }
+
+void cpu_exec_dump(CPUState *env)
+{
+    env->eflags = env->eflags | cc_table[CC_OP].compute_all() | (DF & DF_MASK);
+    cpu_dump_state(env, logfile, fprintf, X86_DUMP_CCOP);
+    env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
+}
+
 #if defined(CONFIG_USER_ONLY)
 
 void helper_vmrun(void) 
Index: qemu/target-m68k/helper.c
===================================================================
--- qemu.orig/target-m68k/helper.c
+++ qemu/target-m68k/helper.c
@@ -373,6 +373,16 @@ void arch_handle_interrupt_request(CPUSt
         reset_tb();
     }
 }
+
+void cpu_exec_dump(CPUState *env)
+{
+    cpu_m68k_flush_flags(env, env->cc_op);
+    env->cc_op = CC_OP_FLAGS;
+    env->sr = (env->sr & 0xffe0)
+              | env->cc_dest | (env->cc_x << 4);
+    cpu_dump_state(env, logfile, fprintf, 0);
+}
+
 #if defined(CONFIG_USER_ONLY)
 
 int cpu_m68k_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
Index: qemu/target-mips/helper.c
===================================================================
--- qemu.orig/target-mips/helper.c
+++ qemu/target-mips/helper.c
@@ -663,3 +663,8 @@ void arch_handle_interrupt_request(CPUSt
         reset_tb();
     }
 }
+
+void cpu_exec_dump(CPUState *env)
+{
+    cpu_dump_state(env, logfile, fprintf, 0);
+}
Index: qemu/target-ppc/helper.c
===================================================================
--- qemu.orig/target-ppc/helper.c
+++ qemu/target-ppc/helper.c
@@ -3014,3 +3014,7 @@ void arch_handle_interrupt_request(CPUSt
     }
 }
 
+void cpu_exec_dump(CPUState *env)
+{
+    cpu_dump_state(env, logfile, fprintf, 0);
+}
Index: qemu/target-sh4/helper.c
===================================================================
--- qemu.orig/target-sh4/helper.c
+++ qemu/target-sh4/helper.c
@@ -547,3 +547,8 @@ void arch_handle_interrupt_request(CPUSt
         reset_tb();
     }
 }
+
+void cpu_exec_dump(CPUState *env)
+{
+    cpu_dump_state(env, logfile, fprintf, 0);
+}
Index: qemu/target-sparc/helper.c
===================================================================
--- qemu.orig/target-sparc/helper.c
+++ qemu/target-sparc/helper.c
@@ -1342,6 +1342,15 @@ void cpu_put_flags(CPUState *env)
 
 void cpu_reset_mmu(CPUState *env) {}
 
+void cpu_exec_dump(CPUState *env)
+{
+#if defined(reg_REGWPTR)
+    REGWPTR = env->regbase + (env->cwp * 16);
+    env->regwptr = REGWPTR;
+#endif
+    cpu_dump_state(env, logfile, fprintf, 0);
+}
+
 #ifdef TARGET_SPARC64
 #if !defined(CONFIG_USER_ONLY)
 #include "qemu-common.h"

  reply	other threads:[~2008-05-27 15:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-27 15:18 [Qemu-devel] [PATCH 0/6] simplify cpu-exec new spin Glauber Costa
2008-05-27 15:18 ` [Qemu-devel] [PATCH 1/6] simplify cpu_exec Glauber Costa
2008-05-27 15:18   ` [Qemu-devel] [PATCH 2/6] Push common interrupt variables to cpu-defs.h Glauber Costa
2008-05-27 15:18     ` [Qemu-devel] [PATCH 3/6] use halted attribute for i386 too Glauber Costa
2008-05-27 15:18       ` [Qemu-devel] [PATCH 4/6] simply cpu_exec further Glauber Costa
2008-05-27 15:18         ` [Qemu-devel] [PATCH 5/6] isolate mmu code in arch-specific function Glauber Costa
2008-05-27 15:18           ` Glauber Costa [this message]
2008-05-27 15:38             ` [Qemu-devel] [PATCH 6/6] cpu-exec-dump Paul Brook
2008-05-27 15:30           ` [Qemu-devel] [PATCH 5/6] isolate mmu code in arch-specific function Fabrice Bellard
2008-05-27 15:42             ` Glauber Costa
2008-05-27 15:36           ` Paul Brook
2008-05-27 16:18         ` [Qemu-devel] [PATCH 4/6] simply cpu_exec further Blue Swirl
2008-05-27 16:27           ` Glauber Costa
2008-05-27 15:34       ` [Qemu-devel] [PATCH 3/6] use halted attribute for i386 too Fabrice Bellard
2008-05-27 16:10         ` Blue Swirl
2008-05-27 21:49           ` Glauber Costa
2008-05-27 16:25         ` Glauber Costa
2008-05-27 21:21           ` Fabrice Bellard
2008-05-27 15:39     ` [Qemu-devel] [PATCH 2/6] Push common interrupt variables to cpu-defs.h Fabrice Bellard
2008-05-27 15:33   ` [Qemu-devel] [PATCH 1/6] simplify cpu_exec Paul Brook
2008-05-27 16:05     ` Blue Swirl
2008-05-27 15:37   ` Fabrice Bellard
  -- strict thread matches above, loose matches on Subject: below --
2008-05-28 14:01 [Qemu-devel] [PATCH 0/6] Simplify cpu_exec - spin 3 Glauber Costa
2008-05-28 14:01 ` [Qemu-devel] [PATCH 1/6] remove REGWPTR Glauber Costa
2008-05-28 14:01   ` [Qemu-devel] [PATCH 2/6] simplify cpu_exec Glauber Costa
2008-05-28 14:01     ` [Qemu-devel] [PATCH 3/6] Push common interrupt variables to cpu-defs.h Glauber Costa
2008-05-28 14:01       ` [Qemu-devel] [PATCH 4/6] use halted attribute for i386 too Glauber Costa
2008-05-28 14:01         ` [Qemu-devel] [PATCH 5/6] simply cpu_exec further Glauber Costa
2008-05-28 14:01           ` [Qemu-devel] [PATCH 6/6] cpu-exec-dump Glauber Costa

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=1211901505-30519-7-git-send-email-gcosta@redhat.com \
    --to=gcosta@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.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).