diff --git a/arch/arm/src/arm/arm_assert.c b/arch/arm/src/arm/arm_assert.c index 9cfc91790b..fe6fa51370 100644 --- a/arch/arm/src/arm/arm_assert.c +++ b/arch/arm/src/arm/arm_assert.c @@ -306,22 +306,18 @@ static void _up_assert(void) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (prior to the assertion) */ syslog_flush(); -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) +#if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif up_dumpstate(); diff --git a/arch/arm/src/armv6-m/arm_assert.c b/arch/arm/src/armv6-m/arm_assert.c index 83dddb0c0b..048959ef1e 100644 --- a/arch/arm/src/armv6-m/arm_assert.c +++ b/arch/arm/src/armv6-m/arm_assert.c @@ -359,10 +359,6 @@ static void _up_assert(void) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (prior to the assertion) */ @@ -371,10 +367,10 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif up_dumpstate(); diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c index 4105f2951a..65129cf296 100644 --- a/arch/arm/src/armv7-a/arm_assert.c +++ b/arch/arm/src/armv7-a/arm_assert.c @@ -395,10 +395,6 @@ static void _up_assert(void) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (prior to the assertion) */ @@ -408,18 +404,18 @@ void up_assert(const char *filename, int lineno) #ifdef CONFIG_SMP #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed CPU%d at file:%s line: %d task: %s\n", - up_cpu_index(), filename, lineno, rtcb->name); + up_cpu_index(), filename, lineno, running_task()->name); #else _alert("Assertion failed CPU%d at file:%s line: %d\n", - up_cpu_index(), filename, lineno); + up_cpu_index(), filename, lineno); #endif #else #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif #endif diff --git a/arch/arm/src/armv7-m/arm_assert.c b/arch/arm/src/armv7-m/arm_assert.c index e689a42006..6a6524587e 100644 --- a/arch/arm/src/armv7-m/arm_assert.c +++ b/arch/arm/src/armv7-m/arm_assert.c @@ -387,10 +387,6 @@ static void _up_assert(void) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (prior to the assertion) */ @@ -398,20 +394,20 @@ void up_assert(const char *filename, int lineno) syslog_flush(); #ifdef CONFIG_SMP -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) +#if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed CPU%d at file:%s line: %d task: %s\n", - up_cpu_index(), filename, lineno, rtcb->name); + up_cpu_index(), filename, lineno, running_task()->name); #else _alert("Assertion failed CPU%d at file:%s line: %d\n", - up_cpu_index(), filename, lineno); + up_cpu_index(), filename, lineno); #endif #else -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) +#if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif #endif diff --git a/arch/arm/src/armv7-r/arm_assert.c b/arch/arm/src/armv7-r/arm_assert.c index e5580cd188..9d6e6abd89 100644 --- a/arch/arm/src/armv7-r/arm_assert.c +++ b/arch/arm/src/armv7-r/arm_assert.c @@ -371,10 +371,6 @@ static void _up_assert(void) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (prior to the assertion) */ @@ -383,10 +379,10 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif up_dumpstate(); diff --git a/arch/arm/src/armv8-m/arm_assert.c b/arch/arm/src/armv8-m/arm_assert.c index 094f97c4f8..4a3ba2b020 100644 --- a/arch/arm/src/armv8-m/arm_assert.c +++ b/arch/arm/src/armv8-m/arm_assert.c @@ -387,10 +387,6 @@ static void _up_assert(void) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (prior to the assertion) */ @@ -400,18 +396,18 @@ void up_assert(const char *filename, int lineno) #ifdef CONFIG_SMP #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed CPU%d at file:%s line: %d task: %s\n", - up_cpu_index(), filename, lineno, rtcb->name); + up_cpu_index(), filename, lineno, running_task()->name); #else _alert("Assertion failed CPU%d at file:%s line: %d\n", - up_cpu_index(), filename, lineno); + up_cpu_index(), filename, lineno); #endif #else #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif #endif diff --git a/arch/avr/src/common/up_assert.c b/arch/avr/src/common/up_assert.c index 15341cd973..bf3f4686c1 100644 --- a/arch/avr/src/common/up_assert.c +++ b/arch/avr/src/common/up_assert.c @@ -129,10 +129,6 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (prior to the assertion) */ @@ -141,10 +137,10 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif up_dumpstate(); diff --git a/arch/hc/src/m9s12/m9s12_assert.c b/arch/hc/src/m9s12/m9s12_assert.c index 6818cb727f..2717252a84 100644 --- a/arch/hc/src/m9s12/m9s12_assert.c +++ b/arch/hc/src/m9s12/m9s12_assert.c @@ -304,10 +304,6 @@ static void _up_assert(void) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (from prior to the assertion) */ @@ -316,10 +312,10 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif up_dumpstate(); diff --git a/arch/mips/src/mips32/mips_assert.c b/arch/mips/src/mips32/mips_assert.c index 88caf78939..fd8fb6ddff 100644 --- a/arch/mips/src/mips32/mips_assert.c +++ b/arch/mips/src/mips32/mips_assert.c @@ -129,10 +129,6 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (from prior to the assertion) */ @@ -141,10 +137,10 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif up_dumpstate(); diff --git a/arch/misoc/src/lm32/lm32_assert.c b/arch/misoc/src/lm32/lm32_assert.c index e8d47efb93..93eab92fe5 100644 --- a/arch/misoc/src/lm32/lm32_assert.c +++ b/arch/misoc/src/lm32/lm32_assert.c @@ -133,10 +133,6 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (prior to the assertion) */ @@ -145,10 +141,10 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif lm32_dumpstate(); diff --git a/arch/misoc/src/minerva/minerva_assert.c b/arch/misoc/src/minerva/minerva_assert.c index e4e4d085d0..5055332830 100644 --- a/arch/misoc/src/minerva/minerva_assert.c +++ b/arch/misoc/src/minerva/minerva_assert.c @@ -133,10 +133,6 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (prior to the assertion) */ @@ -145,7 +141,7 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", filename, lineno); #endif diff --git a/arch/or1k/src/common/up_assert.c b/arch/or1k/src/common/up_assert.c index ffabdad7bb..182c124c20 100644 --- a/arch/or1k/src/common/up_assert.c +++ b/arch/or1k/src/common/up_assert.c @@ -359,10 +359,6 @@ static void _up_assert(void) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (from prior to the assertion) */ @@ -371,7 +367,7 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", filename, lineno); diff --git a/arch/renesas/src/common/up_assert.c b/arch/renesas/src/common/up_assert.c index f1e62a49fe..80049de9fe 100644 --- a/arch/renesas/src/common/up_assert.c +++ b/arch/renesas/src/common/up_assert.c @@ -128,10 +128,6 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (from prior to the assertion) */ @@ -140,10 +136,10 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif up_dumpstate(); diff --git a/arch/risc-v/src/rv32im/riscv_assert.c b/arch/risc-v/src/rv32im/riscv_assert.c index 664aa9e13e..59ee2584f3 100644 --- a/arch/risc-v/src/rv32im/riscv_assert.c +++ b/arch/risc-v/src/rv32im/riscv_assert.c @@ -329,19 +329,15 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (from prior to the assertion) */ syslog_flush(); -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) +#if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", filename, lineno); diff --git a/arch/risc-v/src/rv64gc/riscv_assert.c b/arch/risc-v/src/rv64gc/riscv_assert.c index f5bdda2f1e..0bca0617e7 100644 --- a/arch/risc-v/src/rv64gc/riscv_assert.c +++ b/arch/risc-v/src/rv64gc/riscv_assert.c @@ -346,10 +346,6 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (from prior to the assertion) */ @@ -359,18 +355,18 @@ void up_assert(const char *filename, int lineno) #ifdef CONFIG_SMP #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed CPU%d at file:%s line: %d task: %s\n", - up_cpu_index(), filename, lineno, rtcb->name); + up_cpu_index(), filename, lineno, running_task()->name); #else _alert("Assertion failed CPU%d at file:%s line: %d\n", - up_cpu_index(), filename, lineno); + up_cpu_index(), filename, lineno); #endif #else #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif #endif diff --git a/arch/sim/src/sim/up_assert.c b/arch/sim/src/sim/up_assert.c index 6317cc30f5..e135cc1e5d 100644 --- a/arch/sim/src/sim/up_assert.c +++ b/arch/sim/src/sim/up_assert.c @@ -24,10 +24,10 @@ #include #include +#include #include -#include #include -#include + #include "up_internal.h" /**************************************************************************** @@ -67,20 +67,30 @@ * ****************************************************************************/ -void up_assert(const char *filename, int line) +void up_assert(const char *filename, int lineno) { - /* Flush any buffered SYSLOG data (from prior to the assertion) */ + /* Flush any buffered SYSLOG data (prior to the assertion) */ syslog_flush(); /* Show the location of the failed assertion */ #ifdef CONFIG_SMP - syslog(LOG_ERR, "CPU%d: Assertion failed at file:%s line: %d\n", - up_cpu_index(), filename, line); +#if CONFIG_TASK_NAME_SIZE > 0 + _alert("Assertion failed CPU%d at file:%s line: %d task: %s\n", + up_cpu_index(), filename, lineno, running_task()->name); #else - syslog(LOG_ERR, "Assertion failed at file:%s line: %d\n", - filename, line); + _alert("Assertion failed CPU%d at file:%s line: %d\n", + up_cpu_index(), filename, lineno); +#endif +#else +#if CONFIG_TASK_NAME_SIZE > 0 + _alert("Assertion failed at file:%s line: %d task: %s\n", + filename, lineno, running_task()->name); +#else + _alert("Assertion failed at file:%s line: %d\n", + filename, lineno); +#endif #endif /* Flush any buffered SYSLOG data (from the above) */ @@ -90,7 +100,7 @@ void up_assert(const char *filename, int line) /* Allow for any board/configuration specific crash information */ #ifdef CONFIG_BOARD_CRASHDUMP - board_crashdump(up_getsp(), this_task(), filename, line); + board_crashdump(up_getsp(), running_task(), filename, lineno); #endif /* Flush any buffered SYSLOG data */ diff --git a/arch/x86/src/common/up_assert.c b/arch/x86/src/common/up_assert.c index 072e43f545..627fa1e1d5 100644 --- a/arch/x86/src/common/up_assert.c +++ b/arch/x86/src/common/up_assert.c @@ -265,10 +265,6 @@ static void _up_assert(void) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (from prior to the assertion) */ @@ -277,10 +273,10 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif up_dumpstate(); diff --git a/arch/x86_64/src/common/up_assert.c b/arch/x86_64/src/common/up_assert.c index c1650aa3d4..cce56be1d3 100644 --- a/arch/x86_64/src/common/up_assert.c +++ b/arch/x86_64/src/common/up_assert.c @@ -247,22 +247,18 @@ static void _up_assert(void) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = this_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (from prior to the assertion) */ syslog_flush(); -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) +#if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif up_dumpstate(); diff --git a/arch/xtensa/src/common/xtensa_assert.c b/arch/xtensa/src/common/xtensa_assert.c index 7c38eedee5..d52ee6ac4e 100644 --- a/arch/xtensa/src/common/xtensa_assert.c +++ b/arch/xtensa/src/common/xtensa_assert.c @@ -148,10 +148,6 @@ static void xtensa_assert(void) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (from prior to the assertion) */ @@ -160,10 +156,10 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif xtensa_assert(); @@ -193,10 +189,6 @@ void up_assert(const char *filename, int lineno) void xtensa_panic(int xptcode, uint32_t *regs) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - /* We get here when a un-dispatch-able, irrecoverable exception occurs */ board_autoled_on(LED_ASSERTION); @@ -206,7 +198,7 @@ void xtensa_panic(int xptcode, uint32_t *regs) syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 - _alert("Unhandled Exception %d task: %s\n", xptcode, rtcb->name); + _alert("Unhandled Exception %d task: %s\n", xptcode, running_task()->name); #else _alert("Unhandled Exception %d\n", xptcode); #endif @@ -298,10 +290,6 @@ void xtensa_panic(int xptcode, uint32_t *regs) void xtensa_user_panic(int exccause, uint32_t *regs) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - /* We get here when a un-dispatch-able, irrecoverable exception occurs */ board_autoled_on(LED_ASSERTION); @@ -311,7 +299,8 @@ void xtensa_user_panic(int exccause, uint32_t *regs) syslog_flush(); #if CONFIG_TASK_NAME_SIZE > 0 - _alert("User Exception: EXCCAUSE=%04x task: %s\n", exccause, rtcb->name); + _alert("User Exception: EXCCAUSE=%04x task: %s\n", + exccause, running_task()->name); #else _alert("User Exception: EXCCAUSE=%04x\n", exccause); #endif diff --git a/arch/z16/src/common/z16_assert.c b/arch/z16/src/common/z16_assert.c index 0b4658be26..20864918b1 100644 --- a/arch/z16/src/common/z16_assert.c +++ b/arch/z16/src/common/z16_assert.c @@ -129,10 +129,6 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (from prior to the assertion) */ @@ -141,10 +137,10 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif z16_registerdump(); diff --git a/arch/z80/src/common/z80_assert.c b/arch/z80/src/common/z80_assert.c index 072aea8880..815de94b4c 100644 --- a/arch/z80/src/common/z80_assert.c +++ b/arch/z80/src/common/z80_assert.c @@ -128,10 +128,6 @@ static int assert_tracecallback(struct usbtrace_s *trace, void *arg) void up_assert(const char *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT) - struct tcb_s *rtcb = running_task(); -#endif - board_autoled_on(LED_ASSERTION); /* Flush any buffered SYSLOG data (from prior to the assertion) */ @@ -140,10 +136,10 @@ void up_assert(const char *filename, int lineno) #if CONFIG_TASK_NAME_SIZE > 0 _alert("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + filename, lineno, running_task()->name); #else _alert("Assertion failed at file:%s line: %d\n", - filename, lineno); + filename, lineno); #endif REGISTER_DUMP();