[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v2 09/23] target/arm: Move code around
From: |
Alex Bennée |
Subject: |
Re: [Qemu-arm] [PATCH v2 09/23] target/arm: Move code around |
Date: |
Mon, 17 Jun 2019 15:07:58 +0100 |
User-agent: |
mu4e 1.3.2; emacs 26.1 |
Philippe Mathieu-Daudé <address@hidden> writes:
> To ease the review of the next commit, move the
> write_v7m_exception() function around.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Alex Bennée <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)) {
--
Alex Bennée
- 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é, 2019/06/15
- Re: [Qemu-arm] [PATCH v2 09/23] target/arm: Move code around,
Alex Bennée <=
- [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