mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13: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
|
@ -39,8 +39,6 @@
|
|||
void tlb_fill(CPUOpenRISCState *env, target_ulong addr, int is_write,
|
||||
int mmu_idx, uintptr_t retaddr)
|
||||
{
|
||||
TranslationBlock *tb;
|
||||
unsigned long pc;
|
||||
int ret;
|
||||
|
||||
ret = cpu_openrisc_handle_mmu_fault(env, addr, is_write, mmu_idx);
|
||||
|
@ -48,13 +46,7 @@ void tlb_fill(CPUOpenRISCState *env, target_ulong addr, int is_write,
|
|||
if (ret) {
|
||||
if (retaddr) {
|
||||
/* now we have a real cpu fault. */
|
||||
pc = (unsigned long)retaddr;
|
||||
tb = tb_find_pc(pc);
|
||||
if (tb) {
|
||||
/* the PC is inside the translated code. It means that we
|
||||
have a virtual CPU fault. */
|
||||
cpu_restore_state(tb, env, pc);
|
||||
}
|
||||
cpu_restore_state(env, retaddr);
|
||||
}
|
||||
/* Raise Exception. */
|
||||
cpu_loop_exit(env);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue