[PATCH 09/10] cris: replace code inside ifdef with generic function

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

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

diff --git a/target-cris/translate.c b/target-cris/translate.c
index 5769175..e522678 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -2701,3 +2701,9 @@ void cpu_reset (CPUCRISState *env)
memset(env, 0, offsetof(CPUCRISState, breakpoints));
tlb_flush(env, 1);
}
+
+void gen_pc_load(CPUState *env, struct TranslationBlock *tb,
+ unsigned long searched_pc, int pc_pos, void *puc)
+{
+ env->pregs[PR_ERP] = gen_opc_pc[pc_pos];
+}
diff --git a/translate-all.c b/translate-all.c
index 401969c..3afb656 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -210,7 +210,7 @@ int cpu_restore_state(TranslationBlock *tb,
#elif defined(TARGET_SH4)
gen_pc_load(env, tb, searched_pc, j, puc);
#elif defined(TARGET_CRIS)
- env->pregs[PR_ERP] = gen_opc_pc[j];
+ gen_pc_load(env, tb, searched_pc, j, puc);
#endif

#ifdef CONFIG_PROFILER