From 9a32cf7a1ae225c0ab95d6fc9f0f78544625ddf3 Mon Sep 17 00:00:00 2001 From: anjiahao Date: Thu, 29 Dec 2022 14:06:08 +0800 Subject: [PATCH] assert:add a last type to call notifier Signed-off-by: anjiahao --- include/nuttx/panic_notifier.h | 1 + sched/misc/assert.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/nuttx/panic_notifier.h b/include/nuttx/panic_notifier.h index b2e4e131de..2e6553d2ef 100644 --- a/include/nuttx/panic_notifier.h +++ b/include/nuttx/panic_notifier.h @@ -38,6 +38,7 @@ enum panic_type_e { PANIC_KERNEL = 0, PANIC_TASK = 1, + PANIC_KERNEL_FINAL = 2, }; /**************************************************************************** diff --git a/sched/misc/assert.c b/sched/misc/assert.c index 753a3e1676..11700194a4 100644 --- a/sched/misc/assert.c +++ b/sched/misc/assert.c @@ -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);