arm: fix exception handling

For exceptions where we are just going to abort the current thread, we
need to exit handler mode properly so that PendSV can run and perform a
context switch. For ARM architecture this means that the fatal error
handling code path can indeed return if we were 1) in handler mode and
2) only wish to abort the current thread.

Fixes a very long-standing bug where a thread that generates an
exception, and should only abort the thread, instead takes down the
entire system.

Issue: ZEP-2052
Change-Id: Ib356a34a6fda2e0f8aff39c4b3270efceb81e54d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-04-20 15:32:10 -07:00 committed by Anas Nashif
commit e09a04f068
5 changed files with 11 additions and 15 deletions

View file

@ -355,8 +355,6 @@ static void _FaultDump(const NANO_ESF *esf, int fault)
*
* @param esf ESF on the stack, either MSP or PSP depending at what processor
* state the exception was taken.
*
* @return This function does not return.
*/
void _Fault(const NANO_ESF *esf)
{