[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/7] target/nios2: Use global cpu_env
From: |
Richard Henderson |
Subject: |
[PATCH 2/7] target/nios2: Use global cpu_env |
Date: |
Sat, 19 Jun 2021 22:25:38 -0700 |
We do not need to copy this into DisasContext.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/nios2/translate.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 388fae93a2..39538e1870 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -97,7 +97,6 @@
}
typedef struct DisasContext {
- TCGv_ptr cpu_env;
TCGv *cpu_R;
TCGv_i32 zero;
int is_jmp;
@@ -147,7 +146,7 @@ static void t_gen_helper_raise_exception(DisasContext *dc,
TCGv_i32 tmp = tcg_const_i32(index);
tcg_gen_movi_tl(dc->cpu_R[R_PC], dc->pc);
- gen_helper_raise_exception(dc->cpu_env, tmp);
+ gen_helper_raise_exception(cpu_env, tmp);
tcg_temp_free_i32(tmp);
dc->is_jmp = DISAS_NORETURN;
}
@@ -474,7 +473,7 @@ static void rdctl(DisasContext *dc, uint32_t code, uint32_t
flags)
tcg_gen_mov_tl(dc->cpu_R[instr.c], dc->cpu_R[instr.imm5 +
CR_BASE]);
#ifdef DEBUG_MMU
TCGv_i32 tmp = tcg_const_i32(instr.imm5 + CR_BASE);
- gen_helper_mmu_read_debug(dc->cpu_R[instr.c], dc->cpu_env, tmp);
+ gen_helper_mmu_read_debug(dc->cpu_R[instr.c], cpu_env, tmp);
tcg_temp_free_i32(tmp);
#endif
}
@@ -504,7 +503,7 @@ static void wrctl(DisasContext *dc, uint32_t code, uint32_t
flags)
{
#if !defined(CONFIG_USER_ONLY)
TCGv_i32 tmp = tcg_const_i32(instr.imm5 + CR_BASE);
- gen_helper_mmu_write(dc->cpu_env, tmp, load_gpr(dc, instr.a));
+ gen_helper_mmu_write(cpu_env, tmp, load_gpr(dc, instr.a));
tcg_temp_free_i32(tmp);
#endif
break;
@@ -521,7 +520,7 @@ static void wrctl(DisasContext *dc, uint32_t code, uint32_t
flags)
if (tb_cflags(dc->tb) & CF_USE_ICOUNT) {
gen_io_start();
}
- gen_helper_check_interrupts(dc->cpu_env);
+ gen_helper_check_interrupts(cpu_env);
dc->is_jmp = DISAS_UPDATE;
}
#endif
@@ -817,7 +816,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock
*tb, int max_insns)
int num_insns;
/* Initialize DC */
- dc->cpu_env = cpu_env;
dc->cpu_R = cpu_R;
dc->is_jmp = DISAS_NEXT;
dc->pc = tb->pc;
--
2.25.1
- [PATCH 0/7] target/nios2: Convert to TranslatorOps, Richard Henderson, 2021/06/20
- [PATCH 1/7] target/nios2: Replace DISAS_TB_JUMP with DISAS_NORETURN, Richard Henderson, 2021/06/20
- [PATCH 2/7] target/nios2: Use global cpu_env,
Richard Henderson <=
- [PATCH 7/7] target/nios2: Clean up goto in handle_instruction, Richard Henderson, 2021/06/20
- [PATCH 3/7] target/nios2: Use global cpu_R, Richard Henderson, 2021/06/20
- [PATCH 4/7] target/nios2: Add DisasContextBase to DisasContext, Richard Henderson, 2021/06/20
- [PATCH 6/7] target/nios2: Remove assignment to env in handle_instruction, Richard Henderson, 2021/06/20
- [PATCH 5/7] target/nios2: Convert to TranslatorOps, Richard Henderson, 2021/06/20