mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
Add syslog.h; rename lib_rawprintf() to syslog()
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5578 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -4324,17 +4324,17 @@ build
|
|||||||
<li>
|
<li>
|
||||||
<code>CONFIG_DEBUG</code>: enables built-in debug options.
|
<code>CONFIG_DEBUG</code>: enables built-in debug options.
|
||||||
This includes more extensive parameter checking, debug assertions, and other debug logic.
|
This includes more extensive parameter checking, debug assertions, and other debug logic.
|
||||||
This option is also necessary (but not sufficient) to enable debug console output;
|
This option is also necessary (but not sufficient) to enable debug syslog output;
|
||||||
Debug console output must also be enabled on a subsystem-by-subsystem basis as described below.
|
Debug syslog output must also be enabled on a subsystem-by-subsystem basis as described below.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code>CONFIG_DEBUG_VERBOSE</code>: If debug console output is enabled, the option enables more verbose debug output.
|
<code>CONFIG_DEBUG_VERBOSE</code>: If debug syslog output is enabled, the option enables more verbose debug output.
|
||||||
Ignored if <code>CONFIG_DEBUG</code> is not defined.
|
Ignored if <code>CONFIG_DEBUG</code> is not defined.
|
||||||
If only <code>CONFIG_DEBUG</code> then the only output will be errors, warnings, and critical information.
|
If only <code>CONFIG_DEBUG</code> then the only output will be errors, warnings, and critical information.
|
||||||
If <code>CONFIG_DEBUG_VERBOSE</code> is defined in addition, then general debug comments will also be included in the console output.
|
If <code>CONFIG_DEBUG_VERBOSE</code> is defined in addition, then general debug comments will also be included in the syslog output.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code>CONFIG_DEBUG_ENABLE</code>: Support an interface to enable or disable debug output.
|
<code>CONFIG_SYSLOG_ENABLE</code>: Support an interface to enable or disable syslog output.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code>CONFIG_DEBUG_SYMBOLS</code>: build without optimization and with debug symbols (needed for use with a debugger).
|
<code>CONFIG_DEBUG_SYMBOLS</code>: build without optimization and with debug symbols (needed for use with a debugger).
|
||||||
|
|||||||
@@ -312,11 +312,12 @@ config DEBUG_VERBOSE
|
|||||||
often annoying) output will be generated. This means there are two levels
|
often annoying) output will be generated. This means there are two levels
|
||||||
of debug output: errors-only and everything.
|
of debug output: errors-only and everything.
|
||||||
|
|
||||||
config DEBUG_ENABLE
|
config SYSLOG_ENABLE
|
||||||
bool "Enable Debug Controls"
|
bool "Enable Debug Controls"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Support an interface to dynamically enable or disable debug output.
|
Support an interface called syslog_enable to dynamically enable or
|
||||||
|
disable debug output.
|
||||||
|
|
||||||
comment "Subsystem Debug Options"
|
comment "Subsystem Debug Options"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
NuttX TODO List (Last updated January 27, 2013)
|
NuttX TODO List (Last updated January 28, 2013)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
This file summarizes known NuttX bugs, limitations, inconsistencies with
|
This file summarizes known NuttX bugs, limitations, inconsistencies with
|
||||||
@@ -14,7 +14,7 @@ nuttx/
|
|||||||
(6) Binary loaders (binfmt/)
|
(6) Binary loaders (binfmt/)
|
||||||
(16) Network (net/, drivers/net)
|
(16) Network (net/, drivers/net)
|
||||||
(4) USB (drivers/usbdev, drivers/usbhost)
|
(4) USB (drivers/usbdev, drivers/usbhost)
|
||||||
(12) Libraries (libc/, )
|
(11) Libraries (libc/, )
|
||||||
(9) File system/Generic drivers (fs/, drivers/)
|
(9) File system/Generic drivers (fs/, drivers/)
|
||||||
(5) Graphics subystem (graphics/)
|
(5) Graphics subystem (graphics/)
|
||||||
(1) Pascal add-on (pcode/)
|
(1) Pascal add-on (pcode/)
|
||||||
@@ -812,19 +812,6 @@ o Libraries (libc/)
|
|||||||
Status: Open
|
Status: Open
|
||||||
Priority: ??
|
Priority: ??
|
||||||
|
|
||||||
Title: SYSLOG INTEGRATION
|
|
||||||
Description: There are the beginnings of some system logging capabilities (see
|
|
||||||
drivers/syslog, fs/fs_syslog.c, and libc/stdio/lib_librawprintf.c and
|
|
||||||
lib_liblowprintf.c. For NuttX, SYSLOG is a concept and includes,
|
|
||||||
extends, and replaces the legacy NuttX debug ouput. Some additional
|
|
||||||
integration is required to formalized this. For example:
|
|
||||||
|
|
||||||
o lib_rawprintf() shjould be renamed syslog().
|
|
||||||
o debug.h should be renamed syslog.h
|
|
||||||
o And what about lib_lowprintf()? llsyslog?
|
|
||||||
Status: Open
|
|
||||||
Priority: Low -- more of a roadmap
|
|
||||||
|
|
||||||
Title: FLOATING POINT FORMATS
|
Title: FLOATING POINT FORMATS
|
||||||
Description: Only the %f floating point format is supported. Others are accepted
|
Description: Only the %f floating point format is supported. Others are accepted
|
||||||
but treated like %f.
|
but treated like %f.
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The following is just intended to keep some ugliness out of the mainline
|
/* The following is just intended to keep some ugliness out of the mainline
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
*
|
*
|
||||||
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
||||||
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
||||||
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lib_lowprintf() is used
|
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef CONFIG_PRINT_TASKNAME
|
#undef CONFIG_PRINT_TASKNAME
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The following is just intended to keep some ugliness out of the mainline
|
/* The following is just intended to keep some ugliness out of the mainline
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
*
|
*
|
||||||
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
||||||
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
||||||
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lib_lowprintf() is used
|
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef CONFIG_PRINT_TASKNAME
|
#undef CONFIG_PRINT_TASKNAME
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
void up_decodeirq(uint32_t* regs)
|
void up_decodeirq(uint32_t* regs)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
lib_lowprintf("Unexpected IRQ\n");
|
lowsyslog("Unexpected IRQ\n");
|
||||||
current_regs = regs;
|
current_regs = regs;
|
||||||
PANIC(OSERR_ERREXCEPTION);
|
PANIC(OSERR_ERREXCEPTION);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
void up_decodeirq(uint32_t* regs)
|
void up_decodeirq(uint32_t* regs)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
lib_lowprintf("Unexpected IRQ\n");
|
lowsyslog("Unexpected IRQ\n");
|
||||||
current_regs = regs;
|
current_regs = regs;
|
||||||
PANIC(OSERR_ERREXCEPTION);
|
PANIC(OSERR_ERREXCEPTION);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ static void lpc214x_decodeirq( uint32_t *regs)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
lib_lowprintf("Unexpected IRQ\n");
|
lowsyslog("Unexpected IRQ\n");
|
||||||
current_regs = regs;
|
current_regs = regs;
|
||||||
PANIC(OSERR_ERREXCEPTION);
|
PANIC(OSERR_ERREXCEPTION);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ static void lpc23xx_decodeirq(uint32_t *regs)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
lib_lowprintf("Unexpected IRQ\n");
|
lowsyslog("Unexpected IRQ\n");
|
||||||
current_regs = regs;
|
current_regs = regs;
|
||||||
PANIC(OSERR_ERREXCEPTION);
|
PANIC(OSERR_ERREXCEPTION);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
void up_decodeirq(uint32_t *regs)
|
void up_decodeirq(uint32_t *regs)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
lib_lowprintf("Unexpected IRQ\n");
|
lowsyslog("Unexpected IRQ\n");
|
||||||
current_regs = regs;
|
current_regs = regs;
|
||||||
PANIC(OSERR_ERREXCEPTION);
|
PANIC(OSERR_ERREXCEPTION);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -159,7 +159,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* I2C event trace logic. NOTE: trace uses the internal, non-standard, low-level
|
/* I2C event trace logic. NOTE: trace uses the internal, non-standard, low-level
|
||||||
* debug interface lib_rawprintf() but does not require that any other debug
|
* debug interface syslog() but does not require that any other debug
|
||||||
* is enabled.
|
* is enabled.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -899,11 +899,11 @@ static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
|
|||||||
struct stm32_trace_s *trace;
|
struct stm32_trace_s *trace;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
lib_rawprintf("Elapsed time: %d\n", clock_systimer() - priv->start_time);
|
syslog("Elapsed time: %d\n", clock_systimer() - priv->start_time);
|
||||||
for (i = 0; i <= priv->tndx; i++)
|
for (i = 0; i <= priv->tndx; i++)
|
||||||
{
|
{
|
||||||
trace = &priv->trace[i];
|
trace = &priv->trace[i];
|
||||||
lib_rawprintf("%2d. STATUS: %08x COUNT: %3d EVENT: %2d PARM: %08x TIME: %d\n",
|
syslog("%2d. STATUS: %08x COUNT: %3d EVENT: %2d PARM: %08x TIME: %d\n",
|
||||||
i+1, trace->status, trace->count, trace->event, trace->parm,
|
i+1, trace->status, trace->count, trace->event, trace->parm,
|
||||||
trace->time - priv->start_time);
|
trace->time - priv->start_time);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ void up_decodeirq(uint32_t *regs)
|
|||||||
{
|
{
|
||||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
up_ledon(LED_INIRQ);
|
up_ledon(LED_INIRQ);
|
||||||
lib_lowprintf("Unexpected IRQ\n");
|
lowsyslog("Unexpected IRQ\n");
|
||||||
current_regs = regs;
|
current_regs = regs;
|
||||||
PANIC(OSERR_ERREXCEPTION);
|
PANIC(OSERR_ERREXCEPTION);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#undef lldbg
|
#undef lldbg
|
||||||
#define lldbg lib_lowprintf
|
#define lldbg lowsyslog
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#undef lldbg
|
#undef lldbg
|
||||||
#define lldbg lib_lowprintf
|
#define lldbg lowsyslog
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
*
|
*
|
||||||
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
||||||
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
||||||
* defined(CONFIG_ARCH_STACKDUMP)) <-- Or lib_lowprintf() is used
|
* defined(CONFIG_ARCH_STACKDUMP)) <-- Or lowsyslog() is used
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef CONFIG_PRINT_TASKNAME
|
#undef CONFIG_PRINT_TASKNAME
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The following is just intended to keep some ugliness out of the mainline
|
/* The following is just intended to keep some ugliness out of the mainline
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
*
|
*
|
||||||
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
||||||
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
||||||
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lib_lowprintf() is used
|
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef CONFIG_PRINT_TASKNAME
|
#undef CONFIG_PRINT_TASKNAME
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The following is just intended to keep some ugliness out of the mainline
|
/* The following is just intended to keep some ugliness out of the mainline
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
*
|
*
|
||||||
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
||||||
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
||||||
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lib_lowprintf() is used
|
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef CONFIG_PRINT_TASKNAME
|
#undef CONFIG_PRINT_TASKNAME
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#undef lldbg
|
#undef lldbg
|
||||||
#define lldbg lib_lowprintf
|
#define lldbg lowsyslog
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -85,13 +85,13 @@
|
|||||||
|
|
||||||
void up_initialize(void)
|
void up_initialize(void)
|
||||||
{
|
{
|
||||||
/* The real purpose of the following is to make sure that lib_rawprintf
|
/* The real purpose of the following is to make sure that syslog
|
||||||
* is drawn into the link. It is needed by up_tapdev which is linked
|
* is drawn into the link. It is needed by up_tapdev which is linked
|
||||||
* separately.
|
* separately.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_NET
|
#ifdef CONFIG_NET
|
||||||
lib_rawprintf("SIM: Initializing");
|
syslog("SIM: Initializing");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Register devices */
|
/* Register devices */
|
||||||
|
|||||||
+13
-13
@@ -61,7 +61,7 @@
|
|||||||
#include <linux/if_tun.h>
|
#include <linux/if_tun.h>
|
||||||
#include <linux/net.h>
|
#include <linux/net.h>
|
||||||
|
|
||||||
extern int lib_rawprintf(const char *format, ...);
|
extern int syslog(const char *format, ...);
|
||||||
extern int uipdriver_setmacaddr(unsigned char *macaddr);
|
extern int uipdriver_setmacaddr(unsigned char *macaddr);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -119,14 +119,14 @@ static int gtapdevfd;
|
|||||||
#ifdef TAPDEV_DEBUG
|
#ifdef TAPDEV_DEBUG
|
||||||
static inline void dump_ethhdr(const char *msg, unsigned char *buf, int buflen)
|
static inline void dump_ethhdr(const char *msg, unsigned char *buf, int buflen)
|
||||||
{
|
{
|
||||||
lib_rawprintf("TAPDEV: %s %d bytes\n", msg, buflen);
|
syslog("TAPDEV: %s %d bytes\n", msg, buflen);
|
||||||
lib_rawprintf(" %02x:%02x:%02x:%02x:%02x:%02x %02x:%02x:%02x:%02x:%02x:%02x %02x%02x\n",
|
syslog(" %02x:%02x:%02x:%02x:%02x:%02x %02x:%02x:%02x:%02x:%02x:%02x %02x%02x\n",
|
||||||
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5],
|
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5],
|
||||||
buf[6], buf[7], buf[8], buf[9], buf[10], buf[11],
|
buf[6], buf[7], buf[8], buf[9], buf[10], buf[11],
|
||||||
#ifdef CONFIG_ENDIAN_BIG
|
#ifdef CONFIG_ENDIAN_BIG
|
||||||
buf[13], buf[12]);
|
buf[13], buf[12]);
|
||||||
#else
|
#else
|
||||||
buf[12], buf[13]);
|
buf[12], buf[13]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -179,7 +179,7 @@ void tapdev_init(void)
|
|||||||
gtapdevfd = open(DEVTAP, O_RDWR, 0644);
|
gtapdevfd = open(DEVTAP, O_RDWR, 0644);
|
||||||
if (gtapdevfd < 0)
|
if (gtapdevfd < 0)
|
||||||
{
|
{
|
||||||
lib_rawprintf("TAPDEV: open failed: %d\n", -gtapdevfd );
|
syslog("TAPDEV: open failed: %d\n", -gtapdevfd );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ void tapdev_init(void)
|
|||||||
ret = ioctl(gtapdevfd, TUNSETIFF, (unsigned long) &ifr);
|
ret = ioctl(gtapdevfd, TUNSETIFF, (unsigned long) &ifr);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
lib_rawprintf("TAPDEV: ioctl failed: %d\n", -ret );
|
syslog("TAPDEV: ioctl failed: %d\n", -ret );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +235,7 @@ unsigned int tapdev_read(unsigned char *buf, unsigned int buflen)
|
|||||||
ret = read(gtapdevfd, buf, buflen);
|
ret = read(gtapdevfd, buf, buflen);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
lib_rawprintf("TAPDEV: read failed: %d\n", -ret);
|
syslog("TAPDEV: read failed: %d\n", -ret);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,12 +247,12 @@ void tapdev_send(unsigned char *buf, unsigned int buflen)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
#ifdef TAPDEV_DEBUG
|
#ifdef TAPDEV_DEBUG
|
||||||
lib_rawprintf("tapdev_send: sending %d bytes\n", buflen);
|
syslog("tapdev_send: sending %d bytes\n", buflen);
|
||||||
|
|
||||||
gdrop++;
|
gdrop++;
|
||||||
if(gdrop % 8 == 7)
|
if(gdrop % 8 == 7)
|
||||||
{
|
{
|
||||||
lib_rawprintf("Dropped a packet!\n");
|
syslog("Dropped a packet!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -260,7 +260,7 @@ void tapdev_send(unsigned char *buf, unsigned int buflen)
|
|||||||
ret = write(gtapdevfd, buf, buflen);
|
ret = write(gtapdevfd, buf, buflen);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
lib_rawprintf("TAPDEV: write failed: %d", -ret);
|
syslog("TAPDEV: write failed: %d", -ret);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
dump_ethhdr("write", buf, buflen);
|
dump_ethhdr("write", buf, buflen);
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The following is just intended to keep some ugliness out of the mainline
|
/* The following is just intended to keep some ugliness out of the mainline
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
*
|
*
|
||||||
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
||||||
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
||||||
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lib_lowprintf() is used
|
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef CONFIG_PRINT_TASKNAME
|
#undef CONFIG_PRINT_TASKNAME
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
/* Output debug info -- even if debug is not selected. */
|
/* Output debug info -- even if debug is not selected. */
|
||||||
|
|
||||||
#undef lldbg
|
#undef lldbg
|
||||||
#define lldbg lib_lowprintf
|
#define lldbg lowsyslog
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -53,9 +53,9 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_LOWPUTC
|
#ifdef CONFIG_ARCH_LOWPUTC
|
||||||
# define SYSDBG lib_lowprintf
|
# define SYSDBG lowsyslog
|
||||||
#else
|
#else
|
||||||
# define SYSDBG lib_rawprintf
|
# define SYSDBG syslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs)
|
|||||||
|
|
||||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
|
|
||||||
lib_lowprintf("Unexpected IRQ\n");
|
lowsyslog("Unexpected IRQ\n");
|
||||||
IRQ_ENTER(regs);
|
IRQ_ENTER(regs);
|
||||||
PANIC(OSERR_ERREXCEPTION);
|
PANIC(OSERR_ERREXCEPTION);
|
||||||
return NULL; /* Won't get here */
|
return NULL; /* Won't get here */
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
# undef lldbg
|
# undef lldbg
|
||||||
# define lldbg lib_lowprintf
|
# define lldbg lowsyslog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#undef ELF_DUMP_READDATA /* Define to dump all file data read */
|
#undef ELF_DUMP_READDATA /* Define to dump all file data read */
|
||||||
#define DUMPER lib_rawprintf /* If ELF_DUMP_READDATA is defined, this
|
#define DUMPER syslog /* If ELF_DUMP_READDATA is defined, this
|
||||||
* is the API used to dump data */
|
* is the API used to dump data */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#undef NXFLAT_DUMP_READDATA /* Define to dump all file data read */
|
#undef NXFLAT_DUMP_READDATA /* Define to dump all file data read */
|
||||||
#define DUMPER lib_rawprintf /* If NXFLAT_DUMP_READDATA is defined, this
|
#define DUMPER syslog /* If NXFLAT_DUMP_READDATA is defined, this
|
||||||
* is the API used to dump data */
|
* is the API used to dump data */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
+1
-1
@@ -261,7 +261,7 @@ defconfig -- This is a configuration file similar to the Linux
|
|||||||
|
|
||||||
CONFIG_DEBUG - enables built-in debug options
|
CONFIG_DEBUG - enables built-in debug options
|
||||||
CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
||||||
CCONFIG_DEBUG_ENABLE - Support an interface to enable or disable debug output.
|
CCONFIG_SYSLOG_ENABLE - Support an interface to enable or disable debug output.
|
||||||
CONFIG_DEBUG_SYMBOLS - build without optimization and with
|
CONFIG_DEBUG_SYMBOLS - build without optimization and with
|
||||||
debug symbols (needed for use with a debugger).
|
debug symbols (needed for use with a debugger).
|
||||||
CONFIG_DEBUG_SCHED - enable OS debug output (disabled by
|
CONFIG_DEBUG_SCHED - enable OS debug output (disabled by
|
||||||
|
|||||||
@@ -101,13 +101,13 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||||
# ifdef CONFIG_DEBUG
|
# ifdef CONFIG_DEBUG
|
||||||
# define message(...) lib_lowprintf(__VA_ARGS__)
|
# define message(...) lowsyslog(__VA_ARGS__)
|
||||||
# else
|
# else
|
||||||
# define message(...) printf(__VA_ARGS__)
|
# define message(...) printf(__VA_ARGS__)
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# ifdef CONFIG_DEBUG
|
# ifdef CONFIG_DEBUG
|
||||||
# define message lib_lowprintf
|
# define message lowsyslog
|
||||||
# else
|
# else
|
||||||
# define message printf
|
# define message printf
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||||
# ifdef CONFIG_DEBUG
|
# ifdef CONFIG_DEBUG
|
||||||
# define message(...) lib_lowprintf(__VA_ARGS__)
|
# define message(...) lowsyslog(__VA_ARGS__)
|
||||||
# define msgflush()
|
# define msgflush()
|
||||||
# else
|
# else
|
||||||
# define message(...) printf(__VA_ARGS__)
|
# define message(...) printf(__VA_ARGS__)
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# ifdef CONFIG_DEBUG
|
# ifdef CONFIG_DEBUG
|
||||||
# define message lib_lowprintf
|
# define message lowsyslog
|
||||||
# define msgflush()
|
# define msgflush()
|
||||||
# else
|
# else
|
||||||
# define message printf
|
# define message printf
|
||||||
|
|||||||
@@ -54,13 +54,13 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||||
# ifdef CONFIG_DEBUG
|
# ifdef CONFIG_DEBUG
|
||||||
# define message(...) lib_lowprintf(__VA_ARGS__)
|
# define message(...) lowsyslog(__VA_ARGS__)
|
||||||
# else
|
# else
|
||||||
# define message(...) printf(__VA_ARGS__)
|
# define message(...) printf(__VA_ARGS__)
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# ifdef CONFIG_DEBUG
|
# ifdef CONFIG_DEBUG
|
||||||
# define message lib_lowprintf
|
# define message lowsyslog
|
||||||
# else
|
# else
|
||||||
# define message printf
|
# define message printf
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -100,13 +100,13 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||||
# ifdef CONFIG_DEBUG
|
# ifdef CONFIG_DEBUG
|
||||||
# define message(...) lib_lowprintf(__VA_ARGS__)
|
# define message(...) lowsyslog(__VA_ARGS__)
|
||||||
# else
|
# else
|
||||||
# define message(...) printf(__VA_ARGS__)
|
# define message(...) printf(__VA_ARGS__)
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# ifdef CONFIG_DEBUG
|
# ifdef CONFIG_DEBUG
|
||||||
# define message lib_lowprintf
|
# define message lowsyslog
|
||||||
# else
|
# else
|
||||||
# define message printf
|
# define message printf
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ int usbmsc_archinitialize(void)
|
|||||||
pbuffer = (uint8_t *) malloc (BUFFER_SIZE);
|
pbuffer = (uint8_t *) malloc (BUFFER_SIZE);
|
||||||
if (!pbuffer)
|
if (!pbuffer)
|
||||||
{
|
{
|
||||||
lib_lowprintf ("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n",
|
lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n",
|
||||||
BUFFER_SIZE);
|
BUFFER_SIZE);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,13 +100,13 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||||
# ifdef CONFIG_DEBUG
|
# ifdef CONFIG_DEBUG
|
||||||
# define message(...) lib_lowprintf(__VA_ARGS__)
|
# define message(...) lowsyslog(__VA_ARGS__)
|
||||||
# else
|
# else
|
||||||
# define message(...) printf(__VA_ARGS__)
|
# define message(...) printf(__VA_ARGS__)
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# ifdef CONFIG_DEBUG
|
# ifdef CONFIG_DEBUG
|
||||||
# define message lib_lowprintf
|
# define message lowsyslog
|
||||||
# else
|
# else
|
||||||
# define message printf
|
# define message printf
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ int usbmsc_archinitialize(void)
|
|||||||
pbuffer = (uint8_t *) malloc (BUFFER_SIZE);
|
pbuffer = (uint8_t *) malloc (BUFFER_SIZE);
|
||||||
if (!pbuffer)
|
if (!pbuffer)
|
||||||
{
|
{
|
||||||
lib_lowprintf ("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n",
|
lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n",
|
||||||
BUFFER_SIZE);
|
BUFFER_SIZE);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user