Skip to content
Permalink
Browse files

arch: arc: fixes the case triggering a cpu exception in user mode

use "trap_s 3" to simulate SW exception raised by kernel

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
  • Loading branch information...
vonhust authored and ioannisg committed Aug 6, 2019
1 parent 0757583 commit 484b9231ce5ea91690c4f5db199606c928877dba
Showing with 1 addition and 9 deletions.
  1. +1 −9 include/arch/arc/v2/error.h
@@ -23,16 +23,9 @@ extern "C" {
#endif

/*
* the exception caused by kernel will be handled in interrupt context
* when the processor is already in interrupt context, no need to raise
* a new exception; when the processor is in thread context, the exception
* will be raised
* use trap_s to raise a SW exception
*/
#define Z_ARCH_EXCEPT(reason_p) do { \
if (z_arc_v2_irq_unit_is_in_isr()) { \
printk("@ %s:%d:\n", __FILE__, __LINE__); \
z_fatal_error(reason_p, 0); \
} else {\
__asm__ volatile ( \
"mov r0, %[reason]\n\t" \
"trap_s %[id]\n\t" \
@@ -41,7 +34,6 @@ extern "C" {
[id] "i" (_TRAP_S_CALL_RUNTIME_EXCEPT) \
: "memory"); \
CODE_UNREACHABLE; \
} \
} while (false)

#ifdef __cplusplus

0 comments on commit 484b923

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