qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 06/10] mips: replace code inside ifdef with generic


From: Glauber Costa
Subject: [Qemu-devel] [PATCH 06/10] mips: replace code inside ifdef with generic function
Date: Fri, 25 Apr 2008 00:23:06 -0300

this patch replaced code inside specific ifdef in translate-all.c
with a generic architecture-implemented function. This leads to a
cleaner and more modular code in the generic part.
---
 target-mips/translate.c |    8 ++++++++
 translate-all.c         |    4 +---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/target-mips/translate.c b/target-mips/translate.c
index 65f0ba9..46b917e 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -6942,3 +6942,11 @@ void cpu_reset (CPUMIPSState *env)
 #endif
     cpu_mips_register(env, env->cpu_model);
 }
+
+void gen_pc_load(CPUState *env, TranslationBlock *tb,
+                unsigned long searched_pc, int pc_pos, void *puc)
+{
+    env->PC[env->current_tc] = gen_opc_pc[pc_pos];
+    env->hflags &= ~MIPS_HFLAG_BMASK;
+    env->hflags |= gen_opc_hflags[pc_pos];
+}
diff --git a/translate-all.c b/translate-all.c
index 5e63978..d2408f6 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -204,9 +204,7 @@ int cpu_restore_state(TranslationBlock *tb,
 #elif defined(TARGET_M68K)
     gen_pc_load(env, tb, searched_pc, j, puc); 
 #elif defined(TARGET_MIPS)
-    env->PC[env->current_tc] = gen_opc_pc[j];
-    env->hflags &= ~MIPS_HFLAG_BMASK;
-    env->hflags |= gen_opc_hflags[j];
+    gen_pc_load(env, tb, searched_pc, j, puc); 
 #elif defined(TARGET_ALPHA)
     env->pc = gen_opc_pc[j];
 #elif defined(TARGET_SH4)
-- 
1.5.0.6





reply via email to

[Prev in Thread] Current Thread [Next in Thread]