[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH v2 09/23] target/arm: Move code around
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-arm] [PATCH v2 09/23] target/arm: Move code around |
Date: |
Sat, 15 Jun 2019 17:43:38 +0200 |
To ease the review of the next commit, move the
write_v7m_exception() function around.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
target/arm/helper.c | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index a829086c6d..b4fd9b42d7 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -7923,26 +7923,6 @@ void write_v7m_control_spsel(CPUARMState *env, bool
new_spsel)
write_v7m_control_spsel_for_secstate(env, new_spsel, env->v7m.secure);
}
-void write_v7m_exception(CPUARMState *env, uint32_t new_exc)
-{
- /*
- * Write a new value to v7m.exception, thus transitioning into or out
- * of Handler mode; this may result in a change of active stack pointer.
- */
- bool new_is_psp, old_is_psp = v7m_using_psp(env);
- uint32_t tmp;
-
- env->v7m.exception = new_exc;
-
- new_is_psp = v7m_using_psp(env);
-
- if (old_is_psp != new_is_psp) {
- tmp = env->v7m.other_sp;
- env->v7m.other_sp = env->regs[13];
- env->regs[13] = tmp;
- }
-}
-
/* Switch M profile security state between NS and S */
void switch_v7m_security_state(CPUARMState *env, bool new_secstate)
{
@@ -9247,6 +9227,26 @@ static bool do_v7m_function_return(ARMCPU *cpu)
return true;
}
+void write_v7m_exception(CPUARMState *env, uint32_t new_exc)
+{
+ /*
+ * Write a new value to v7m.exception, thus transitioning into or out
+ * of Handler mode; this may result in a change of active stack pointer.
+ */
+ bool new_is_psp, old_is_psp = v7m_using_psp(env);
+ uint32_t tmp;
+
+ env->v7m.exception = new_exc;
+
+ new_is_psp = v7m_using_psp(env);
+
+ if (old_is_psp != new_is_psp) {
+ tmp = env->v7m.other_sp;
+ env->v7m.other_sp = env->regs[13];
+ env->regs[13] = tmp;
+ }
+}
+
void arm_log_exception(int idx)
{
if (qemu_loglevel_mask(CPU_LOG_INT)) {
--
2.20.1
- Re: [Qemu-arm] [PATCH v2 02/23] target/arm: Makefile cleanup (ARM), (continued)
- [Qemu-arm] [PATCH v2 03/23] target/arm: Makefile cleanup (KVM), Philippe Mathieu-Daudé, 2019/06/15
- [Qemu-arm] [PATCH v2 05/23] target/arm: Add copyright boilerplate, Philippe Mathieu-Daudé, 2019/06/15
- [Qemu-arm] [PATCH v2 04/23] target/arm: Makefile cleanup (softmmu), Philippe Mathieu-Daudé, 2019/06/15
- [Qemu-arm] [PATCH v2 07/23] target/arm: Declare some function publicly, Philippe Mathieu-Daudé, 2019/06/15
- [Qemu-arm] [PATCH v2 09/23] target/arm: Move code around,
Philippe Mathieu-Daudé <=
- [Qemu-arm] [PATCH v2 06/23] target/arm: Fix multiline comment syntax, Philippe Mathieu-Daudé, 2019/06/15
- [Qemu-arm] [PATCH v2 10/23] target/arm: Move the v7-M Security State helpers to v7m_helper, Philippe Mathieu-Daudé, 2019/06/15
- [Qemu-arm] [PATCH v2 11/23] target/arm: Declare v7m_cpacr_pass() publicly, Philippe Mathieu-Daudé, 2019/06/15
- [Qemu-arm] [PATCH v2 14/23] target/arm: Move the DC ZVA helper into op_helper, Philippe Mathieu-Daudé, 2019/06/15
- [Qemu-arm] [PATCH v2 08/23] target/arm: Move all v7m insn helpers into their own file, Philippe Mathieu-Daudé, 2019/06/15