This adds an extra op to translator to allow the block hook sync pc in the very begining
This commit is contained in:
2025-01-18 15:07:22 +08:00
parent a78d690da5
commit 0c512f91a1
12 changed files with 85 additions and 0 deletions

View File

@@ -6414,6 +6414,13 @@ static void m68k_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
}
}
void m68k_sync_pc(DisasContextBase *db, CPUState *cpu)
{
DisasContext *dc = container_of(db, DisasContext, base);
tcg_gen_movi_i32(dc->uc->tcg_ctx, QREG_PC, dc->base.pc_next);
}
static const TranslatorOps m68k_tr_ops = {
.init_disas_context = m68k_tr_init_disas_context,
.tb_start = m68k_tr_tb_start,
@@ -6421,6 +6428,7 @@ static const TranslatorOps m68k_tr_ops = {
.breakpoint_check = m68k_tr_breakpoint_check,
.translate_insn = m68k_tr_translate_insn,
.tb_stop = m68k_tr_tb_stop,
.pc_sync = m68k_sync_pc
};
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns)