exec: refactor cpu_restore_state

Refactor common code around calls to cpu_restore_state().

tb_find_pc() has now no external users, make it static.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2012-12-04 20:16:07 +00:00
parent 5b6dd8683d
commit a8a826a3c3
23 changed files with 65 additions and 172 deletions

View file

@ -494,16 +494,6 @@ void cpu_dump_state (CPUAlphaState *env, FILE *f, fprintf_function cpu_fprintf,
cpu_fprintf(f, "\n");
}
void do_restore_state(CPUAlphaState *env, uintptr_t retaddr)
{
if (retaddr) {
TranslationBlock *tb = tb_find_pc(retaddr);
if (tb) {
cpu_restore_state(tb, env, retaddr);
}
}
}
/* This should only be called from translate, via gen_excp.
We expect that ENV->PC has already been updated. */
void QEMU_NORETURN helper_excp(CPUAlphaState *env, int excp, int error)
@ -519,7 +509,9 @@ void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, uintptr_t retaddr,
{
env->exception_index = excp;
env->error_code = error;
do_restore_state(env, retaddr);
if (retaddr) {
cpu_restore_state(env, retaddr);
}
cpu_loop_exit(env);
}