diff --git a/qemu/include/exec/gen-icount.h b/qemu/include/exec/gen-icount.h index b6032fda..085a5eb9 100644 --- a/qemu/include/exec/gen-icount.h +++ b/qemu/include/exec/gen-icount.h @@ -28,7 +28,7 @@ static inline void gen_tb_start(TCGContext *tcg_ctx) icount_label = gen_new_label(tcg_ctx); count = tcg_temp_local_new_i32(tcg_ctx); - tcg_gen_ld_i32(tcg_ctx, count, cpu_env, + tcg_gen_ld_i32(tcg_ctx, count, tcg_ctx->tcg_env, -ENV_OFFSET + offsetof(CPUState, icount_decr.u32)); imm = tcg_temp_new_i32(tcg_ctx); /* We emit a movi with a dummy immediate argument. Keep the insn index @@ -41,7 +41,7 @@ static inline void gen_tb_start(TCGContext *tcg_ctx) tcg_temp_free_i32(tcg_ctx, imm); tcg_gen_brcondi_i32(tcg_ctx, TCG_COND_LT, count, 0, icount_label); - tcg_gen_st16_i32(tcg_ctx, count, cpu_env, + tcg_gen_st16_i32(tcg_ctx, count, tcg_ctx->tcg_env, -ENV_OFFSET + offsetof(CPUState, icount_decr.u16.low)); tcg_temp_free_i32(tcg_ctx, count); #endif @@ -57,8 +57,8 @@ static inline void gen_tb_end(TCGContext *tcg_ctx, TranslationBlock *tb, int num /* Update the num_insn immediate parameter now that we know * the actual insn count. */ tcg_set_insn_param(tcg_ctx, icount_start_insn_idx, 1, num_insns); - gen_set_label(icount_label); - tcg_gen_exit_tb((uintptr_t)tb + TB_EXIT_ICOUNT_EXPIRED); + gen_set_label(tcg_ctx, icount_label); + tcg_gen_exit_tb(tcg_ctx, (uintptr_t)tb + TB_EXIT_ICOUNT_EXPIRED); } #endif @@ -68,18 +68,18 @@ static inline void gen_tb_end(TCGContext *tcg_ctx, TranslationBlock *tb, int num } #if 0 -static inline void gen_io_start(void) +static inline void gen_io_start(TCGContext *tcg_ctx) { - TCGv_i32 tmp = tcg_const_i32(1); - tcg_gen_st_i32(tmp, cpu_env, -ENV_OFFSET + offsetof(CPUState, can_do_io)); - tcg_temp_free_i32(tmp); + TCGv_i32 tmp = tcg_const_i32(tcg_ctx, 1); + tcg_gen_st_i32(tcg_ctx, tmp, tcg_ctx->tcg_env, -ENV_OFFSET + offsetof(CPUState, can_do_io)); + tcg_temp_free_i32(tcg_ctx, tmp); } -static inline void gen_io_end(void) +static inline void gen_io_end(TCGContext *tcg_ctx) { - TCGv_i32 tmp = tcg_const_i32(0); - tcg_gen_st_i32(tmp, cpu_env, -ENV_OFFSET + offsetof(CPUState, can_do_io)); - tcg_temp_free_i32(tmp); + TCGv_i32 tmp = tcg_const_i32(tcg_ctx, 0); + tcg_gen_st_i32(tcg_ctx, tmp, tcg_ctx->tcg_env, -ENV_OFFSET + offsetof(CPUState, can_do_io)); + tcg_temp_free_i32(tcg_ctx, tmp); } #endif