diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 1fe1a96720..aaf32db579 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -2147,7 +2147,7 @@ The specific environmental definitions are unique for each board but should incl
up_assert()
Function Prototype:
- void up_assert(FAR const uint8_t *filename, int linenum);
+ void up_assert(FAR const char *filename, int linenum);
Description.
diff --git a/arch/arm/src/arm/arm_assert.c b/arch/arm/src/arm/arm_assert.c
index f34f47c61d..71e1512aa0 100644
--- a/arch/arm/src/arm/arm_assert.c
+++ b/arch/arm/src/arm/arm_assert.c
@@ -283,8 +283,7 @@ static void up_dumpstate(void)
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -313,7 +312,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -325,7 +323,7 @@ static void _up_assert(int errorcode)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -355,5 +353,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(arm_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/arm/src/armv6-m/arm_assert.c b/arch/arm/src/armv6-m/arm_assert.c
index c8bd7d3686..bbc1e41356 100644
--- a/arch/arm/src/armv6-m/arm_assert.c
+++ b/arch/arm/src/armv6-m/arm_assert.c
@@ -340,8 +340,7 @@ static void up_dumpstate(void)
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -370,7 +369,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -382,7 +380,7 @@ static void _up_assert(int errorcode)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -412,5 +410,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(arm_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c
index b4cb872dae..3e5e48acd6 100644
--- a/arch/arm/src/armv7-a/arm_assert.c
+++ b/arch/arm/src/armv7-a/arm_assert.c
@@ -353,8 +353,7 @@ static void up_dumpstate(void)
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -394,7 +393,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -406,7 +404,7 @@ static void _up_assert(int errorcode)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -446,5 +444,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(arm_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/arm/src/armv7-m/arm_assert.c b/arch/arm/src/armv7-m/arm_assert.c
index 41b69c2a88..aae1da418b 100644
--- a/arch/arm/src/armv7-m/arm_assert.c
+++ b/arch/arm/src/armv7-m/arm_assert.c
@@ -347,8 +347,7 @@ static void up_dumpstate(void)
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -383,7 +382,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -395,7 +393,7 @@ static void _up_assert(int errorcode)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -435,5 +433,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(arm_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/arm/src/armv7-r/arm_assert.c b/arch/arm/src/armv7-r/arm_assert.c
index f4791b8810..ae4c71947a 100644
--- a/arch/arm/src/armv7-r/arm_assert.c
+++ b/arch/arm/src/armv7-r/arm_assert.c
@@ -333,8 +333,7 @@ static void up_dumpstate(void)
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -363,7 +362,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -375,7 +373,7 @@ static void _up_assert(int errorcode)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -405,5 +403,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(arm_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/arm/src/armv8-m/arm_assert.c b/arch/arm/src/armv8-m/arm_assert.c
index 6e9b63317e..4477964914 100644
--- a/arch/arm/src/armv8-m/arm_assert.c
+++ b/arch/arm/src/armv8-m/arm_assert.c
@@ -347,8 +347,7 @@ static void up_dumpstate(void)
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -383,7 +382,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -395,7 +393,7 @@ static void _up_assert(int errorcode)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -435,5 +433,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(arm_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/avr/src/common/up_assert.c b/arch/avr/src/common/up_assert.c
index c5c21eaab6..91dd03de3c 100644
--- a/arch/avr/src/common/up_assert.c
+++ b/arch/avr/src/common/up_assert.c
@@ -79,8 +79,7 @@
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -109,7 +108,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -145,7 +143,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -181,5 +179,5 @@ void up_assert(const uint8_t *filename, int lineno)
usbtrace_enumerate(assert_tracecallback, NULL);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/hc/src/m9s12/m9s12_assert.c b/arch/hc/src/m9s12/m9s12_assert.c
index 390c1e0291..487031c194 100644
--- a/arch/hc/src/m9s12/m9s12_assert.c
+++ b/arch/hc/src/m9s12/m9s12_assert.c
@@ -285,8 +285,7 @@ static void up_dumpstate(void)
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -315,7 +314,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -327,7 +325,7 @@ static void _up_assert(int errorcode)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -357,5 +355,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(hc_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/mips/src/mips32/mips_assert.c b/arch/mips/src/mips32/mips_assert.c
index 754eb1021a..f0d8e67a21 100644
--- a/arch/mips/src/mips32/mips_assert.c
+++ b/arch/mips/src/mips32/mips_assert.c
@@ -78,8 +78,7 @@
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -108,7 +107,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -144,7 +142,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -180,5 +178,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(mips_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/misoc/src/lm32/lm32_assert.c b/arch/misoc/src/lm32/lm32_assert.c
index 36d0b0747e..73c377b394 100644
--- a/arch/misoc/src/lm32/lm32_assert.c
+++ b/arch/misoc/src/lm32/lm32_assert.c
@@ -78,8 +78,7 @@
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -113,7 +112,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -149,7 +147,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -185,5 +183,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(misoc_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/misoc/src/minerva/minerva_assert.c b/arch/misoc/src/minerva/minerva_assert.c
index fe47be2e17..5931618291 100644
--- a/arch/misoc/src/minerva/minerva_assert.c
+++ b/arch/misoc/src/minerva/minerva_assert.c
@@ -78,8 +78,7 @@
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -113,7 +112,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -149,7 +147,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t * filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -184,5 +182,5 @@ void up_assert(const uint8_t * filename, int lineno)
board_crashdump(misoc_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/or1k/src/common/up_assert.c b/arch/or1k/src/common/up_assert.c
index 53aa77c83d..d7abb50804 100644
--- a/arch/or1k/src/common/up_assert.c
+++ b/arch/or1k/src/common/up_assert.c
@@ -340,8 +340,7 @@ static void up_dumpstate(void)
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -370,7 +369,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -382,7 +380,7 @@ static void _up_assert(int errorcode)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -412,5 +410,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(or1k_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/renesas/src/common/up_assert.c b/arch/renesas/src/common/up_assert.c
index fd7086c1b1..5fa078e036 100644
--- a/arch/renesas/src/common/up_assert.c
+++ b/arch/renesas/src/common/up_assert.c
@@ -79,8 +79,7 @@
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -108,7 +107,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -144,7 +142,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -180,5 +178,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(renesas_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/risc-v/src/rv32im/riscv_assert.c b/arch/risc-v/src/rv32im/riscv_assert.c
index 84004809d1..bcf85b3d58 100644
--- a/arch/risc-v/src/rv32im/riscv_assert.c
+++ b/arch/risc-v/src/rv32im/riscv_assert.c
@@ -278,8 +278,7 @@ static void up_dumpstate(void)
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -308,7 +307,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -344,7 +342,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -384,5 +382,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(riscv_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/risc-v/src/rv64gc/riscv_assert.c b/arch/risc-v/src/rv64gc/riscv_assert.c
index 61376b5a60..b23db6219f 100644
--- a/arch/risc-v/src/rv64gc/riscv_assert.c
+++ b/arch/risc-v/src/rv64gc/riscv_assert.c
@@ -287,8 +287,7 @@ static void up_dumpstate(void)
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -323,7 +322,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -359,7 +357,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -415,5 +413,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(riscv_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/sim/src/sim/up_head.c b/arch/sim/src/sim/up_head.c
index 000fef940b..ec45563e89 100644
--- a/arch/sim/src/sim/up_head.c
+++ b/arch/sim/src/sim/up_head.c
@@ -108,7 +108,7 @@ int main(int argc, char **argv, char **envp)
*
****************************************************************************/
-void up_assert(const uint8_t *filename, int line)
+void up_assert(const char *filename, int line)
{
/* Show the location of the failed assertion */
diff --git a/arch/x86/src/common/up_assert.c b/arch/x86/src/common/up_assert.c
index f27d07577d..7dcb30ffc0 100644
--- a/arch/x86/src/common/up_assert.c
+++ b/arch/x86/src/common/up_assert.c
@@ -246,8 +246,7 @@ static void up_dumpstate(void)
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -276,7 +275,6 @@ static void _up_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -288,7 +286,7 @@ static void _up_assert(int errorcode)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -318,5 +316,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(x86_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/x86_64/src/common/up_assert.c b/arch/x86_64/src/common/up_assert.c
index 50737f82d4..b092a27e21 100644
--- a/arch/x86_64/src/common/up_assert.c
+++ b/arch/x86_64/src/common/up_assert.c
@@ -52,6 +52,10 @@
# undef CONFIG_ARCH_USBDUMP
#endif
+#ifndef CONFIG_BOARD_RESET_ON_ASSERT
+# define CONFIG_BOARD_RESET_ON_ASSERT 0
+#endif
+
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -208,8 +212,7 @@ static void up_dumpstate(void)
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) noreturn_function;
-static void _up_assert(int errorcode)
+static void _up_assert(void)
{
/* Are we in an interrupt handler or the idle task? */
@@ -218,6 +221,9 @@ static void _up_assert(int errorcode)
(void)up_irq_save();
for (; ; )
{
+#if CONFIG_BOARD_RESET_ON_ASSERT >= 1
+ board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
+#endif
#ifdef CONFIG_ARCH_LEDS
board_autoled_on(LED_PANIC);
up_mdelay(250);
@@ -228,7 +234,11 @@ static void _up_assert(int errorcode)
}
else
{
- exit(errorcode);
+ /* Assertions in other contexts only cause the thread to exit */
+
+#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
+ board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
+#endif
}
}
@@ -240,7 +250,7 @@ static void _up_assert(int errorcode)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = this_task();
@@ -262,5 +272,5 @@ void up_assert(const uint8_t *filename, int lineno)
board_crashdump(x64_getsp(), this_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/xtensa/src/common/xtensa_assert.c b/arch/xtensa/src/common/xtensa_assert.c
index 5cce6ec7ef..0c5d4fefec 100644
--- a/arch/xtensa/src/common/xtensa_assert.c
+++ b/arch/xtensa/src/common/xtensa_assert.c
@@ -101,8 +101,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
* Name: xtensa_assert
****************************************************************************/
-static void xtensa_assert(int errorcode) noreturn_function;
-static void xtensa_assert(int errorcode)
+static void xtensa_assert(void)
{
/* Dump the processor state */
@@ -151,7 +150,6 @@ static void xtensa_assert(int errorcode)
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -163,7 +161,7 @@ static void xtensa_assert(int errorcode)
* Name: up_assert
****************************************************************************/
-void up_assert(const uint8_t *filename, int lineno)
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -183,7 +181,7 @@ void up_assert(const uint8_t *filename, int lineno)
filename, lineno);
#endif
- xtensa_assert(EXIT_FAILURE);
+ xtensa_assert();
}
/****************************************************************************
@@ -229,7 +227,7 @@ void xtensa_panic(int xptcode, uint32_t *regs)
#endif
CURRENT_REGS = regs;
- xtensa_assert(EXIT_FAILURE); /* Should not return */
+ xtensa_assert(); /* Should not return */
for (; ; );
}
@@ -334,6 +332,6 @@ void xtensa_user_panic(int exccause, uint32_t *regs)
#endif
CURRENT_REGS = regs;
- xtensa_assert(EXIT_FAILURE); /* Should not return */
+ xtensa_assert(); /* Should not return */
for (; ; );
}
diff --git a/arch/z16/src/common/z16_assert.c b/arch/z16/src/common/z16_assert.c
index 39d428b11e..9273f0b5cd 100644
--- a/arch/z16/src/common/z16_assert.c
+++ b/arch/z16/src/common/z16_assert.c
@@ -63,7 +63,7 @@
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) /* noreturn_function */
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -92,7 +92,6 @@ static void _up_assert(int errorcode) /* noreturn_function */
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -128,11 +127,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
* Name: up_assert
****************************************************************************/
-#ifdef CONFIG_HAVE_FILENAME
-void up_assert(const uint8_t *filename, int lineno)
-#else
-void up_assert(void)
-#endif
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -144,20 +139,12 @@ void up_assert(void)
syslog_flush();
-#ifdef CONFIG_HAVE_FILENAME
#if CONFIG_TASK_NAME_SIZE > 0
_alert("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else
_alert("Assertion failed at file:%s line: %d\n",
filename, lineno);
-#endif
-#else
-#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
- _alert("Assertion failed: task: %s\n", rtcb->name);
-#else
- _alert("Assertion failed\n");
-#endif
#endif
z16_registerdump();
@@ -177,5 +164,5 @@ void up_assert(void)
board_crashdump(z16_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/arch/z80/src/common/z80_assert.c b/arch/z80/src/common/z80_assert.c
index 87ebbcb9af..c55ef1f53f 100644
--- a/arch/z80/src/common/z80_assert.c
+++ b/arch/z80/src/common/z80_assert.c
@@ -62,7 +62,7 @@
* Name: _up_assert
****************************************************************************/
-static void _up_assert(int errorcode) /* noreturn_function */
+static void _up_assert(void)
{
/* Flush any buffered SYSLOG data */
@@ -91,7 +91,6 @@ static void _up_assert(int errorcode) /* noreturn_function */
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
- exit(errorcode);
}
}
@@ -127,11 +126,7 @@ static int assert_tracecallback(struct usbtrace_s *trace, void *arg)
* Name: up_assert
****************************************************************************/
-#ifdef CONFIG_HAVE_FILENAME
-void up_assert(const uint8_t *filename, int lineno)
-#else
-void up_assert(void)
-#endif
+void up_assert(const char *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_ALERT)
struct tcb_s *rtcb = running_task();
@@ -143,20 +138,12 @@ void up_assert(void)
syslog_flush();
-#ifdef CONFIG_HAVE_FILENAME
#if CONFIG_TASK_NAME_SIZE > 0
_alert("Assertion failed at file:%s line: %d task: %s\n",
filename, lineno, rtcb->name);
#else
_alert("Assertion failed at file:%s line: %d\n",
filename, lineno);
-#endif
-#else
-#if CONFIG_TASK_NAME_SIZE > 0
- _alert("Assertion failed: task: %s\n", rtcb->name);
-#else
- _alert("Assertion failed\n");
-#endif
#endif
REGISTER_DUMP();
@@ -178,5 +165,5 @@ void up_assert(void)
board_crashdump(z80_getsp(), running_task(), filename, lineno);
#endif
- _up_assert(EXIT_FAILURE);
+ _up_assert();
}
diff --git a/include/assert.h b/include/assert.h
index 88254f6494..8d96e874b4 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -1,7 +1,8 @@
/****************************************************************************
* include/assert.h
*
- * Copyright (C) 2007-2009, 2011-2013, 2015-2016 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011-2013, 2015-2016 Gregory Nutt.
+ * All rights reserved.
* Author: Gregory Nutt