From b09a8626f09e5c9f2a34e320adf5758ae16cab1f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 21 Feb 2018 01:38:07 -0500 Subject: [PATCH] tcg: Make cpu_hver a TCGv --- qemu/target-sparc/translate.c | 5 ++--- qemu/tcg/tcg.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/qemu/target-sparc/translate.c b/qemu/target-sparc/translate.c index 18542448..e83fecab 100644 --- a/qemu/target-sparc/translate.c +++ b/qemu/target-sparc/translate.c @@ -2946,7 +2946,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn, bool hook_ins tcg_gen_mov_tl(tcg_ctx, cpu_dst, tcg_ctx->cpu_htba); break; case 6: // hver - tcg_gen_mov_tl(tcg_ctx, cpu_dst, *(TCGv *)tcg_ctx->cpu_hver); + tcg_gen_mov_tl(tcg_ctx, cpu_dst, tcg_ctx->cpu_hver); break; case 31: // hstick_cmpr tcg_gen_mov_tl(tcg_ctx, cpu_dst, tcg_ctx->cpu_hstick_cmpr); @@ -5554,8 +5554,7 @@ void gen_intermediate_code_init(CPUSPARCState *env) tcg_ctx->cpu_htba = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env, offsetof(CPUSPARCState, htba), "htba"); - tcg_ctx->cpu_hver = g_malloc0(sizeof(TCGv)); - *(TCGv *)tcg_ctx->cpu_hver = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env, offsetof(CPUSPARCState, hver), + tcg_ctx->cpu_hver = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env, offsetof(CPUSPARCState, hver), "hver"); tcg_ctx->cpu_ssr = g_malloc0(sizeof(TCGv)); diff --git a/qemu/tcg/tcg.h b/qemu/tcg/tcg.h index ff51c0fe..93adb7c1 100644 --- a/qemu/tcg/tcg.h +++ b/qemu/tcg/tcg.h @@ -845,7 +845,7 @@ struct TCGContext { TCGv cpu_hstick_cmpr; TCGv cpu_hintp; TCGv cpu_htba; - void *cpu_hver; + TCGv cpu_hver; void *cpu_ssr; void *cpu_ver; void *cpu_wim;