Skip to content
Permalink
Browse files

arch: arc: fix on the reason of software-triggered fatal exceptions

according to high-level design,in user mode software-triggered system
fatal exceptions only allow oops and stack check failure

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
  • Loading branch information...
vonhust authored and ioannisg committed Aug 9, 2019
1 parent 61d570b commit db8ddaa4109d33a8651e81098846ed5054fdc41c
Showing with 11 additions and 0 deletions.
  1. +11 −0 arch/arc/core/fault.c
@@ -386,6 +386,17 @@ void _Fault(z_arch_esf_t *esf, u32_t old_sp)

/* exception raised by kernel */
if (vector == ARC_EV_TRAP && parameter == _TRAP_S_CALL_RUNTIME_EXCEPT) {
/*
* in user mode software-triggered system fatal exceptions only allow
* K_ERR_KERNEL_OOPS and K_ERR_STACK_CHK_FAIL
*/
#ifdef CONFIG_USERSPACE
if ((esf->status32 & _ARC_V2_STATUS32_U) &&
esf->r0 != K_ERR_STACK_CHK_FAIL) {
esf->r0 = K_ERR_KERNEL_OOPS;
}
#endif

z_arc_fatal_error(esf->r0, esf);
return;
}

0 comments on commit db8ddaa

Please sign in to comment.
You can’t perform that action at this time.