target/riscv: Convert to tcg_ops restore_state_to_opc

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2022-10-24 20:49:27 +10:00
parent 61bd1d2942
commit ad1e84f504
1 changed files with 7 additions and 2 deletions

View File

@ -503,10 +503,14 @@ static bool riscv_cpu_has_work(CPUState *cs)
#endif #endif
} }
void restore_state_to_opc(CPURISCVState *env, TranslationBlock *tb, static void riscv_restore_state_to_opc(CPUState *cs,
target_ulong *data) const TranslationBlock *tb,
const uint64_t *data)
{ {
RISCVCPU *cpu = RISCV_CPU(cs);
CPURISCVState *env = &cpu->env;
RISCVMXL xl = FIELD_EX32(tb->flags, TB_FLAGS, XL); RISCVMXL xl = FIELD_EX32(tb->flags, TB_FLAGS, XL);
if (xl == MXL_RV32) { if (xl == MXL_RV32) {
env->pc = (int32_t)data[0]; env->pc = (int32_t)data[0];
} else { } else {
@ -1138,6 +1142,7 @@ static const struct SysemuCPUOps riscv_sysemu_ops = {
static const struct TCGCPUOps riscv_tcg_ops = { static const struct TCGCPUOps riscv_tcg_ops = {
.initialize = riscv_translate_init, .initialize = riscv_translate_init,
.synchronize_from_tb = riscv_cpu_synchronize_from_tb, .synchronize_from_tb = riscv_cpu_synchronize_from_tb,
.restore_state_to_opc = riscv_restore_state_to_opc,
#ifndef CONFIG_USER_ONLY #ifndef CONFIG_USER_ONLY
.tlb_fill = riscv_cpu_tlb_fill, .tlb_fill = riscv_cpu_tlb_fill,