kernel: fatal: allow tests to continue upon spurious ISR trigger

We want to be regression-testing the spurious ISR functionality.
Therefore, in z_fatal_error() we need to allow a test to continue
if an error has occured due to a spurious IRQ being triggered.
Only in test mode, wee allow the function to return without an
error. In normal mode the current thread will be aborted.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2020-03-09 20:39:01 +01:00 committed by Johan Hedberg
commit 9d184286d3

View file

@ -163,6 +163,14 @@ void z_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
arch_irq_unlock(key);
return;
#endif /* CONFIG_STACK_SENTINEL */
} else {
/* Abort the thread only if the fault is not due to
* a spurious ISR handler triggered.
*/
if (reason == K_ERR_SPURIOUS_IRQ) {
arch_irq_unlock(key);
return;
}
}
#endif /*CONFIG_ARCH_HAS_NESTED_EXCEPTION_DETECTION */
}