[Top][All Lists]
[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
- [Qemu-devel] [PATCH 0/10] Factorize code in translate.c, Glauber Costa, 2008/04/24
- [Qemu-devel] [PATCH 01/10] i386: replace code inside ifdef with generic function, Glauber Costa, 2008/04/24
- [Qemu-devel] [PATCH 02/10] arm: replace code inside ifdef with generic function, Glauber Costa, 2008/04/24
- [Qemu-devel] [PATCH 03/10] sparc: replace code inside ifdef with generic function, Glauber Costa, 2008/04/24
- [Qemu-devel] [PATCH 04/10] ppc: replace code inside ifdef with generic function, Glauber Costa, 2008/04/24
- [Qemu-devel] [PATCH 05/10] m68k: replace code inside ifdef with generic function, Glauber Costa, 2008/04/24
- [Qemu-devel] [PATCH 06/10] mips: replace code inside ifdef with generic function,
Glauber Costa <=
- [Qemu-devel] [PATCH 07/10] alpha: replace code inside ifdef with generic function, Glauber Costa, 2008/04/24
- [Qemu-devel] [PATCH 08/10] sh4: replace code inside ifdef with generic function, Glauber Costa, 2008/04/24
- [Qemu-devel] [PATCH 09/10] cris: replace code inside ifdef with generic function, Glauber Costa, 2008/04/24
- [Qemu-devel] [PATCH 10/10] remove arch-specific ifdefs from translate-all.c, Glauber Costa, 2008/04/24