From 72170ae5c0eb1fecd8de63977ee2581180ae7b59 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 20 Feb 2018 23:43:52 -0500 Subject: [PATCH] tcg: Make cpu_A0 a TCGv Commit 5d4e1a1081d3f1ec2908ff0eaebe312389971ab4 allows us to make the type concrete. --- qemu/target-i386/translate.c | 6 ++---- qemu/target-i386/unicorn.c | 1 - qemu/tcg/tcg.h | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/qemu/target-i386/translate.c b/qemu/target-i386/translate.c index 45fb6131..de14df09 100644 --- a/qemu/target-i386/translate.c +++ b/qemu/target-i386/translate.c @@ -4884,7 +4884,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, TCGv_i32 cpu_tmp2_i32 = tcg_ctx->cpu_tmp2_i32; TCGv_i32 cpu_tmp3_i32 = tcg_ctx->cpu_tmp3_i32; TCGv_i64 cpu_tmp1_i64 = tcg_ctx->cpu_tmp1_i64; - TCGv cpu_A0 = *(TCGv *)tcg_ctx->cpu_A0; + TCGv cpu_A0 = tcg_ctx->cpu_A0; TCGv cpu_cc_dst = *(TCGv *)tcg_ctx->cpu_cc_dst; TCGv cpu_cc_src = *(TCGv *)tcg_ctx->cpu_cc_src; TCGv cpu_cc_srcT = *(TCGv *)tcg_ctx->cpu_cc_srcT; @@ -8947,9 +8947,7 @@ void gen_intermediate_code(CPUX86State *env, TranslationBlock *tb) tcg_ctx->cpu_T1 = g_malloc0(sizeof(TCGv)); *((TCGv *)tcg_ctx->cpu_T1) = tcg_temp_new(tcg_ctx); - if (!env->uc->init_tcg) - tcg_ctx->cpu_A0 = g_malloc0(sizeof(TCGv)); - *((TCGv *)tcg_ctx->cpu_A0) = tcg_temp_new(tcg_ctx); + tcg_ctx->cpu_A0 = tcg_temp_new(tcg_ctx); if (!env->uc->init_tcg) tcg_ctx->cpu_tmp0 = g_malloc0(sizeof(TCGv)); diff --git a/qemu/target-i386/unicorn.c b/qemu/target-i386/unicorn.c index ab8f59eb..8d992cb2 100644 --- a/qemu/target-i386/unicorn.c +++ b/qemu/target-i386/unicorn.c @@ -37,7 +37,6 @@ void x86_release(void *ctx) release_common(ctx); // arch specific - g_free(s->cpu_A0); g_free(s->cpu_T0); g_free(s->cpu_T1); g_free(s->cpu_tmp0); diff --git a/qemu/tcg/tcg.h b/qemu/tcg/tcg.h index 01e43428..fcab1efe 100644 --- a/qemu/tcg/tcg.h +++ b/qemu/tcg/tcg.h @@ -736,7 +736,7 @@ struct TCGContext { int x86_64_hregs; // qemu/target-i386/translate.c /* qemu/target-i386/translate.c: global TCGv vars */ - void *cpu_A0; + TCGv cpu_A0; void *cpu_cc_dst, *cpu_cc_src, *cpu_cc_src2, *cpu_cc_srcT; /* qemu/target-i386/translate.c: local temps */