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:
parent
7c329f8b56
commit
b1aa82fcca
@ -62,7 +62,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/* 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
|
||||
* (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
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -56,7 +56,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -54,7 +54,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/* 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
|
||||
* (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
|
||||
|
@ -74,7 +74,7 @@
|
||||
void up_decodeirq(uint32_t* regs)
|
||||
{
|
||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||
lib_lowprintf("Unexpected IRQ\n");
|
||||
lowsyslog("Unexpected IRQ\n");
|
||||
current_regs = regs;
|
||||
PANIC(OSERR_ERREXCEPTION);
|
||||
#else
|
||||
|
@ -74,7 +74,7 @@
|
||||
void up_decodeirq(uint32_t* regs)
|
||||
{
|
||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||
lib_lowprintf("Unexpected IRQ\n");
|
||||
lowsyslog("Unexpected IRQ\n");
|
||||
current_regs = regs;
|
||||
PANIC(OSERR_ERREXCEPTION);
|
||||
#else
|
||||
|
@ -112,7 +112,7 @@ static void lpc214x_decodeirq( uint32_t *regs)
|
||||
#endif
|
||||
{
|
||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||
lib_lowprintf("Unexpected IRQ\n");
|
||||
lowsyslog("Unexpected IRQ\n");
|
||||
current_regs = regs;
|
||||
PANIC(OSERR_ERREXCEPTION);
|
||||
#else
|
||||
|
@ -111,7 +111,7 @@ static void lpc23xx_decodeirq(uint32_t *regs)
|
||||
#endif
|
||||
{
|
||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||
lib_lowprintf("Unexpected IRQ\n");
|
||||
lowsyslog("Unexpected IRQ\n");
|
||||
current_regs = regs;
|
||||
PANIC(OSERR_ERREXCEPTION);
|
||||
#else
|
||||
|
@ -77,7 +77,7 @@
|
||||
void up_decodeirq(uint32_t *regs)
|
||||
{
|
||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||
lib_lowprintf("Unexpected IRQ\n");
|
||||
lowsyslog("Unexpected IRQ\n");
|
||||
current_regs = regs;
|
||||
PANIC(OSERR_ERREXCEPTION);
|
||||
#else
|
||||
|
@ -159,7 +159,7 @@
|
||||
#endif
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
@ -899,11 +899,11 @@ static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
|
||||
struct stm32_trace_s *trace;
|
||||
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++)
|
||||
{
|
||||
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,
|
||||
trace->time - priv->start_time);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ void up_decodeirq(uint32_t *regs)
|
||||
{
|
||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||
up_ledon(LED_INIRQ);
|
||||
lib_lowprintf("Unexpected IRQ\n");
|
||||
lowsyslog("Unexpected IRQ\n");
|
||||
current_regs = regs;
|
||||
PANIC(OSERR_ERREXCEPTION);
|
||||
#else
|
||||
|
@ -63,7 +63,7 @@
|
||||
*/
|
||||
|
||||
#undef lldbg
|
||||
#define lldbg lib_lowprintf
|
||||
#define lldbg lowsyslog
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -63,7 +63,7 @@
|
||||
*/
|
||||
|
||||
#undef lldbg
|
||||
#define lldbg lib_lowprintf
|
||||
#define lldbg lowsyslog
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -61,7 +61,7 @@
|
||||
*
|
||||
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
||||
* (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
|
||||
@ -75,7 +75,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/* 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
|
||||
* (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
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/* 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
|
||||
* (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
|
||||
|
@ -63,7 +63,7 @@
|
||||
*/
|
||||
|
||||
#undef lldbg
|
||||
#define lldbg lib_lowprintf
|
||||
#define lldbg lowsyslog
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -61,7 +61,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -61,7 +61,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -85,13 +85,13 @@
|
||||
|
||||
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
|
||||
* separately.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
lib_rawprintf("SIM: Initializing");
|
||||
syslog("SIM: Initializing");
|
||||
#endif
|
||||
|
||||
/* Register devices */
|
||||
|
@ -61,7 +61,7 @@
|
||||
#include <linux/if_tun.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);
|
||||
|
||||
/****************************************************************************
|
||||
@ -119,8 +119,8 @@ static int gtapdevfd;
|
||||
#ifdef TAPDEV_DEBUG
|
||||
static inline void dump_ethhdr(const char *msg, unsigned char *buf, int buflen)
|
||||
{
|
||||
lib_rawprintf("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("TAPDEV: %s %d bytes\n", msg, buflen);
|
||||
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[6], buf[7], buf[8], buf[9], buf[10], buf[11],
|
||||
#ifdef CONFIG_ENDIAN_BIG
|
||||
@ -179,7 +179,7 @@ void tapdev_init(void)
|
||||
gtapdevfd = open(DEVTAP, O_RDWR, 0644);
|
||||
if (gtapdevfd < 0)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: open failed: %d\n", -gtapdevfd );
|
||||
syslog("TAPDEV: open failed: %d\n", -gtapdevfd );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ void tapdev_init(void)
|
||||
ret = ioctl(gtapdevfd, TUNSETIFF, (unsigned long) &ifr);
|
||||
if (ret < 0)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: ioctl failed: %d\n", -ret );
|
||||
syslog("TAPDEV: ioctl failed: %d\n", -ret );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -235,7 +235,7 @@ unsigned int tapdev_read(unsigned char *buf, unsigned int buflen)
|
||||
ret = read(gtapdevfd, buf, buflen);
|
||||
if (ret < 0)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: read failed: %d\n", -ret);
|
||||
syslog("TAPDEV: read failed: %d\n", -ret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -247,12 +247,12 @@ void tapdev_send(unsigned char *buf, unsigned int buflen)
|
||||
{
|
||||
int ret;
|
||||
#ifdef TAPDEV_DEBUG
|
||||
lib_rawprintf("tapdev_send: sending %d bytes\n", buflen);
|
||||
syslog("tapdev_send: sending %d bytes\n", buflen);
|
||||
|
||||
gdrop++;
|
||||
if(gdrop % 8 == 7)
|
||||
{
|
||||
lib_rawprintf("Dropped a packet!\n");
|
||||
syslog("Dropped a packet!\n");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@ -260,7 +260,7 @@ void tapdev_send(unsigned char *buf, unsigned int buflen)
|
||||
ret = write(gtapdevfd, buf, buflen);
|
||||
if (ret < 0)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: write failed: %d", -ret);
|
||||
syslog("TAPDEV: write failed: %d", -ret);
|
||||
exit(1);
|
||||
}
|
||||
dump_ethhdr("write", buf, buflen);
|
||||
|
@ -63,7 +63,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/* 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
|
||||
* (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
|
||||
|
@ -51,7 +51,7 @@
|
||||
/* Output debug info -- even if debug is not selected. */
|
||||
|
||||
#undef lldbg
|
||||
#define lldbg lib_lowprintf
|
||||
#define lldbg lowsyslog
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -58,7 +58,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -55,7 +55,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -53,9 +53,9 @@
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_LOWPUTC
|
||||
# define SYSDBG lib_lowprintf
|
||||
# define SYSDBG lowsyslog
|
||||
#else
|
||||
# define SYSDBG lib_rawprintf
|
||||
# define SYSDBG syslog
|
||||
#endif
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -76,7 +76,7 @@ FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs)
|
||||
|
||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||
|
||||
lib_lowprintf("Unexpected IRQ\n");
|
||||
lowsyslog("Unexpected IRQ\n");
|
||||
IRQ_ENTER(regs);
|
||||
PANIC(OSERR_ERREXCEPTION);
|
||||
return NULL; /* Won't get here */
|
||||
|
@ -56,7 +56,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -58,7 +58,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -58,7 +58,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -58,7 +58,7 @@
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef lldbg
|
||||
# define lldbg lib_lowprintf
|
||||
# define lldbg lowsyslog
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user