Commit bad729e2 authored by Richard Henderson's avatar Richard Henderson
Browse files

tcg: Pass data argument to restore_state_to_opc



The gen_opc_* arrays are already redundant with the data stored in
the insn_start arguments.  Transition restore_state_to_opc to use
data from the latter.

Reviewed-by: default avatarAurelien Jarno <aurelien@aurel32.net>
Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarRichard Henderson <rth@twiddle.net>
parent 190ce7fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ typedef struct TranslationBlock TranslationBlock;
void gen_intermediate_code(CPUArchState *env, struct TranslationBlock *tb);
void gen_intermediate_code_pc(CPUArchState *env, struct TranslationBlock *tb);
void restore_state_to_opc(CPUArchState *env, struct TranslationBlock *tb,
                          int pc_pos);
                          target_ulong *data);

void cpu_gen_init(void);
bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc);
+3 −2
Original line number Diff line number Diff line
@@ -3023,7 +3023,8 @@ void gen_intermediate_code_pc (CPUAlphaState *env, struct TranslationBlock *tb)
    gen_intermediate_code_internal(alpha_env_get_cpu(env), tb, true);
}

void restore_state_to_opc(CPUAlphaState *env, TranslationBlock *tb, int pc_pos)
void restore_state_to_opc(CPUAlphaState *env, TranslationBlock *tb,
                          target_ulong *data)
{
    env->pc = tcg_ctx.gen_opc_pc[pc_pos];
    env->pc = data[0];
}
+5 −4
Original line number Diff line number Diff line
@@ -11612,13 +11612,14 @@ void arm_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
    }
}

void restore_state_to_opc(CPUARMState *env, TranslationBlock *tb, int pc_pos)
void restore_state_to_opc(CPUARMState *env, TranslationBlock *tb,
                          target_ulong *data)
{
    if (is_a64(env)) {
        env->pc = tcg_ctx.gen_opc_pc[pc_pos];
        env->pc = data[0];
        env->condexec_bits = 0;
    } else {
        env->regs[15] = tcg_ctx.gen_opc_pc[pc_pos];
        env->condexec_bits = gen_opc_condexec_bits[pc_pos];
        env->regs[15] = data[0];
        env->condexec_bits = data[1];
    }
}
+3 −2
Original line number Diff line number Diff line
@@ -3433,7 +3433,8 @@ void cris_initialize_tcg(void)
    }
}

void restore_state_to_opc(CPUCRISState *env, TranslationBlock *tb, int pc_pos)
void restore_state_to_opc(CPUCRISState *env, TranslationBlock *tb,
                          target_ulong *data)
{
    env->pc = tcg_ctx.gen_opc_pc[pc_pos];
    env->pc = data[0];
}
+6 −20
Original line number Diff line number Diff line
@@ -8055,26 +8055,12 @@ void gen_intermediate_code_pc(CPUX86State *env, TranslationBlock *tb)
    gen_intermediate_code_internal(x86_env_get_cpu(env), tb, true);
}

void restore_state_to_opc(CPUX86State *env, TranslationBlock *tb, int pc_pos)
void restore_state_to_opc(CPUX86State *env, TranslationBlock *tb,
                          target_ulong *data)
{
    int cc_op;
#ifdef DEBUG_DISAS
    if (qemu_loglevel_mask(CPU_LOG_TB_OP)) {
        int i;
        qemu_log("RESTORE:\n");
        for(i = 0;i <= pc_pos; i++) {
            if (tcg_ctx.gen_opc_instr_start[i]) {
                qemu_log("0x%04x: " TARGET_FMT_lx "\n", i,
                        tcg_ctx.gen_opc_pc[i]);
            }
        }
        qemu_log("pc_pos=0x%x eip=" TARGET_FMT_lx " cs_base=%x\n",
                pc_pos, tcg_ctx.gen_opc_pc[pc_pos] - tb->cs_base,
                (uint32_t)tb->cs_base);
    }
#endif
    env->eip = tcg_ctx.gen_opc_pc[pc_pos] - tb->cs_base;
    cc_op = gen_opc_cc_op[pc_pos];
    if (cc_op != CC_OP_DYNAMIC)
    int cc_op = data[1];
    env->eip = data[0] - tb->cs_base;
    if (cc_op != CC_OP_DYNAMIC) {
        env->cc_op = cc_op;
    }
}
Loading