mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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:
parent
5b6dd8683d
commit
a8a826a3c3
23 changed files with 65 additions and 172 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue