arch: up_assert shouldn't call exit directly

since exit will be only callable from userspace and change
the 1st argument from "const uint8_t *" to "const char *"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I86487d57210ab63109148232da71dbc4d60a563b
This commit is contained in:
Xiang Xiao
2020-06-07 14:51:54 +08:00
committed by Abdelatif Guettouche
parent 774ea6eae7
commit d6827cab60
29 changed files with 152 additions and 140 deletions
+3 -5
View File
@@ -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();
}
+3 -5
View File
@@ -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();
}