[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/11] target/arm: Replace offset with pc in gen_exc
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 08/11] target/arm: Replace offset with pc in gen_exception_internal_insn |
Date: |
Tue, 6 Aug 2019 21:53:32 -0700 |
The offset is variable depending on the instruction set.
Passing in the actual value is clearer in intent.
Signed-off-by: Richard Henderson <address@hidden>
---
target/arm/translate-a64.c | 8 ++++----
target/arm/translate.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 92aa6db12e..c8504d221a 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -266,9 +266,9 @@ static void gen_exception(int excp, uint32_t syndrome,
uint32_t target_el)
tcg_temp_free_i32(tcg_excp);
}
-static void gen_exception_internal_insn(DisasContext *s, int offset, int excp)
+static void gen_exception_internal_insn(DisasContext *s, uint64_t pc, int excp)
{
- gen_a64_set_pc_im(s->base.pc_next - offset);
+ gen_a64_set_pc_im(pc);
gen_exception_internal(excp);
s->base.is_jmp = DISAS_NORETURN;
}
@@ -1938,7 +1938,7 @@ static void disas_exc(DisasContext *s, uint32_t insn)
break;
}
#endif
- gen_exception_internal_insn(s, 0, EXCP_SEMIHOST);
+ gen_exception_internal_insn(s, s->base.pc_next, EXCP_SEMIHOST);
} else {
unsupported_encoding(s, insn);
}
@@ -14234,7 +14234,7 @@ static bool
aarch64_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cpu,
/* End the TB early; it likely won't be executed */
dc->base.is_jmp = DISAS_TOO_MANY;
} else {
- gen_exception_internal_insn(dc, 0, EXCP_DEBUG);
+ gen_exception_internal_insn(dc, dc->base.pc_next, EXCP_DEBUG);
/* The address covered by the breakpoint must be
included in [tb->pc, tb->pc + tb->size) in order
to for it to be properly cleared -- thus we
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 7a05ecae87..e6b18ecdaf 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -1256,10 +1256,10 @@ static inline void gen_smc(DisasContext *s)
s->base.is_jmp = DISAS_SMC;
}
-static void gen_exception_internal_insn(DisasContext *s, int offset, int excp)
+static void gen_exception_internal_insn(DisasContext *s, uint32_t pc, int excp)
{
gen_set_condexec(s);
- gen_set_pc_im(s, s->base.pc_next - offset);
+ gen_set_pc_im(s, pc);
gen_exception_internal(excp);
s->base.is_jmp = DISAS_NORETURN;
}
@@ -1311,7 +1311,7 @@ static inline void gen_hlt(DisasContext *s, int imm)
s->current_el != 0 &&
#endif
(imm == (s->thumb ? 0x3c : 0xf000))) {
- gen_exception_internal_insn(s, 0, EXCP_SEMIHOST);
+ gen_exception_internal_insn(s, s->base.pc_next, EXCP_SEMIHOST);
return;
}
@@ -11953,7 +11953,7 @@ static bool arm_tr_breakpoint_check(DisasContextBase
*dcbase, CPUState *cpu,
/* End the TB early; it's likely not going to be executed */
dc->base.is_jmp = DISAS_TOO_MANY;
} else {
- gen_exception_internal_insn(dc, 0, EXCP_DEBUG);
+ gen_exception_internal_insn(dc, dc->base.pc_next, EXCP_DEBUG);
/* The address covered by the breakpoint must be
included in [tb->pc, tb->pc + tb->size) in order
to for it to be properly cleared -- thus we
--
2.17.1
- [Qemu-devel] [PATCH 02/11] target/arm: Introduce pc_curr, (continued)
[Qemu-devel] [PATCH 05/11] target/arm: Remove redundant s->pc & ~1, Richard Henderson, 2019/08/07
[Qemu-devel] [PATCH 04/11] target/arm: Introduce add_reg_for_lit, Richard Henderson, 2019/08/07
[Qemu-devel] [PATCH 07/11] target/arm: Replace offset with pc in gen_exception_insn, Richard Henderson, 2019/08/07
[Qemu-devel] [PATCH 08/11] target/arm: Replace offset with pc in gen_exception_internal_insn,
Richard Henderson <=
[Qemu-devel] [PATCH 09/11] target/arm: Remove offset argument to gen_exception_bkpt_insn, Richard Henderson, 2019/08/07
[Qemu-devel] [PATCH 10/11] target/arm: Use unallocated_encoding for aarch32, Richard Henderson, 2019/08/07
[Qemu-devel] [PATCH 11/11] target/arm: Remove helper_double_saturate, Richard Henderson, 2019/08/07
[Qemu-devel] [PATCH 06/11] target/arm: Replace s->pc with s->base.pc_next, Richard Henderson, 2019/08/07
Re: [Qemu-devel] [PATCH 00/11] target/arm: decodetree prep patches, Peter Maydell, 2019/08/07