| 33 | #endif |
| 34 | |
| 35 | static void _check_fault(struct rt_hw_exp_stack *regs, uint32_t pc_adj, char *info) |
| 36 | { |
| 37 | uint32_t is_user_fault; |
| 38 | rt_thread_t th; |
| 39 | |
| 40 | is_user_fault = !(regs->cpsr & 0x1f); |
| 41 | if (is_user_fault) |
| 42 | { |
| 43 | rt_kprintf("%s! pc = 0x%x\n", info, regs->pc - pc_adj); |
| 44 | } |
| 45 | |
| 46 | /* user stack backtrace */ |
| 47 | th = rt_thread_self(); |
| 48 | if (th && th->lwp) |
| 49 | { |
| 50 | arch_backtrace_uthread(th); |
| 51 | } |
| 52 | |
| 53 | if (is_user_fault) |
| 54 | { |
| 55 | #ifdef LWP_USING_CORE_DUMP |
| 56 | lwp_core_dump(regs, pc_adj); |
| 57 | #endif |
| 58 | sys_exit_group(-1); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | rt_inline int _get_type(unsigned long esr) |
| 63 | { |
no test coverage detected