mirror of
https://github.com/apache/nuttx.git
synced 2026-09-22 22:55:02 +08:00
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:
committed by
Abdelatif Guettouche
parent
774ea6eae7
commit
d6827cab60
+5
-8
@@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* Copyright (C) 2016 Omni Hoverboards Inc. All rights reserved.
|
||||
@@ -60,9 +61,9 @@
|
||||
#undef DEBUGVERIFY /* Like VERIFY, but only if CONFIG_DEBUG_ASSERTIONS is defined */
|
||||
|
||||
#ifdef CONFIG_HAVE_FILENAME
|
||||
# define PANIC() up_assert((const uint8_t *)__FILE__, (int)__LINE__)
|
||||
# define PANIC() _assert(__FILE__, __LINE__)
|
||||
#else
|
||||
# define PANIC() up_assert()
|
||||
# define PANIC() _assert("unknown", 0)
|
||||
#endif
|
||||
|
||||
#define ASSERT(f) do { if (!(f)) PANIC(); } while (0)
|
||||
@@ -117,11 +118,7 @@ extern "C"
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_FILENAME
|
||||
void up_assert(FAR const uint8_t *filename, int linenum) noreturn_function;
|
||||
#else
|
||||
void up_assert(void) noreturn_function;
|
||||
#endif
|
||||
void _assert(FAR const char *filename, int linenum) noreturn_function;
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -475,7 +475,7 @@ void up_exit() noreturn_function;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* Prototype is in assert.h */
|
||||
void up_assert(FAR const char *filename, int linenum);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_schedule_sigaction
|
||||
|
||||
+4
-4
@@ -48,6 +48,10 @@
|
||||
# include <assert.h>
|
||||
#endif
|
||||
|
||||
/* Now include architecture-specific types */
|
||||
|
||||
#include <arch/irq.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
@@ -118,10 +122,6 @@ typedef uint32_t irq_mapped_t;
|
||||
typedef CODE int (*xcpt_t)(int irq, FAR void *context, FAR void *arg);
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
/* Now include architecture-specific types */
|
||||
|
||||
#include <arch/irq.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user