SDCC specific changes. Z80 support; re-enable __FILE__ and __LINE__ in assert -- might have broken the 8051/2
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@277 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
40513d77ab
commit
bece513004
@ -171,5 +171,8 @@
|
||||
source files.
|
||||
* tools/mkconfig.c: No long depends on asprintf() and _GNU_SOURCE and
|
||||
so should now build in non-GNU, non-GLIBC environments.
|
||||
* include/nuttx/compiler.h: Fix for using SDCC with the Z80.
|
||||
* include/assert.h & arch/pjrc-8051/src/up_assert.c: SDCC does support
|
||||
__FILE__and __LINE__ (not tested)
|
||||
* Started m68322
|
||||
|
||||
|
@ -605,6 +605,9 @@ Other memory:
|
||||
source files.
|
||||
* tools/mkconfig.c: No long depends on asprintf() and _GNU_SOURCE and
|
||||
so should now build in non-GNU, non-GLIBC environments.
|
||||
* include/nuttx/compiler.h: Fix for using SDCC with the Z80.
|
||||
* include/assert.h & arch/pjrc-8051/src/up_assert.c: SDCC does support
|
||||
__FILE__and __LINE__ (not tested)
|
||||
* Started m68322
|
||||
</pre></ul>
|
||||
|
||||
|
@ -95,7 +95,7 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
|
||||
* Name: up_assert
|
||||
************************************************************/
|
||||
|
||||
void up_assert(void)
|
||||
void up_assert(const ubyte *filename, int lineno)
|
||||
{
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||
@ -104,9 +104,11 @@ void up_assert(void)
|
||||
up_ledon(LED_ASSERTION);
|
||||
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
lldbg("%s: Assertion failed\n", rtcb->name);
|
||||
lldbg("Assertion failed at file:%s line: %d task: %s\n",
|
||||
filename, lineno, rtcb->name);
|
||||
#else
|
||||
lldbg("Assertion failed\n");
|
||||
lldbg("Assertion failed at file:%s line: %d\n",
|
||||
filename, lineno);
|
||||
#endif
|
||||
|
||||
up_dumpstack();
|
||||
@ -117,7 +119,7 @@ void up_assert(void)
|
||||
* Name: up_assert_code
|
||||
************************************************************/
|
||||
|
||||
void up_assert_code(int errorcode)
|
||||
void up_assert_code(const ubyte *filename, int lineno, int errorcode)
|
||||
{
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||
@ -126,9 +128,11 @@ void up_assert_code(int errorcode)
|
||||
up_ledon(LED_ASSERTION);
|
||||
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
lldbg("%s: Assertion failed, error=%d\n", rtcb->name, errorcode);
|
||||
lldbg("Assertion failed at file:%s line: %d task: %s error code: %d\n",
|
||||
filename, lineno, rtcb->name, errorcode);
|
||||
#else
|
||||
lldbg("Assertion failed , error=%d\n", errorcode);
|
||||
lldbg("Assertion failed at file:%s line: %d error code: %d\n",
|
||||
filename, lineno, errorcode);
|
||||
#endif
|
||||
|
||||
up_dumpstack();
|
||||
|
@ -53,7 +53,7 @@
|
||||
#undef ASSERTCODE
|
||||
#undef DEBUGASSERT
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(SDCC)
|
||||
|
||||
# define ASSERT(f) \
|
||||
{ if (!(f)) up_assert((const ubyte *)__FILE__, (int)__LINE__); }
|
||||
@ -105,9 +105,9 @@ extern "C" {
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
EXTERN void up_assert(FAR const ubyte *filename, int linenum);
|
||||
EXTERN void up_assert_code(FAR const ubyte *filename, int linenum,
|
||||
#if defined(__GNUC__) || defined(SDCC)
|
||||
EXTERN void up_assert(const ubyte *filename, int linenum);
|
||||
EXTERN void up_assert_code(const ubyte *filename, int linenum,
|
||||
int error_code);
|
||||
#else
|
||||
EXTERN void up_assert(void);
|
||||
|
@ -84,7 +84,7 @@
|
||||
|
||||
# undef CONFIG_LONG_IS_NOT_INT
|
||||
|
||||
/* The pointers and int are the same size */
|
||||
/* Pointers and int are the same size */
|
||||
|
||||
# undef CONFIG_PTR_IS_NOT_INT
|
||||
|
||||
@ -152,9 +152,13 @@
|
||||
|
||||
# define CONFIG_LONG_IS_NOT_INT 1
|
||||
|
||||
/* The generic point and int are not the same size */
|
||||
|
||||
/* The generic pointer and int are not the same size
|
||||
* (for some SDCC architectures)
|
||||
*/
|
||||
|
||||
#if !defined(__z80) && defined(__gbz80)
|
||||
# define CONFIG_PTR_IS_NOT_INT 1
|
||||
#endif
|
||||
|
||||
/* SDCC does not support inline functions */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user