[PATCH 02/10] arm: replace code inside ifdef with generic function

Glauber Costa
2008-04-25T03:23:02Z

target-arm/translate.c | 5 +++++
translate-all.c | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 6de78f8..8966996 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -7706,3 +7706,8 @@ void cpu_dump_state(CPUState *env, FILE *f,
cpu_fprintf(f, "FPSCR: %08x\n", (int)env->vfp.xregs[ARM_VFP_FPSCR]);
}

+void gen_pc_load(CPUState *env, TranslationBlock *tb,
+ unsigned long searched_pc, int pc_pos, void *puc)
+{
+ env->regs[15] = gen_opc_pc[pc_pos];
+}
diff --git a/translate-all.c b/translate-all.c
index 73e1d67..e688318 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -196,7 +196,7 @@ int cpu_restore_state(TranslationBlock *tb,
#if defined(TARGET_I386)
gen_pc_load(env, tb, searched_pc, j, puc);
#elif defined(TARGET_ARM)
- env->regs[15] = gen_opc_pc[j];
+ gen_pc_load(env, tb, searched_pc, j, puc);
#elif defined(TARGET_SPARC)
{
target_ulong npc;