Skip to content

Commit

Permalink
target/nios2: Convert to tcg_ops restore_state_to_opc
Browse files Browse the repository at this point in the history
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Oct 26, 2022
1 parent 3766855 commit fbd5bd4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 11 additions & 0 deletions target/nios2/cpu.c
Expand Up @@ -42,6 +42,16 @@ static vaddr nios2_cpu_get_pc(CPUState *cs)
return env->pc;
}

static void nios2_restore_state_to_opc(CPUState *cs,
const TranslationBlock *tb,
const uint64_t *data)
{
Nios2CPU *cpu = NIOS2_CPU(cs);
CPUNios2State *env = &cpu->env;

env->pc = data[0];
}

static bool nios2_cpu_has_work(CPUState *cs)
{
return cs->interrupt_request & CPU_INTERRUPT_HARD;
Expand Down Expand Up @@ -346,6 +356,7 @@ static const struct SysemuCPUOps nios2_sysemu_ops = {

static const struct TCGCPUOps nios2_tcg_ops = {
.initialize = nios2_tcg_init,
.restore_state_to_opc = nios2_restore_state_to_opc,

#ifndef CONFIG_USER_ONLY
.tlb_fill = nios2_cpu_tlb_fill,
Expand Down
6 changes: 0 additions & 6 deletions target/nios2/translate.c
Expand Up @@ -1110,9 +1110,3 @@ void nios2_tcg_init(void)
cpu_pc = tcg_global_mem_new(cpu_env,
offsetof(CPUNios2State, pc), "pc");
}

void restore_state_to_opc(CPUNios2State *env, TranslationBlock *tb,
target_ulong *data)
{
env->pc = data[0];
}

0 comments on commit fbd5bd4

Please sign in to comment.