From f532e80749d8ebafb49194341432666b3946d8bf Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 2 Mar 2018 18:36:58 -0500 Subject: [PATCH] armv7m: Escalate exceptions to HardFault if necessary The v7M exception architecture requires that if a synchronous exception cannot be taken immediately (because it is disabled or at too low a priority) then it should be escalated to HardFault (and the HardFault exception is then taken). Implement this escalation logic. Backports commit a73c98e159d18155445d29b6044be6ad49fd802f from qemu --- qemu/target/arm/helper.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/qemu/target/arm/helper.c b/qemu/target/arm/helper.c index 77405c14..11d10a1b 100644 --- a/qemu/target/arm/helper.c +++ b/qemu/target/arm/helper.c @@ -5448,8 +5448,6 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs) /* For exceptions we just mark as pending on the NVIC, and let that handle it. */ - /* TODO: Need to escalate if the current priority is higher than the - one we're raising. */ switch (cs->exception_index) { case EXCP_UDEF: //armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE);