aboutsummaryrefslogtreecommitdiff
path: root/target/nios2
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-06-19 22:15:35 -0700
committerRichard Henderson <richard.henderson@linaro.org>2021-06-29 10:02:32 -0700
commit50e1a0cd3cf7cc2b56fee6523882014fda95dc95 (patch)
tree2342346285b6c167e08e0641da2612d88b35eb62 /target/nios2
parentd67cbd932187fecf70d38bd113fa985209b72671 (diff)
target/nios2: Remove assignment to env in handle_instruction
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. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/nios2')
-rw-r--r--target/nios2/translate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 66f4c25b06..6fd4330b31 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);