[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/7] target/nios2: Remove assignment to env in handle_instruction
From: |
Richard Henderson |
Subject: |
[PATCH 6/7] target/nios2: Remove assignment to env in handle_instruction |
Date: |
Sat, 19 Jun 2021 22:25:42 -0700 |
Direct assignments to env during translation do not work.
As it happens, the only way we can get here is if env->pc
is already set to dc->pc. We will trap on the first insn
we execute anywhere on the page.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/nios2/translate.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index e2c8151193..ce4a4c40aa 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -740,14 +740,15 @@ static void handle_instruction(DisasContext *dc,
CPUNios2State *env)
uint32_t code;
uint8_t op;
const Nios2Instruction *instr;
+
#if defined(CONFIG_USER_ONLY)
/* FIXME: Is this needed ? */
if (dc->pc >= 0x1000 && dc->pc < 0x2000) {
- env->regs[R_PC] = dc->pc;
t_gen_helper_raise_exception(dc, 0xaa);
return;
}
#endif
+
code = cpu_ldl_code(env, dc->pc);
op = get_opcode(code);
--
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, 2021/06/20
- [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 <=
- [PATCH 5/7] target/nios2: Convert to TranslatorOps, Richard Henderson, 2021/06/20