qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [PATCH v2 10/26] armv7m: auto-clear FAULTMASK


From: Peter Maydell
Subject: Re: [Qemu-arm] [PATCH v2 10/26] armv7m: auto-clear FAULTMASK
Date: Thu, 17 Dec 2015 19:07:52 +0000

On 3 December 2015 at 00:18, Michael Davidsaver <address@hidden> wrote:
> on return from all exceptions other than NMI
> ---
>  target-arm/helper.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index d1ca011..b6ec761 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
> @@ -5379,8 +5379,13 @@ static void do_v7m_exception_exit(CPUARMState *env)
>      uint32_t xpsr;
>
>      type = env->regs[15];
> -    if (env->v7m.exception != 0)
> +    if (env->v7m.exception != ARMV7M_EXCP_NMI) {
> +        /* Auto-clear FAULTMASK on return from other than NMI */
> +        env->daif &= ~PSTATE_F;
> +    }
> +    if (env->v7m.exception != 0) {
>          armv7m_nvic_complete_irq(env->nvic, env->v7m.exception);
> +    }

Should the "clear PSTATE_F if this isn't NMI" check be inside
the "if exception != 0" if() ? It's not clear to me when this
function is called with exception equal to 0...

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]