assert:add a last type to call notifier

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2022-12-29 14:06:08 +08:00 committed by Xiang Xiao
parent 1486600d7d
commit 9a32cf7a1a
2 changed files with 3 additions and 1 deletions

View File

@ -38,6 +38,7 @@ enum panic_type_e
{
PANIC_KERNEL = 0,
PANIC_TASK = 1,
PANIC_KERNEL_FINAL = 2,
};
/****************************************************************************

View File

@ -455,7 +455,7 @@ void _assert(FAR const char *filename, int linenum)
fatal = true;
#endif
panic_notifier_call_chain(fatal ? PANIC_KERNEL : PANIC_TASK, NULL);
panic_notifier_call_chain(fatal ? PANIC_KERNEL : PANIC_TASK, rtcb);
#ifdef CONFIG_SMP
# if CONFIG_TASK_NAME_SIZE > 0
@ -518,6 +518,7 @@ void _assert(FAR const char *filename, int linenum)
/* Flush any buffered SYSLOG data */
syslog_flush();
panic_notifier_call_chain(PANIC_KERNEL_FINAL, rtcb);
reboot_notifier_call_chain(SYS_HALT, NULL);