From f914a905566ed97b414c4475a22ff8a7a6f222a0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 24 Jan 2013 16:28:15 +0000 Subject: apps/examples/nettest and poll: Complete Kconfig files git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5556 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/README.txt | 4 ++-- apps/examples/nettest/Kconfig | 43 +++++++++++++++++++++++++++++++++++++++++ apps/examples/nettest/Makefile | 2 +- apps/examples/nettest/nettest.h | 4 ++-- apps/examples/poll/Kconfig | 18 +++++++++++++++++ 5 files changed, 66 insertions(+), 5 deletions(-) (limited to 'apps/examples') diff --git a/apps/examples/README.txt b/apps/examples/README.txt index 5996cbb70..03d43f1a0 100644 --- a/apps/examples/README.txt +++ b/apps/examples/README.txt @@ -675,8 +675,8 @@ examples/mount when CONFIG_EXAMPLES_MOUNT_DEVNAME is not defined. The default is zero (meaning that "/dev/ram0" will be used). -examples/netttest -^^^^^^^^^^^^^^^^^ +examples/nettest +^^^^^^^^^^^^^^^^ This is a simple network test for verifying client- and server- functionality in a TCP/IP connection. diff --git a/apps/examples/nettest/Kconfig b/apps/examples/nettest/Kconfig index 63d34ec3f..613b8ea91 100644 --- a/apps/examples/nettest/Kconfig +++ b/apps/examples/nettest/Kconfig @@ -6,8 +6,51 @@ config EXAMPLES_NETTEST bool "Network test example" default n + depends on NET_TCP ---help--- Enable the network test example if EXAMPLES_NETTEST + +config EXAMPLES_NETTEST_SERVER + bool "Target is server" + default n + ---help--- + Select to use the host as the client side of the test. Default: The + target is the client side of the test + +config EXAMPLES_NETTEST_PERFORMANCE + bool "Test for Performance" + default n + ---help--- + Configure the example to test for network performance. Default: Test + is for network functionality. + +config EXAMPLES_NETTEST_NOMAC + bool "Use Canned MAC Address" + default n + +config EXAMPLES_NETTEST_IPADDR + hex "Target IP address" + default 0x0a000002 + +config EXAMPLES_NETTEST_DRIPADDR + hex "Default Router IP address (Gateway)" + default 0x0a000001 + +config EXAMPLES_NETTEST_NETMASK + hex "Network Mask" + default 0xffffff00 + +config EXAMPLES_NETTEST_CLIENTIP + hex "Client IP Address" + default 0x0a000001 if !EXAMPLES_NETTEST_SERVER + default 0x0a000002 if EXAMPLES_NETTEST_SERVER + ---help--- + IP address of the client. If the target is the client, then + EXAMPLES_NETTEST_CLIENTIP should be the same as + EXAMPLES_NETTEST_IPADDR (default). If the target is the server, + then the default value of EXAMPLES_NETTEST_CLIENTIP is set to the + gateway address, EXAMPLES_NETTEST_DRIPADDR. + endif diff --git a/apps/examples/nettest/Makefile b/apps/examples/nettest/Makefile index 5368bdefc..c533c9dd5 100644 --- a/apps/examples/nettest/Makefile +++ b/apps/examples/nettest/Makefile @@ -64,7 +64,7 @@ else endif endif -HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_HOST=1 +HOSTCFLAGS += -DNETTEST_HOST=1 ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y) HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_SERVER=1 -DCONFIG_EXAMPLES_NETTEST_CLIENTIP="$(CONFIG_EXAMPLES_NETTEST_CLIENTIP)" endif diff --git a/apps/examples/nettest/nettest.h b/apps/examples/nettest/nettest.h index f05038584..37ac470d1 100644 --- a/apps/examples/nettest/nettest.h +++ b/apps/examples/nettest/nettest.h @@ -40,7 +40,7 @@ * Included Files ****************************************************************************/ -#ifdef CONFIG_EXAMPLES_NETTEST_HOST +#ifdef NETTEST_HOST #else # include #endif @@ -49,7 +49,7 @@ * Definitions ****************************************************************************/ -#ifdef CONFIG_EXAMPLES_NETTEST_HOST +#ifdef NETTEST_HOST /* HTONS/L macros are unique to uIP */ # define HTONS(a) htons(a) diff --git a/apps/examples/poll/Kconfig b/apps/examples/poll/Kconfig index c52827496..f35a9200b 100644 --- a/apps/examples/poll/Kconfig +++ b/apps/examples/poll/Kconfig @@ -6,8 +6,26 @@ config EXAMPLES_POLL bool "Poll example" default n + depends on !NSH_BUILTIN_APPS ---help--- Enable the poll example if EXAMPLES_POLL + +config EXAMPLES_POLL_NOMAC + bool "Use Canned MAC Address" + default n + +config EXAMPLES_POLL_IPADDR + hex "Target IP address" + default 0x0a000002 + +config EXAMPLES_POLL_DRIPADDR + hex "Default Router IP address (Gateway)" + default 0x0a000001 + +config EXAMPLES_POLL_NETMASK + hex "Network Mask" + default 0xffffff00 + endif -- cgit v1.2.3 From a2ec48846f786e72a976038c9467b25a61ad5a9f Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 24 Jan 2013 23:18:32 +0000 Subject: Fix some missing logic and inconsistencies in child status logic; Fix a bug introduced into sigaction() git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5560 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/ostest/ostest_main.c | 28 ++++++++ nuttx/TODO | 15 +++- nuttx/net/net_poll.c | 4 +- nuttx/sched/Kconfig | 7 ++ nuttx/sched/os_internal.h | 1 + nuttx/sched/sched_waitid.c | 136 +++++++++++++++++++++++++++---------- nuttx/sched/sched_waitpid.c | 132 ++++++++++++++++++++++------------- nuttx/sched/sig_action.c | 22 +++--- nuttx/sched/task_childstatus.c | 36 ++++++++++ nuttx/sched/task_reparent.c | 24 ++++++- nuttx/sched/task_setup.c | 23 ++++--- 11 files changed, 322 insertions(+), 106 deletions(-) (limited to 'apps/examples') diff --git a/apps/examples/ostest/ostest_main.c b/apps/examples/ostest/ostest_main.c index aab1ff045..3e4197fdc 100644 --- a/apps/examples/ostest/ostest_main.c +++ b/apps/examples/ostest/ostest_main.c @@ -43,8 +43,11 @@ #include #include #include +#include #include #include +#include + #include #include "ostest.h" @@ -264,6 +267,31 @@ static int user_main(int argc, char *argv[]) } check_test_memory_usage(); + /* If retention of child status is enable, then suppress it for this task. + * This task may produce many, many children (especially if + * CONFIG_EXAMPLES_OSTEST_LOOPS) and it does not harvest their exit status. + * As a result, the test may fail inappropriately unless retention of + * child exit status is disabled. + * + * So basically, this tests that child status can be disabled, but cannot + * verify that status is retained correctly. + */ + +#if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS) + { + struct sigaction sa; + int ret; + + sa.sa_handler = SIG_IGN; + sa.sa_flags = SA_NOCLDWAIT; + ret = sigaction(SIGCHLD, &sa, NULL); + if (ret < 0) + { + printf("user_main: ERROR: sigaction failed: %d\n", errno); + } + } +#endif + /* Check environment variables */ #ifndef CONFIG_DISABLE_ENVIRON show_environment(true, true, true); diff --git a/nuttx/TODO b/nuttx/TODO index ed91515ba..d6bd18d12 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -7,7 +7,7 @@ standards, things that could be improved, and ideas for enhancements. nuttx/ (11) Task/Scheduler (sched/) - (1) Memory Managment (mm/) + (2) Memory Managment (mm/) (3) Signals (sched/, arch/) (2) pthreads (sched/) (2) C++ Support @@ -278,6 +278,19 @@ o Memory Managment (mm/) Priority: Medium/Low, a good feature to prevent memory leaks but would have negative impact on memory usage and code size. + Title: CONTAINER ALLOCATOR + Description: There are several places where the logic requires allocation of + a tiny structure that just contains pointers to other things or + small amounts of data that needs to be bundled together. There + are examples net/net_poll.c and numerous other places. + + I am wondering if it would not be good create a pool of generic + containers (say void *[4]). There re-use these when we need + small containers. The code in sched/task_childstatus.c might + be generalized for this purpose. + Status: Open + Priority: Very low (I am not even sure that this is a good idea yet). + o Signals (sched/, arch/) ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/net/net_poll.c b/nuttx/net/net_poll.c index ea6f54a6b..3021ac35e 100644 --- a/nuttx/net/net_poll.c +++ b/nuttx/net/net_poll.c @@ -367,8 +367,7 @@ int psock_poll(FAR struct socket *psock, FAR struct pollfd *fds, bool setup) if (psock->s_type != SOCK_STREAM) { - ret = -ENOSYS; - goto errout; + return -ENOSYS; } #endif @@ -387,7 +386,6 @@ int psock_poll(FAR struct socket *psock, FAR struct pollfd *fds, bool setup) ret = net_pollteardown(psock, fds); } -errout: return ret; } #endif diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig index 7ea301600..7745c2c25 100644 --- a/nuttx/sched/Kconfig +++ b/nuttx/sched/Kconfig @@ -124,6 +124,13 @@ config PREALLOC_CHILDSTATUS sa.sa_flags = SA_NOCLDWAIT; int ret = sigaction(SIGCHLD, &sa, NULL); +config DEBUG_CHILDSTATUS + bool "Enable Child Status Debug Output" + default n + depends on SCHED_CHILD_STATUS && DEBUG + ---help--- + Very detailed... I am sure that you do not want this. + config JULIAN_TIME bool "Enables Julian time conversions" default n diff --git a/nuttx/sched/os_internal.h b/nuttx/sched/os_internal.h index 7d5095bad..dc87cb9a4 100644 --- a/nuttx/sched/os_internal.h +++ b/nuttx/sched/os_internal.h @@ -274,6 +274,7 @@ void weak_function task_initialize(void); FAR struct child_status_s *task_allocchild(void); void task_freechild(FAR struct child_status_s *status); void task_addchild(FAR _TCB *tcb, FAR struct child_status_s *child); +FAR struct child_status_s *task_exitchild(FAR _TCB *tcb); FAR struct child_status_s *task_findchild(FAR _TCB *tcb, pid_t pid); FAR struct child_status_s *task_removechild(FAR _TCB *tcb, pid_t pid); void task_removechildren(FAR _TCB *tcb); diff --git a/nuttx/sched/sched_waitid.c b/nuttx/sched/sched_waitid.c index 37ee26ce0..e73bc223c 100644 --- a/nuttx/sched/sched_waitid.c +++ b/nuttx/sched/sched_waitid.c @@ -53,6 +53,36 @@ * Private Functions *****************************************************************************/ +/***************************************************************************** + * Name: exitted_child + * + * Description: + * Handle the case where a child exitted properlay was we (apparently) lost + * the detch of child signal. + * + *****************************************************************************/ + +#ifdef CONFIG_SCHED_CHILD_STATUS +static void exitted_child(FAR _TCB *rtcb, FAR struct child_status_s *child, + FAR siginfo_t *info) +{ + /* The child has exited. Return the saved exit status (and some fudged + * information. + */ + + info->si_signo = SIGCHLD; + info->si_code = CLD_EXITED; + info->si_value.sival_ptr = NULL; + info->si_pid = child->ch_pid; + info->si_status = child->ch_status; + + /* Discard the child entry */ + + (void)task_removechild(rtcb, child->ch_pid); + task_freechild(child); +} +#endif + /***************************************************************************** * Public Functions *****************************************************************************/ @@ -120,9 +150,14 @@ * *****************************************************************************/ -int waitid(idtype_t idtype, id_t id, siginfo_t *info, int options) +int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options) { FAR _TCB *rtcb = (FAR _TCB *)g_readytorun.head; + FAR _TCB *ctcb; +#ifdef CONFIG_SCHED_CHILD_STATUS + FAR struct child_status_s *child; + bool retains; +#endif sigset_t sigset; int err; int ret; @@ -160,7 +195,11 @@ int waitid(idtype_t idtype, id_t id, siginfo_t *info, int options) */ #ifdef CONFIG_SCHED_CHILD_STATUS - if (rtcb->children == NULL) + /* Does this task retain child status? */ + + retains = ((rtcb->flags && TCB_FLAG_NOCLDWAIT) == 0); + + if (rtcb->children == NULL && retains) { /* There are no children */ @@ -169,13 +208,29 @@ int waitid(idtype_t idtype, id_t id, siginfo_t *info, int options) } else if (idtype == P_PID) { - if (task_findchild(rtcb, (pid_t)id) == NULL) - { - /* This specific pid is not a child */ + /* Get the TCB corresponding to this PID and make sure it is our child. */ + ctcb = sched_gettcb((pid_t)id); + if (!ctcb || ctcb->parent != rtcb->pid) + { err = ECHILD; goto errout_with_errno; } + + /* Does this task retain child status? */ + + if (retains) + { + /* Check if this specific pid has allocated child status? */ + + if (task_findchild(rtcb, (pid_t)id) == NULL) + { + /* This specific pid is not a child */ + + err = ECHILD; + goto errout_with_errno; + } + } } #else if (rtcb->nchildren == 0) @@ -189,7 +244,7 @@ int waitid(idtype_t idtype, id_t id, siginfo_t *info, int options) { /* Get the TCB corresponding to this PID and make sure it is our child. */ - FAR _TCB *ctcb = sched_gettcb((pid_t)id); + ctcb = sched_gettcb((pid_t)id); if (!ctcb || ctcb->parent != rtcb->pid) { err = ECHILD; @@ -209,48 +264,61 @@ int waitid(idtype_t idtype, id_t id, siginfo_t *info, int options) * instead). */ - DEBUGASSERT(rtcb->children); - if (rtcb->children == NULL) + DEBUGASSERT(!retains || rtcb->children); + if (idtype == P_ALL) { - /* This should not happen. I am just wasting your FLASH. */ + /* We are waiting for any child to exit */ - err = ECHILD; - goto errout_with_errno; + if (retains && (child = task_exitchild(rtcb)) != NULL) + { + /* A child has exitted. Apparently we missed the signal. + * Return the exit status and break out of the loop. + */ + + exitted_child(rtcb, child, info); + break; + } } - else if (idtype == P_PID) - { - FAR struct child_status_s *child; - /* We are waiting for a specific PID. Get the current status - * of the child task. - */ + /* We are waiting for a specific PID. Does this task retain child status? */ + + else if (retains) + { + /* Yes ... Get the current status of the child task. */ child = task_findchild(rtcb, (pid_t)id); DEBUGASSERT(child); - if (!child) - { - /* Yikes! The child status entry just disappeared! */ - - err = ECHILD; - goto errout_with_errno; - } - + /* Did the child exit? */ if ((child->ch_flags & CHILD_FLAG_EXITED) != 0) { - /* The child has exited. Return the saved exit status */ + /* The child has exited. Return the exit status and break out + * of the loop. + */ - info->si_signo = SIGCHLD; - info->si_code = CLD_EXITED; - info->si_value.sival_ptr = NULL; - info->si_pid = (pid_t)id; - info->si_status = child->ch_status; + exitted_child(rtcb, child, info); + break; + } + } + else + { + /* We can use kill() with signal number 0 to determine if that + * task is still alive. + */ - /* Discard the child entry and break out of the loop */ + ret = kill((pid_t)id, 0); + if (ret < 0) + { + /* It is no longer running. We know that the child task + * was running okay when we started, so we must have lost + * the signal. In this case, we know that the task exit'ed, + * but we do not know its exit status. It would be better + * to reported ECHILD than bogus status. + */ - (void)task_removechild(rtcb, (pid_t)id); - task_freechild(child); + err = ECHILD; + goto errout_with_errno; } } #else diff --git a/nuttx/sched/sched_waitpid.c b/nuttx/sched/sched_waitpid.c index fe3f7167d..ecdc60a2c 100644 --- a/nuttx/sched/sched_waitpid.c +++ b/nuttx/sched/sched_waitpid.c @@ -185,7 +185,7 @@ #ifndef CONFIG_SCHED_HAVE_PARENT pid_t waitpid(pid_t pid, int *stat_loc, int options) { - _TCB *tcb; + _TCB *ctcb; bool mystat; int err; int ret; @@ -208,8 +208,8 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) /* Get the TCB corresponding to this PID */ - tcb = sched_gettcb(pid); - if (!tcb) + ctcb = sched_gettcb(pid); + if (!ctcb) { err = ECHILD; goto errout_with_errno; @@ -221,15 +221,15 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) * others? */ - if (stat_loc != NULL && tcb->stat_loc == NULL) + if (stat_loc != NULL && ctcb->stat_loc == NULL) { - tcb->stat_loc = stat_loc; - mystat = true; + ctcb->stat_loc = stat_loc; + mystat = true; } /* Then wait for the task to exit */ - ret = sem_wait(&tcb->exitsem); + ret = sem_wait(&ctcb->exitsem); if (ret < 0) { /* Unlock pre-emption and return the ERROR (sem_wait has already set @@ -239,7 +239,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) if (mystat) { - tcb->stat_loc = NULL; + ctcb->stat_loc = NULL; } goto errout; @@ -274,8 +274,10 @@ errout: pid_t waitpid(pid_t pid, int *stat_loc, int options) { FAR _TCB *rtcb = (FAR _TCB *)g_readytorun.head; + FAR _TCB *ctcb; #ifdef CONFIG_SCHED_CHILD_STATUS FAR struct child_status_s *child; + bool retains; #endif FAR struct siginfo info; sigset_t sigset; @@ -303,27 +305,43 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) sched_lock(); - /* Verify that this task actually has children and that the the request - * TCB is actually a child of this task. + /* Verify that this task actually has children and that the requested PID + * is actually a child of this task. */ #ifdef CONFIG_SCHED_CHILD_STATUS - if (rtcb->children == NULL) - { - /* There are no children */ + /* Does this task retain child status? */ + retains = ((rtcb->flags && TCB_FLAG_NOCLDWAIT) == 0); + + if (rtcb->children == NULL && retains) + { err = ECHILD; goto errout_with_errno; } else if (pid != (pid_t)-1) { - /* This specific pid is not a child */ + /* Get the TCB corresponding to this PID and make sure it is our child. */ - if (task_findchild(rtcb, pid) == NULL) + ctcb = sched_gettcb(pid); + if (!ctcb || ctcb->parent != rtcb->pid) { err = ECHILD; goto errout_with_errno; } + + /* Does this task retain child status? */ + + if (retains) + { + /* Check if this specific pid has allocated child status? */ + + if (task_findchild(rtcb, pid) == NULL) + { + err = ECHILD; + goto errout_with_errno; + } + } } #else if (rtcb->nchildren == 0) @@ -337,7 +355,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) { /* Get the TCB corresponding to this PID and make sure it is our child. */ - FAR _TCB *ctcb = sched_gettcb(pid); + ctcb = sched_gettcb(pid); if (!ctcb || ctcb->parent != rtcb->pid) { err = ECHILD; @@ -350,6 +368,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) for (;;) { +#ifdef CONFIG_SCHED_CHILD_STATUS /* Check if the task has already died. Signals are not queued in * NuttX. So a possibility is that the child has died and we * missed the death of child signal (we got some other signal @@ -362,39 +381,33 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) * chilren. */ -#ifdef CONFIG_SCHED_CHILD_STATUS - DEBUGASSERT(rtcb->children); - if (rtcb->children == NULL) -#else - if (rtcb->nchildren == 0) -#endif + DEBUGASSERT(!retains || rtcb->children); + if (retains && (child = task_exitchild(rtcb)) != NULL) { - /* There were one or more children when we started so they - * must have exit'ed. There are just no bread crumbs left - * behind to tell us the PID(s) of the existed children. - * Reporting ECHLD is about all we can do in this case. + /* A child has exitted. Apparently we missed the signal. + * Return the saved exit status. */ - err = ECHILD; - goto errout_with_errno; + /* The child has exited. Return the saved exit status */ + + *stat_loc = child->ch_status; + + /* Discard the child entry and break out of the loop */ + + (void)task_removechild(rtcb, child->ch_pid); + task_freechild(child); + break; } } - else + + /* We are waiting for a specific PID. Does this task retain child status? */ + + else if (retains) { -#ifdef CONFIG_SCHED_CHILD_STATUS - /* We are waiting for a specific PID. Get the current status - * of the child task. - */ + /* Get the current status of the child task. */ child = task_findchild(rtcb, pid); DEBUGASSERT(child); - if (!child) - { - /* Yikes! The child status entry just disappeared! */ - - err = ECHILD; - goto errout_with_errno; - } /* Did the child exit? */ @@ -408,27 +421,48 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) (void)task_removechild(rtcb, pid); task_freechild(child); + break; } -#else - /* We are waiting for a specific PID. We can use kill() with - * signal number 0 to determine if that task is still alive. + } + else + { + /* We can use kill() with signal number 0 to determine if that + * task is still alive. */ ret = kill(pid, 0); if (ret < 0) { - /* It is no longer running. We know that the child task was - * running okay when we started, so we must have lost the - * signal. In this case, we know that the task exit'ed, but - * we do not know its exit status. It would be better to - * reported ECHILD that bogus status. + /* It is no longer running. We know that the child task + * was running okay when we started, so we must have lost + * the signal. In this case, we know that the task exit'ed, + * but we do not know its exit status. It would be better + * to reported ECHILD than bogus status. */ err = ECHILD; goto errout_with_errno; } -#endif } +#else + /* Check if the task has already died. Signals are not queued in + * NuttX. So a possibility is that the child has died and we + * missed the death of child signal (we got some other signal + * instead). + */ + + if (rtcb->nchildren == 0 || + (pid != (pid_t)-1 && (ret = kill((pid_t)id, 0)) < 0)) + { + /* We know that the child task was running okay we stared, + * so we must have lost the signal. What can we do? + * Let's claim we were interrupted by a signal. + */ + + err = EINTR; + goto errout_with_errno; + } +#endif /* Wait for any death-of-child signal */ diff --git a/nuttx/sched/sig_action.c b/nuttx/sched/sig_action.c index 708667993..7d84b6291 100644 --- a/nuttx/sched/sig_action.c +++ b/nuttx/sched/sig_action.c @@ -169,7 +169,6 @@ int sigaction(int signo, FAR const struct sigaction *act, FAR struct sigaction * { FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head; FAR sigactq_t *sigact; - int ret; /* Since sigactions can only be installed from the running thread of * execution, no special precautions should be necessary. @@ -251,24 +250,31 @@ int sigaction(int signo, FAR const struct sigaction *act, FAR struct sigaction * if (act->sa_u._sa_handler == SIG_IGN) { - /* If there is a old sigaction, remove it from sigactionq */ + /* Do we still have a sigaction container from the previous setting? */ - sq_rem((FAR sq_entry_t*)sigact, &rtcb->sigactionq); + if (sigact) + { + /* Yes.. Remove it from sigactionq */ + + sq_rem((FAR sq_entry_t*)sigact, &rtcb->sigactionq); - /* And deallocate it */ + /* And deallocate it */ - sig_releaseaction(sigact); + sig_releaseaction(sigact); + } } /* A sigaction has been supplied */ else { - /* Check if a sigaction was found */ + /* Do we still have a sigaction container from the previous setting? + * If so, then re-use for the new signal action. + */ if (!sigact) { - /* No sigaction was found, but one is needed. Allocate one. */ + /* No.. Then we need to allocate one for the new action. */ sigact = sig_allocateaction(); @@ -294,7 +300,7 @@ int sigaction(int signo, FAR const struct sigaction *act, FAR struct sigaction * COPY_SIGACTION(&sigact->act, act); } - return ret; + return OK; } /**************************************************************************** diff --git a/nuttx/sched/task_childstatus.c b/nuttx/sched/task_childstatus.c index 0f6d36c29..09aa48135 100644 --- a/nuttx/sched/task_childstatus.c +++ b/nuttx/sched/task_childstatus.c @@ -297,6 +297,42 @@ FAR struct child_status_s *task_findchild(FAR _TCB *tcb, pid_t pid) return NULL; } +/***************************************************************************** + * Name: task_exitchild + * + * Description: + * Search for any child that has exitted. + * + * Parameters: + * tcb - The TCB of the parent task to containing the child status. + * + * Return Value: + * On success, a non-NULL pointer to a child status structure for the + * exited child. NULL is returned if not child has exited. + * + * Assumptions: + * Called during SIGCHLD processing in a safe context. No special precautions + * are required here. + * + *****************************************************************************/ + +FAR struct child_status_s *task_exitchild(FAR _TCB *tcb) +{ + FAR struct child_status_s *child; + + /* Find the status structure with the matching PID */ + + for (child = tcb->children; child; child = child->flink) + { + if ((child->ch_flags & CHILD_FLAG_EXITED) != 0) + { + return child; + } + } + + return NULL; +} + /***************************************************************************** * Name: task_removechild * diff --git a/nuttx/sched/task_reparent.c b/nuttx/sched/task_reparent.c index 28d371bf1..3a7ece37d 100644 --- a/nuttx/sched/task_reparent.c +++ b/nuttx/sched/task_reparent.c @@ -138,14 +138,32 @@ int task_reparent(pid_t ppid, pid_t chpid) child = task_removechild(otcb, chpid); if (child) { - /* Add the child status entry to the new parent TCB */ + /* Has the new parent supressed child exit status? */ + + if ((ptcb->flags && TCB_FLAG_NOCLDWAIT) == 0) + { + /* No.. Add the child status entry to the new parent TCB */ + + task_addchild(ptcb, child); + } + else + { + /* Yes.. Discard the child status entry */ + + task_freechild(child); + } + + /* Either case is a success */ - task_addchild(ptcb, child); ret = OK; } else { - ret = -ENOENT; + /* This would not be an error if the original parent has + * suppressed child exit status. + */ + + ret = ((otcb->flags && TCB_FLAG_NOCLDWAIT) == 0) ? -ENOENT : OK; } #else DEBUGASSERT(otcb->nchildren > 0); diff --git a/nuttx/sched/task_setup.c b/nuttx/sched/task_setup.c index 8f54b2e93..66c948cfd 100644 --- a/nuttx/sched/task_setup.c +++ b/nuttx/sched/task_setup.c @@ -150,7 +150,8 @@ static int task_assignpid(FAR _TCB *tcb) * Name: task_saveparent * * Description: - * Save the task ID of the parent task in the child task's TCB. + * Save the task ID of the parent task in the child task's TCB and allocate + * a child status structure to catch the child task's exit status. * * Parameters: * tcb - The TCB of the new, child task. @@ -177,11 +178,15 @@ static inline void task_saveparent(FAR _TCB *tcb, uint8_t ttype) tcb->parent = rtcb->pid; - /* Exit status only needs to be retained for the case of tasks, however */ +#ifdef CONFIG_SCHED_CHILD_STATUS + /* Exit status only needs to be retained for the case of tasks, however. + * Tasks can also suppress retention of their child status by applying + * the SA_NOCLDWAIT flag with sigaction()/ + */ - if (ttype == TCB_FLAG_TTYPE_TASK) + if (ttype == TCB_FLAG_TTYPE_TASK && + (rtcb->flags && TCB_FLAG_NOCLDWAIT) == 0) { -#ifdef CONFIG_SCHED_CHILD_STATUS FAR struct child_status_s *child; /* Make sure that there is not already a structure for this PID in the @@ -212,11 +217,11 @@ static inline void task_saveparent(FAR _TCB *tcb, uint8_t ttype) task_addchild(rtcb, child); } + } #else - DEBUGASSERT(rtcb->nchildren < UINT16_MAX); - rtcb->nchildren++; + DEBUGASSERT(rtcb->nchildren < UINT16_MAX); + rtcb->nchildren++; #endif - } } #else # define task_saveparent(tcb,ttype) @@ -318,7 +323,9 @@ int task_schedsetup(FAR _TCB *tcb, int priority, start_t start, main_t main, tcb->flags &= ~TCB_FLAG_TTYPE_MASK; tcb->flags |= ttype; - /* Save the task ID of the parent task in the TCB */ + /* Save the task ID of the parent task in the TCB and allocate + * a child status structure. + */ task_saveparent(tcb, ttype); -- cgit v1.2.3 From b6472b58dcce32d4ab2051f13cef89a6f0296c28 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 25 Jan 2013 00:01:08 +0000 Subject: Fix some compilation errors when child status disabled; new waitpid logic not encoding/decoding status properly git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5561 42af7a65-404d-4744-a932-0658087f49c3 --- apps/ChangeLog.txt | 2 ++ apps/examples/ostest/waitpid.c | 18 +++++++++--------- nuttx/sched/pthread_join.c | 2 +- nuttx/sched/sched_waitid.c | 12 ++++++------ nuttx/sched/sched_waitpid.c | 10 +++++----- nuttx/sched/task_childstatus.c | 4 ++-- nuttx/sched/timer_initialize.c | 2 +- 7 files changed, 26 insertions(+), 24 deletions(-) (limited to 'apps/examples') diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 5f3440897..494ce34eb 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -493,3 +493,5 @@ * apps/netutils/telnetd/telnetd_driver: Was stuck in a loop if recv[from]() ever returned a value <= 0. * apps/examples/nettest and poll: Complete Kconfig files. + * apps/examples/ostest/waitpid.c: Need to use WEXITSTATUS() + to decode the correct exit status. diff --git a/apps/examples/ostest/waitpid.c b/apps/examples/ostest/waitpid.c index e53b49213..d45410265 100644 --- a/apps/examples/ostest/waitpid.c +++ b/apps/examples/ostest/waitpid.c @@ -113,14 +113,14 @@ static void waitpid_last(void) printf("waitpid_last: ERROR: PID %d waitpid failed: %d\n", g_waitpids[NCHILDREN-1], errcode); } - else if (stat_loc != RETURN_STATUS) + else if (WEXITSTATUS(stat_loc) != RETURN_STATUS) { printf("waitpid_last: ERROR: PID %d return status is %d, expected %d\n", - g_waitpids[NCHILDREN-1], stat_loc, RETURN_STATUS); + g_waitpids[NCHILDREN-1], WEXITSTATUS(stat_loc), RETURN_STATUS); } else { - printf("waitpid_last: PID %d waitpid succeeded with stat_loc=%d\n", + printf("waitpid_last: PID %d waitpid succeeded with stat_loc=%04x\n", g_waitpids[NCHILDREN-1], stat_loc); } } @@ -155,14 +155,14 @@ int waitpid_test(void) printf("waitpid_test: ERROR: PID %d wait returned PID %d\n", g_waitpids[0], ret); } - else if (stat_loc != RETURN_STATUS) + else if (WEXITSTATUS(stat_loc) != RETURN_STATUS) { printf("waitpid_test: ERROR: PID %d return status is %d, expected %d\n", - g_waitpids[0], stat_loc, RETURN_STATUS); + g_waitpids[0], WEXITSTATUS(stat_loc), RETURN_STATUS); } else { - printf("waitpid_test: PID %d waitpid succeeded with stat_loc=%d\n", + printf("waitpid_test: PID %d waitpid succeeded with stat_loc=%04x\n", g_waitpids[0], stat_loc); } @@ -246,14 +246,14 @@ int waitpid_test(void) int errcode = errno; printf("waitpid_test: ERROR: wait failed: %d\n", errcode); } - else if (stat_loc != RETURN_STATUS) + else if (WEXITSTATUS(stat_loc) != RETURN_STATUS) { printf("waitpid_test: ERROR: PID %d return status is %d, expected %d\n", - ret, stat_loc, RETURN_STATUS); + ret, WEXITSTATUS(stat_loc), RETURN_STATUS); } else { - printf("waitpid_test: PID %d wait succeeded with stat_loc=%d\n", + printf("waitpid_test: PID %d wait succeeded with stat_loc=%04x\n", ret, stat_loc); } diff --git a/nuttx/sched/pthread_join.c b/nuttx/sched/pthread_join.c index 6a02af352..d3f648dc7 100644 --- a/nuttx/sched/pthread_join.c +++ b/nuttx/sched/pthread_join.c @@ -123,7 +123,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) * This can fail for one of three reasons: (1) There is no * thread associated with 'thread,' (2) the thread is a task * and does not have join information, or (3) the thread - * was detached and has exitted. + * was detached and has exited. */ pjoin = pthread_findjoininfo((pid_t)thread); diff --git a/nuttx/sched/sched_waitid.c b/nuttx/sched/sched_waitid.c index e73bc223c..56bfb36f0 100644 --- a/nuttx/sched/sched_waitid.c +++ b/nuttx/sched/sched_waitid.c @@ -54,16 +54,16 @@ *****************************************************************************/ /***************************************************************************** - * Name: exitted_child + * Name: exited_child * * Description: - * Handle the case where a child exitted properlay was we (apparently) lost + * Handle the case where a child exited properlay was we (apparently) lost * the detch of child signal. * *****************************************************************************/ #ifdef CONFIG_SCHED_CHILD_STATUS -static void exitted_child(FAR _TCB *rtcb, FAR struct child_status_s *child, +static void exited_child(FAR _TCB *rtcb, FAR struct child_status_s *child, FAR siginfo_t *info) { /* The child has exited. Return the saved exit status (and some fudged @@ -271,11 +271,11 @@ int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options) if (retains && (child = task_exitchild(rtcb)) != NULL) { - /* A child has exitted. Apparently we missed the signal. + /* A child has exited. Apparently we missed the signal. * Return the exit status and break out of the loop. */ - exitted_child(rtcb, child, info); + exited_child(rtcb, child, info); break; } } @@ -297,7 +297,7 @@ int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options) * of the loop. */ - exitted_child(rtcb, child, info); + exited_child(rtcb, child, info); break; } } diff --git a/nuttx/sched/sched_waitpid.c b/nuttx/sched/sched_waitpid.c index ecdc60a2c..d7484fca9 100644 --- a/nuttx/sched/sched_waitpid.c +++ b/nuttx/sched/sched_waitpid.c @@ -384,13 +384,13 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) DEBUGASSERT(!retains || rtcb->children); if (retains && (child = task_exitchild(rtcb)) != NULL) { - /* A child has exitted. Apparently we missed the signal. + /* A child has exited. Apparently we missed the signal. * Return the saved exit status. */ /* The child has exited. Return the saved exit status */ - *stat_loc = child->ch_status; + *stat_loc = child->ch_status << 8; /* Discard the child entry and break out of the loop */ @@ -415,7 +415,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) { /* The child has exited. Return the saved exit status */ - *stat_loc = child->ch_status; + *stat_loc = child->ch_status << 8; /* Discard the child entry and break out of the loop */ @@ -452,7 +452,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) */ if (rtcb->nchildren == 0 || - (pid != (pid_t)-1 && (ret = kill((pid_t)id, 0)) < 0)) + (pid != (pid_t)-1 && (ret = kill(pid, 0)) < 0)) { /* We know that the child task was running okay we stared, * so we must have lost the signal. What can we do? @@ -481,7 +481,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) { /* Yes... return the status and PID (in the event it was -1) */ - *stat_loc = info.si_status; + *stat_loc = info.si_status << 8; pid = info.si_pid; break; } diff --git a/nuttx/sched/task_childstatus.c b/nuttx/sched/task_childstatus.c index 09aa48135..6007f03e5 100644 --- a/nuttx/sched/task_childstatus.c +++ b/nuttx/sched/task_childstatus.c @@ -121,7 +121,7 @@ static void task_dumpchildren(FAR _TCB *tcb, FAR const char *msg) } } #else -# task_dumpchildren(t,m) +# define task_dumpchildren(t,m) #endif /***************************************************************************** @@ -320,7 +320,7 @@ FAR struct child_status_s *task_exitchild(FAR _TCB *tcb) { FAR struct child_status_s *child; - /* Find the status structure with the matching PID */ + /* Find the status structure of any child task that has exitted. */ for (child = tcb->children; child; child = child->flink) { diff --git a/nuttx/sched/timer_initialize.c b/nuttx/sched/timer_initialize.c index 05980bb1a..2651469ef 100644 --- a/nuttx/sched/timer_initialize.c +++ b/nuttx/sched/timer_initialize.c @@ -137,7 +137,7 @@ void weak_function timer_initialize(void) * resources are referenced. * * Parameters: - * pid - the task ID of the thread that exitted + * pid - the task ID of the thread that exited * * Return Value: * None -- cgit v1.2.3 From e96d8f046b6bce6c4e810b302c1cc1cc578bdae3 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 27 Jan 2013 15:52:58 +0000 Subject: Add a start hook that can be setup to call a function in the context of a new thread before the new threads main() has been called. git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5571 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/elf/tests/signal/signal.c | 2 +- apps/examples/nxflat/tests/signal/signal.c | 2 +- nuttx/ChangeLog | 6 ++ nuttx/TODO | 17 +++- nuttx/binfmt/Kconfig | 5 +- nuttx/binfmt/binfmt_execmodule.c | 61 +++++-------- nuttx/binfmt/binfmt_internal.h | 2 +- nuttx/configs/stm32f4discovery/elf/defconfig | 45 ++++++++-- .../configs/stm32f4discovery/posix_spawn/defconfig | 1 + nuttx/include/nuttx/sched.h | 24 ++++- nuttx/sched/Kconfig | 10 +++ nuttx/sched/Makefile | 4 + nuttx/sched/group_setupidlefiles.c | 1 + nuttx/sched/group_setupstreams.c | 2 + nuttx/sched/group_setuptaskfiles.c | 5 +- nuttx/sched/task_start.c | 9 ++ nuttx/sched/task_starthook.c | 100 +++++++++++++++++++++ 17 files changed, 239 insertions(+), 57 deletions(-) create mode 100644 nuttx/sched/task_starthook.c (limited to 'apps/examples') diff --git a/apps/examples/elf/tests/signal/signal.c b/apps/examples/elf/tests/signal/signal.c index b40da7a86..d43f012cb 100644 --- a/apps/examples/elf/tests/signal/signal.c +++ b/apps/examples/elf/tests/signal/signal.c @@ -161,7 +161,7 @@ int main(int argc, char **argv) /* Send SIGUSR1 to ourselves via kill() */ printf("Kill-ing SIGUSR1 from pid=%d\n", mypid); - status = kill(0, SIGUSR1); + status = kill(mypid, SIGUSR1); if (status != 0) { fprintf(stderr, "Failed to kill SIGUSR1, errno=%d\n", errno); diff --git a/apps/examples/nxflat/tests/signal/signal.c b/apps/examples/nxflat/tests/signal/signal.c index c5ea6bdcc..ac03f6d33 100644 --- a/apps/examples/nxflat/tests/signal/signal.c +++ b/apps/examples/nxflat/tests/signal/signal.c @@ -161,7 +161,7 @@ int main(int argc, char **argv) /* Send SIGUSR1 to ourselves via kill() */ printf("Kill-ing SIGUSR1 from pid=%d\n", mypid); - status = kill(0, SIGUSR1); + status = kill(mypid, SIGUSR1); if (status != 0) { fprintf(stderr, "Failed to kill SIGUSR1, errno=%d\n", errno); diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 255d69a3d..32112f358 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -4040,3 +4040,9 @@ Move stream data from the TCB to the task group structure. * net/, sched/, and include/nuttx/net/net.h: Move socket data from the TCB to the task group structure. + * sched/task_starthook.c, sched/task_start.c, and include/nuttx/sched.h: + Add a task start hook that will be called before the task main + is started. This can be used to schedule C++ constructors to run + automatically in the context of the new task. + * binfmt/binfmt_execmodule: Execute constructors as a start hook. + diff --git a/nuttx/TODO b/nuttx/TODO index cb99f1bf7..05e0fa99b 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -1,4 +1,4 @@ -NuttX TODO List (Last updated January 26, 2013) +NuttX TODO List (Last updated January 27, 2013) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This file summarizes known NuttX bugs, limitations, inconsistencies with @@ -6,7 +6,7 @@ standards, things that could be improved, and ideas for enhancements. nuttx/ - (10) Task/Scheduler (sched/) + (11) Task/Scheduler (sched/) (2) Memory Managment (mm/) (3) Signals (sched/, arch/) (2) pthreads (sched/) @@ -193,6 +193,16 @@ o Task/Scheduler (sched/) Status: Open Priority: Low (it might as well be low since it isn't going to be fixed). + Title: errno IS NOT SHARED AMONG THREADS + Description: In NuttX, the errno value is unique for each thread. But for + bug-for-bug compatibility, the same errno should be shared by + the task and each thread that it creates. It is *very* easy + to make this change: Just move the pterrno field from + _TCB to struct task_group_s. However, I am still not sure + if this should be done or not. + Status: Open + Priority: Low + o Memory Managment (mm/) ^^^^^^^^^^^^^^^^^^^^^^ @@ -407,6 +417,9 @@ o Binary loaders (binfmt/) Description: Not all of the NXFLAT test under apps/examples/nxflat are working. Most simply do not compile yet. tests/mutex runs okay but outputs garbage on completion. + + Update: 13-27-1, tests/mutex crashed with a memory corruption + problem the last time that I ran it. Status: Open Priority: High diff --git a/nuttx/binfmt/Kconfig b/nuttx/binfmt/Kconfig index 8d6c0bb18..6e5f7c251 100644 --- a/nuttx/binfmt/Kconfig +++ b/nuttx/binfmt/Kconfig @@ -72,9 +72,10 @@ config PIC config BINFMT_CONSTRUCTORS bool "C++ Static Constructor Support" default n - depends on HAVE_CXX && ELF # FIX ME: Currently only supported for ELF + depends on HAVE_CXX && SCHED_STARTHOOK && ELF ---help--- - Build in support for C++ constructors in loaded modules. + Build in support for C++ constructors in loaded modules. Currently + only support for ELF binary formats. config SYMTAB_ORDEREDBYNAME bool "Symbol Tables Ordered by Name" diff --git a/nuttx/binfmt/binfmt_execmodule.c b/nuttx/binfmt/binfmt_execmodule.c index afa445abb..10068b482 100644 --- a/nuttx/binfmt/binfmt_execmodule.c +++ b/nuttx/binfmt/binfmt_execmodule.c @@ -58,6 +58,14 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* If C++ constructors are used, then CONFIG_SCHED_STARTHOOK must also be + * selected be the start hook is used to schedule execution of the + * constructors. + */ + +#if defined(CONFIG_BINFMT_CONSTRUCTORS) && !defined(CONFIG_SCHED_STARTHOOK) +# errror "CONFIG_SCHED_STARTHOOK must be defined to use constructors" +#endif /**************************************************************************** * Private Function Prototypes @@ -75,7 +83,9 @@ * Name: exec_ctors * * Description: - * Execute C++ static constructors. + * Execute C++ static constructors. This function is registered as a + * start hook and runs on the thread of the newly created task before + * the new task's main function is called. * * Input Parameters: * loadinfo - Load state information @@ -87,26 +97,12 @@ ****************************************************************************/ #ifdef CONFIG_BINFMT_CONSTRUCTORS -static inline int exec_ctors(FAR const struct binary_s *binp) +static void exec_ctors(FAR void *arg) { + FAR const struct binary_s *binp = (FAR const struct binary_s *)arg; binfmt_ctor_t *ctor = binp->ctors; -#ifdef CONFIG_ADDRENV - hw_addrenv_t oldenv; - int ret; -#endif int i; - /* Instantiate the address enviroment containing the constructors */ - -#ifdef CONFIG_ADDRENV - ret = up_addrenv_select(binp->addrenv, &oldenv); - if (ret < 0) - { - bdbg("up_addrenv_select() failed: %d\n", ret); - return ret; - } -#endif - /* Execute each constructor */ for (i = 0; i < binp->nctors; i++) @@ -116,14 +112,6 @@ static inline int exec_ctors(FAR const struct binary_s *binp) (*ctor)(); ctor++; } - - /* Restore the address enviroment */ - -#ifdef CONFIG_ADDRENV - return up_addrenv_restore(oldenv); -#else - return OK; -#endif } #endif @@ -139,7 +127,7 @@ static inline int exec_ctors(FAR const struct binary_s *binp) * * Returned Value: * This is an end-user function, so it follows the normal convention: - * Returns the PID of the exec'ed module. On failure, it.returns + * Returns the PID of the exec'ed module. On failure, it returns * -1 (ERROR) and sets errno appropriately. * ****************************************************************************/ @@ -229,22 +217,19 @@ int exec_module(FAR const struct binary_s *binp) } #endif - /* Get the assigned pid before we start the task */ - - pid = tcb->pid; - - /* Execute all of the C++ static constructors */ + /* Setup a start hook that will execute all of the C++ static constructors + * on the newly created thread. The struct binary_s must persist at least + * until the new task has been started. + */ #ifdef CONFIG_BINFMT_CONSTRUCTORS - ret = exec_ctors(binp); - if (ret < 0) - { - err = -ret; - bdbg("exec_ctors() failed: %d\n", ret); - goto errout_with_stack; - } + task_starthook(tcb, exec_ctors, (FAR void *)binp); #endif + /* Get the assigned pid before we start the task */ + + pid = tcb->pid; + /* Then activate the task at the provided priority */ ret = task_activate(tcb); diff --git a/nuttx/binfmt/binfmt_internal.h b/nuttx/binfmt/binfmt_internal.h index 4fab9724d..fa750543a 100644 --- a/nuttx/binfmt/binfmt_internal.h +++ b/nuttx/binfmt/binfmt_internal.h @@ -71,7 +71,7 @@ EXTERN FAR struct binfmt_s *g_binfmts; * Public Function Prototypes ***********************************************************************/ -/* Dump the contents of strtuc binary_s */ +/* Dump the contents of struct binary_s */ #if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_BINFMT) EXTERN int dump_module(FAR const struct binary_s *bin); diff --git a/nuttx/configs/stm32f4discovery/elf/defconfig b/nuttx/configs/stm32f4discovery/elf/defconfig index 3f5a5d0fc..f7e0dc5f2 100644 --- a/nuttx/configs/stm32f4discovery/elf/defconfig +++ b/nuttx/configs/stm32f4discovery/elf/defconfig @@ -69,7 +69,7 @@ CONFIG_ARCH="arm" # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_IMX is not set # CONFIG_ARCH_CHIP_KINETIS is not set -# CONFIG_ARCH_CHIP_LM3S is not set +# CONFIG_ARCH_CHIP_LM is not set # CONFIG_ARCH_CHIP_LPC17XX is not set # CONFIG_ARCH_CHIP_LPC214X is not set # CONFIG_ARCH_CHIP_LPC2378 is not set @@ -81,6 +81,7 @@ CONFIG_ARCH_CHIP_STM32=y CONFIG_ARCH_CORTEXM4=y CONFIG_ARCH_FAMILY="armv7-m" CONFIG_ARCH_CHIP="stm32" +CONFIG_ARMV7M_USEBASEPRI=y CONFIG_ARCH_HAVE_CMNVECTOR=y # CONFIG_ARMV7M_CMNVECTOR is not set # CONFIG_ARCH_FPU is not set @@ -201,26 +202,35 @@ CONFIG_STM32_JTAG_SW_ENABLE=y # CONFIG_STM32_FORCEPOWER is not set # CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set CONFIG_STM32_CCMEXCLUDE=y +CONFIG_STM32_USART=y # # U[S]ART Configuration # # CONFIG_USART2_RS485 is not set +# CONFIG_STM32_USART_SINGLEWIRE is not set # # USB Host Configuration # +# +# External Memory Configuration +# + # # Architecture Options # # CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_VECNOTIRQ is not set # CONFIG_ARCH_DMA is not set CONFIG_ARCH_IRQPRIO=y # CONFIG_CUSTOM_STACK is not set # CONFIG_ADDRENV is not set +CONFIG_ARCH_HAVE_VFORK=y CONFIG_ARCH_STACKDUMP=y # CONFIG_ENDIAN_BIG is not set +# CONFIG_ARCH_HAVE_RAMFUNCS is not set # # Board Settings @@ -266,6 +276,7 @@ CONFIG_MSEC_PER_TICK=10 CONFIG_RR_INTERVAL=200 # CONFIG_SCHED_INSTRUMENTATION is not set CONFIG_TASK_NAME_SIZE=0 +# CONFIG_SCHED_HAVE_PARENT is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2012 CONFIG_START_MONTH=10 @@ -278,6 +289,7 @@ CONFIG_DEV_CONSOLE=y CONFIG_SDCLONE_DISABLE=y # CONFIG_SCHED_WORKQUEUE is not set # CONFIG_SCHED_WAITPID is not set +CONFIG_SCHED_STARTHOOK=y # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set CONFIG_USER_ENTRYPOINT="elf_main" @@ -287,9 +299,15 @@ CONFIG_DISABLE_OS_API=y # CONFIG_DISABLE_PTHREAD is not set # CONFIG_DISABLE_SIGNALS is not set # CONFIG_DISABLE_MQUEUE is not set -# CONFIG_DISABLE_MOUNTPOINT is not set # CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_POLL is not set + +# +# Signal Numbers +# +CONFIG_SIG_SIGUSR1=1 +CONFIG_SIG_SIGUSR2=2 +CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGCONDTIMEDOUT=16 # # Sizes of configurable things (0 disables) @@ -317,6 +335,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=2048 # # Device Drivers # +# CONFIG_DISABLE_POLL is not set CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set # CONFIG_LOOP is not set @@ -381,8 +400,9 @@ CONFIG_USART2_2STOP=0 # # File system configuration # -# CONFIG_FS_FAT is not set +# CONFIG_DISABLE_MOUNTPOINT is not set # CONFIG_FS_RAMMAP is not set +# CONFIG_FS_FAT is not set # CONFIG_FS_NXFFS is not set CONFIG_FS_ROMFS=y @@ -415,6 +435,7 @@ CONFIG_ELF_ALIGN_LOG2=2 CONFIG_ELF_STACKSIZE=2048 CONFIG_ELF_BUFFERSIZE=128 CONFIG_ELF_BUFFERINCR=32 +# CONFIG_BUILTIN is not set # CONFIG_PIC is not set CONFIG_BINFMT_CONSTRUCTORS=y CONFIG_SYMTAB_ORDEREDBYNAME=y @@ -422,6 +443,10 @@ CONFIG_SYMTAB_ORDEREDBYNAME=y # # Library Routines # + +# +# Standard C Library Options +# CONFIG_STDIO_BUFFER_SIZE=256 CONFIG_STDIO_LINEBUFFER=y CONFIG_NUNGET_CHARS=2 @@ -433,6 +458,7 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_EOL_IS_LF is not set # CONFIG_EOL_IS_BOTH_CRLF is not set CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_EXECFUNCS is not set # CONFIG_LIBC_STRERROR is not set # CONFIG_LIBC_PERROR_STDOUT is not set CONFIG_ARCH_LOWPUTC=y @@ -440,6 +466,11 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set +# +# Non-standard Helper Functions +# +# CONFIG_LIB_KBDCODEC is not set + # # Basic CXX Support # @@ -458,9 +489,8 @@ CONFIG_HAVE_CXX=y # # -# Named Applications +# Built-In Applications # -# CONFIG_BUILTIN is not set # # Examples @@ -486,7 +516,6 @@ CONFIG_EXAMPLES_ELF_DEVPATH="/dev/ram0" # CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MOUNT is not set # CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_NETTEST is not set # CONFIG_EXAMPLES_NSH is not set # CONFIG_EXAMPLES_NULL is not set # CONFIG_EXAMPLES_NX is not set @@ -501,6 +530,7 @@ CONFIG_EXAMPLES_ELF_DEVPATH="/dev/ram0" # CONFIG_EXAMPLES_PASHELLO is not set # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set # CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set @@ -516,7 +546,6 @@ CONFIG_EXAMPLES_ELF_DEVPATH="/dev/ram0" # CONFIG_EXAMPLES_USBMSC is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WLAN is not set # # Interpreters diff --git a/nuttx/configs/stm32f4discovery/posix_spawn/defconfig b/nuttx/configs/stm32f4discovery/posix_spawn/defconfig index 9e30ada8a..97cf84ab4 100644 --- a/nuttx/configs/stm32f4discovery/posix_spawn/defconfig +++ b/nuttx/configs/stm32f4discovery/posix_spawn/defconfig @@ -279,6 +279,7 @@ CONFIG_DEV_CONSOLE=y CONFIG_SDCLONE_DISABLE=y # CONFIG_SCHED_WORKQUEUE is not set # CONFIG_SCHED_WAITPID is not set +CONFIG_SCHED_STARTHOOK=y # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set CONFIG_USER_ENTRYPOINT="spawn_main" diff --git a/nuttx/include/nuttx/sched.h b/nuttx/include/nuttx/sched.h index 244455cd4..f8b4eb0dc 100644 --- a/nuttx/include/nuttx/sched.h +++ b/nuttx/include/nuttx/sched.h @@ -183,7 +183,13 @@ union entry_u }; typedef union entry_u entry_t; -/* These is the types of the functions that are executed with exit() is called +/* This is the type of the function called at task startup */ + +#ifdef CONFIG_SCHED_STARTHOOK +typedef CODE void (*starthook_t)(FAR void *arg); +#endif + +/* These are the types of the functions that are executed with exit() is called * (if registered via atexit() on on_exit()). */ @@ -298,7 +304,10 @@ struct task_group_s #endif /* PIC data space and address environments ************************************/ - /* Not yet (see struct dspace_s) */ + /* Logically the PIC data space belongs here (see struct dspace_s). The + * current logic needs review: There are differences in the away that the + * life of the PIC data is managed. + */ /* File descriptors ***********************************************************/ @@ -354,6 +363,11 @@ struct _TCB start_t start; /* Thread start function */ entry_t entry; /* Entry Point into the thread */ +#ifdef CONFIG_SCHED_STARTHOOK + starthook_t starthook; /* Task startup function */ + FAR void *starthookarg; /* The argument passed to the function */ +#endif + #if defined(CONFIG_SCHED_ATEXIT) && !defined(CONFIG_SCHED_ONEXIT) # if defined(CONFIG_SCHED_ATEXIT_MAX) && CONFIG_SCHED_ATEXIT_MAX > 1 atexitfunc_t atexitfunc[CONFIG_SCHED_ATEXIT_MAX]; @@ -516,6 +530,12 @@ FAR struct streamlist *sched_getstreams(void); FAR struct socketlist *sched_getsockets(void); #endif /* CONFIG_NSOCKET_DESCRIPTORS */ +/* Setup up a start hook */ + +#ifdef CONFIG_SCHED_STARTHOOK +void task_starthook(FAR _TCB *tcb, starthook_t starthook, FAR void *arg); +#endif + /* Internal vfork support.The overall sequence is: * * 1) User code calls vfork(). vfork() is provided in architecture-specific diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig index 7745c2c25..097dd1993 100644 --- a/nuttx/sched/Kconfig +++ b/nuttx/sched/Kconfig @@ -296,6 +296,16 @@ config SCHED_WAITPID compliant) and will enable the waitid() and wait() interfaces as well. +config SCHED_STARTHOOK + bool "Enable startup hook" + default n + ---help--- + Enable a non-standard, internal OS API call task_starthook(). + task_starthook() registers a function that will be called on task + startup before that actual task entry point is called. The + starthook is useful, for example, for setting up automatic + configuration of C++ constructors. + config SCHED_ATEXIT bool "Enable atexit() API" default n diff --git a/nuttx/sched/Makefile b/nuttx/sched/Makefile index 7710ae058..961560176 100644 --- a/nuttx/sched/Makefile +++ b/nuttx/sched/Makefile @@ -54,6 +54,10 @@ TSK_SRCS += task_posixspawn.c endif endif +ifeq ($(CONFIG_SCHED_STARTHOOK),y) +TSK_SRCS += task_starthook.c +endif + SCHED_SRCS = sched_setparam.c sched_setpriority.c sched_getparam.c SCHED_SRCS += sched_setscheduler.c sched_getscheduler.c SCHED_SRCS += sched_yield.c sched_rrgetinterval.c sched_foreach.c diff --git a/nuttx/sched/group_setupidlefiles.c b/nuttx/sched/group_setupidlefiles.c index 98cc7885e..ceb9f3e2c 100644 --- a/nuttx/sched/group_setupidlefiles.c +++ b/nuttx/sched/group_setupidlefiles.c @@ -50,6 +50,7 @@ #include #include "os_internal.h" +#include "group_internal.h" #if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 diff --git a/nuttx/sched/group_setupstreams.c b/nuttx/sched/group_setupstreams.c index 88e266280..08399ae41 100644 --- a/nuttx/sched/group_setupstreams.c +++ b/nuttx/sched/group_setupstreams.c @@ -46,6 +46,8 @@ #include #include +#include "group_internal.h" + /* Make sure that there are file or socket descriptors in the system and * that some number of streams have been configured. */ diff --git a/nuttx/sched/group_setuptaskfiles.c b/nuttx/sched/group_setuptaskfiles.c index d52adcfee..e2e7d4634 100644 --- a/nuttx/sched/group_setuptaskfiles.c +++ b/nuttx/sched/group_setuptaskfiles.c @@ -46,6 +46,7 @@ #include #include "os_internal.h" +#include "group_internal.h" #if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 @@ -159,8 +160,8 @@ static inline void sched_dupsockets(FAR _TCB *tcb) /* Get pointers to the parent and child task socket lists */ - parent = rtcb->group->tg_sockets->sl_sockets; - child = tcb->group->tg_sockets->sl_sockets; + parent = rtcb->group->tg_socketlist.sl_sockets; + child = tcb->group->tg_socketlist.sl_sockets; /* Check each socket in the parent socket list */ diff --git a/nuttx/sched/task_start.c b/nuttx/sched/task_start.c index a9cc38dfc..5a32a5dd8 100644 --- a/nuttx/sched/task_start.c +++ b/nuttx/sched/task_start.c @@ -94,6 +94,15 @@ void task_start(void) FAR _TCB *tcb = (FAR _TCB*)g_readytorun.head; int argc; + /* Execute the start hook if one has been registered */ + +#ifdef CONFIG_SCHED_STARTHOOK + if (tcb->starthook) + { + tcb->starthook(tcb->starthookarg); + } +#endif + /* Count how many non-null arguments we are passing */ for (argc = 1; argc <= CONFIG_MAX_TASK_ARGS; argc++) diff --git a/nuttx/sched/task_starthook.c b/nuttx/sched/task_starthook.c new file mode 100644 index 000000000..1cb29349f --- /dev/null +++ b/nuttx/sched/task_starthook.c @@ -0,0 +1,100 @@ +/**************************************************************************** + * sched/task_start.c + * + * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#ifdef CONFIG_SCHED_STARTHOOK + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Type Declarations + ****************************************************************************/ + +/**************************************************************************** + * Global Variables + ****************************************************************************/ + +/**************************************************************************** + * Private Variables + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: task_starthook + * + * Description: + * Configure a start hook... a function that will be called on the thread + * of the new task before the new task's main entry point is called. + * The start hook is useful, for example, for setting up automatic + * configuration of C++ constructors. + * + * Inputs: + * tcb - The new, unstarted task task that needs the start hook + * starthook - The pointer to the start hook function + * arg - The argument to pass to the start hook function. + * + * Return: + * None + * + ****************************************************************************/ + +void task_starthook(FAR _TCB *tcb, starthook_t starthook, FAR void *arg) +{ + DEBUGASSERT(tcb); + tcb->starthook = starthook; + tcb->starthookarg = arg; +} + +#endif /* CONFIG_SCHED_STARTHOOK */ -- cgit v1.2.3 From 79ccfa4ae6db4b085703b12c8f6846716fc69df7 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 28 Jan 2013 21:55:16 +0000 Subject: Add syslog.h; rename lib_rawprintf() to syslog() git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5578 42af7a65-404d-4744-a932-0658087f49c3 --- .../UnitTests/CButtonArray/cbuttonarraytest.hxx | 4 +- NxWidgets/UnitTests/CCheckBox/ccheckboxtest.hxx | 4 +- .../UnitTests/CGlyphButton/cglyphbuttontest.hxx | 4 +- NxWidgets/UnitTests/CImage/cimagetest.hxx | 4 +- NxWidgets/UnitTests/CKeypad/ckeypadtest.hxx | 4 +- .../CLatchButtonArray/clatchbuttonarraytest.hxx | 4 +- NxWidgets/UnitTests/CListBox/clistboxtest.hxx | 4 +- .../UnitTests/CProgressBar/cprogressbartest.hxx | 4 +- .../UnitTests/CRadioButton/cradiobuttontest.hxx | 4 +- .../cscrollbarhorizontaltest.hxx | 4 +- .../CScrollbarVertical/cscrollbarverticaltest.hxx | 4 +- .../CSliderHorizonal/csliderhorizontaltest.hxx | 4 +- .../CSliderVertical/csliderverticaltest.hxx | 4 +- apps/examples/adc/adc.h | 4 +- apps/examples/buttons/buttons_main.c | 28 ++-- apps/examples/can/can.h | 4 +- apps/examples/cdcacm/cdcacm.h | 4 +- apps/examples/composite/composite.h | 4 +- apps/examples/igmp/igmp.h | 6 +- apps/examples/nettest/nettest.h | 6 +- apps/examples/nx/nx_internal.h | 4 +- apps/examples/nxconsole/nxcon_internal.h | 4 +- apps/examples/nxffs/nxffs_main.c | 2 +- apps/examples/nxhello/nxhello.h | 4 +- apps/examples/nximage/nximage.h | 4 +- apps/examples/nxlines/nxlines.h | 4 +- apps/examples/nxtext/nxtext_internal.h | 4 +- apps/examples/poll/poll_internal.h | 6 +- apps/examples/pwm/pwm.h | 4 +- apps/examples/qencoder/qe.h | 4 +- apps/examples/thttpd/thttpd_main.c | 4 +- apps/examples/touchscreen/tc.h | 4 +- apps/examples/udp/udp-internal.h | 4 +- apps/examples/uip/uip_main.c | 4 +- apps/examples/usbserial/usbserial_main.c | 8 +- apps/examples/usbstorage/usbmsc.h | 4 +- apps/examples/usbterm/usbterm.h | 8 +- apps/examples/watchdog/watchdog.h | 4 +- apps/include/usbmonitor.h | 96 +++++++++++++ apps/nshlib/nsh_usbdev.c | 2 +- apps/system/usbmonitor/Makefile | 4 +- apps/system/usbmonitor/usbmonitor.c | 68 ++++----- misc/tools/README.txt | 4 +- nuttx/Documentation/NuttxPortingGuide.html | 10 +- nuttx/Kconfig | 5 +- nuttx/TODO | 17 +-- nuttx/arch/arm/src/arm/up_assert.c | 4 +- nuttx/arch/arm/src/arm/up_dataabort.c | 2 +- nuttx/arch/arm/src/arm/up_prefetchabort.c | 2 +- nuttx/arch/arm/src/arm/up_syscall.c | 2 +- nuttx/arch/arm/src/arm/up_undefinedinsn.c | 2 +- nuttx/arch/arm/src/armv7-m/up_assert.c | 4 +- nuttx/arch/arm/src/dm320/dm320_decodeirq.c | 2 +- nuttx/arch/arm/src/imx/imx_decodeirq.c | 2 +- nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c | 2 +- nuttx/arch/arm/src/lpc2378/lpc23xx_decodeirq.c | 2 +- nuttx/arch/arm/src/lpc31xx/lpc31_decodeirq.c | 2 +- nuttx/arch/arm/src/stm32/stm32_i2c.c | 6 +- nuttx/arch/arm/src/str71x/str71x_decodeirq.c | 2 +- nuttx/arch/avr/src/avr/up_dumpstate.c | 2 +- nuttx/arch/avr/src/avr32/up_dumpstate.c | 2 +- nuttx/arch/avr/src/common/up_assert.c | 4 +- nuttx/arch/hc/src/m9s12/m9s12_assert.c | 4 +- nuttx/arch/mips/src/mips32/up_assert.c | 4 +- nuttx/arch/mips/src/mips32/up_dumpstate.c | 2 +- nuttx/arch/sh/src/common/up_assert.c | 2 +- nuttx/arch/sh/src/m16c/m16c_dumpstate.c | 2 +- nuttx/arch/sh/src/sh1/sh1_dumpstate.c | 2 +- nuttx/arch/sim/src/up_initialize.c | 4 +- nuttx/arch/sim/src/up_tapdev.c | 26 ++-- nuttx/arch/x86/src/common/up_assert.c | 4 +- nuttx/arch/x86/src/i486/up_regdump.c | 2 +- nuttx/arch/z16/src/common/up_assert.c | 2 +- nuttx/arch/z16/src/common/up_registerdump.c | 2 +- nuttx/arch/z16/src/common/up_stackdump.c | 2 +- nuttx/arch/z16/src/z16f/z16f_sysexec.c | 4 +- nuttx/arch/z80/src/common/up_assert.c | 2 +- nuttx/arch/z80/src/common/up_doirq.c | 2 +- nuttx/arch/z80/src/common/up_stackdump.c | 2 +- nuttx/arch/z80/src/ez80/ez80_registerdump.c | 2 +- nuttx/arch/z80/src/z180/z180_registerdump.c | 2 +- nuttx/arch/z80/src/z8/z8_registerdump.c | 2 +- nuttx/arch/z80/src/z80/z80_registerdump.c | 2 +- nuttx/binfmt/libelf/libelf_read.c | 2 +- nuttx/binfmt/libnxflat/libnxflat_read.c | 2 +- nuttx/configs/README.txt | 2 +- nuttx/configs/cloudctrl/src/up_nsh.c | 4 +- nuttx/configs/cloudctrl/src/up_usbmsc.c | 4 +- nuttx/configs/demo9s12ne64/src/up_nsh.c | 4 +- nuttx/configs/ea3131/src/up_nsh.c | 4 +- nuttx/configs/ea3131/src/up_usbmsc.c | 4 +- nuttx/configs/ea3152/src/up_nsh.c | 4 +- nuttx/configs/ea3152/src/up_usbmsc.c | 4 +- nuttx/configs/eagle100/src/up_nsh.c | 4 +- nuttx/configs/ekk-lm3s9b96/src/up_nsh.c | 4 +- nuttx/configs/ez80f910200kitg/ostest/defconfig | 2 +- nuttx/configs/ez80f910200zco/ostest/defconfig | 2 +- nuttx/configs/fire-stm32v2/src/up_composite.c | 4 +- nuttx/configs/fire-stm32v2/src/up_nsh.c | 4 +- nuttx/configs/fire-stm32v2/src/up_usbmsc.c | 4 +- nuttx/configs/hymini-stm32v/src/up_nsh.c | 4 +- nuttx/configs/hymini-stm32v/src/up_usbmsc.c | 4 +- nuttx/configs/kwikstik-k40/src/up_nsh.c | 4 +- nuttx/configs/kwikstik-k40/src/up_usbmsc.c | 4 +- nuttx/configs/lincoln60/src/up_nsh.c | 4 +- nuttx/configs/lm3s6432-s2e/src/up_nsh.c | 4 +- nuttx/configs/lm3s6965-ek/src/up_nsh.c | 4 +- nuttx/configs/lm3s8962-ek/src/up_nsh.c | 4 +- nuttx/configs/lpcxpresso-lpc1768/src/up_nsh.c | 4 +- nuttx/configs/lpcxpresso-lpc1768/src/up_usbmsc.c | 4 +- nuttx/configs/mbed/src/up_nsh.c | 4 +- nuttx/configs/mcu123-lpc214x/src/up_composite.c | 4 +- nuttx/configs/mcu123-lpc214x/src/up_nsh.c | 4 +- nuttx/configs/mcu123-lpc214x/src/up_usbmsc.c | 4 +- nuttx/configs/ne64badge/src/up_nsh.c | 4 +- nuttx/configs/nucleus2g/src/up_nsh.c | 4 +- nuttx/configs/nucleus2g/src/up_usbmsc.c | 4 +- nuttx/configs/olimex-lpc1766stk/src/up_nsh.c | 4 +- nuttx/configs/olimex-lpc1766stk/src/up_usbmsc.c | 4 +- nuttx/configs/olimex-lpc2378/src/up_nsh.c | 4 +- nuttx/configs/olimex-strp711/src/up_nsh.c | 4 +- nuttx/configs/pic32-starterkit/src/up_nsh.c | 4 +- nuttx/configs/pic32-starterkit/src/up_usbmsc.c | 4 +- nuttx/configs/pic32mx7mmb/src/up_nsh.c | 4 +- nuttx/configs/pic32mx7mmb/src/up_usbmsc.c | 4 +- nuttx/configs/rgmp/include/README.txt | 2 +- nuttx/configs/rgmp/src/README.txt | 2 +- nuttx/configs/sam3u-ek/src/up_nsh.c | 4 +- nuttx/configs/sam3u-ek/src/up_usbmsc.c | 4 +- nuttx/configs/shenzhou/src/up_composite.c | 4 +- nuttx/configs/shenzhou/src/up_ili93xx.c | 6 +- nuttx/configs/shenzhou/src/up_nsh.c | 4 +- nuttx/configs/shenzhou/src/up_usbmsc.c | 4 +- nuttx/configs/sim/cxxtest/defconfig | 2 +- nuttx/configs/sim/ostest/defconfig | 2 +- nuttx/configs/stm3210e-eval/src/up_composite.c | 4 +- nuttx/configs/stm3210e-eval/src/up_lcd.c | 6 +- nuttx/configs/stm3210e-eval/src/up_nsh.c | 4 +- nuttx/configs/stm3210e-eval/src/up_pmbuttons.c | 6 +- nuttx/configs/stm3210e-eval/src/up_usbmsc.c | 4 +- nuttx/configs/stm3220g-eval/src/up_lcd.c | 6 +- nuttx/configs/stm3220g-eval/src/up_nsh.c | 4 +- nuttx/configs/stm3240g-eval/discover/defconfig | 2 +- nuttx/configs/stm3240g-eval/src/up_lcd.c | 6 +- nuttx/configs/stm3240g-eval/src/up_nsh.c | 4 +- nuttx/configs/stm3240g-eval/xmlrpc/defconfig | 2 +- nuttx/configs/stm32f4discovery/src/up_nsh.c | 4 +- nuttx/configs/stm32f4discovery/src/up_pmbuttons.c | 2 +- nuttx/configs/sure-pic32mx/src/up_nsh.c | 4 +- nuttx/configs/teensy/src/up_usbmsc.c | 4 +- nuttx/configs/twr-k60n512/src/up_nsh.c | 4 +- nuttx/configs/twr-k60n512/src/up_usbmsc.c | 4 +- nuttx/configs/ubw32/src/up_nsh.c | 4 +- nuttx/configs/vsn/src/usbmsc.c | 4 +- nuttx/configs/vsn/src/vsn.h | 4 +- nuttx/configs/z16f2800100zcog/ostest/defconfig | 2 +- nuttx/configs/z16f2800100zcog/pashello/README.txt | 24 ++-- nuttx/configs/z16f2800100zcog/pashello/defconfig | 2 +- nuttx/configs/z8encore000zco/ostest/defconfig | 2 +- nuttx/configs/z8f64200100kit/ostest/defconfig | 2 +- nuttx/drivers/lcd/mio283qt2.c | 6 +- nuttx/drivers/lcd/ssd1289.c | 6 +- nuttx/drivers/mmcsd/mmcsd_debug.c | 4 +- nuttx/drivers/net/enc28j60.c | 96 ++++++------- nuttx/drivers/syslog/ramlog.c | 6 +- nuttx/drivers/usbdev/usbdev_trace.c | 4 +- nuttx/drivers/usbdev/usbmsc.h | 8 +- nuttx/fs/fs_syslog.c | 6 +- nuttx/fs/nxffs/nxffs_dump.c | 2 +- nuttx/include/debug.h | 37 ++--- nuttx/include/nuttx/syslog.h | 6 +- nuttx/include/syslog.h | 94 +++++++++++++ nuttx/libc/lib.csv | 6 +- nuttx/libc/lib_internal.h | 12 +- nuttx/libc/misc/lib_dbg.c | 36 ++--- nuttx/libc/misc/lib_dumpbuffer.c | 8 +- nuttx/libc/stdio/Make.defs | 2 +- nuttx/libc/stdio/lib_lowprintf.c | 130 ----------------- nuttx/libc/stdio/lib_lowsyslog.c | 130 +++++++++++++++++ nuttx/libc/stdio/lib_printf.c | 4 +- nuttx/libc/stdio/lib_rawprintf.c | 154 --------------------- nuttx/libc/stdio/lib_syslog.c | 154 +++++++++++++++++++++ 182 files changed, 943 insertions(+), 786 deletions(-) create mode 100644 apps/include/usbmonitor.h create mode 100644 nuttx/include/syslog.h delete mode 100644 nuttx/libc/stdio/lib_lowprintf.c create mode 100644 nuttx/libc/stdio/lib_lowsyslog.c delete mode 100644 nuttx/libc/stdio/lib_rawprintf.c create mode 100644 nuttx/libc/stdio/lib_syslog.c (limited to 'apps/examples') diff --git a/NxWidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx b/NxWidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx index b8a9e15e5..1dc794a48 100644 --- a/NxWidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx +++ b/NxWidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx @@ -75,11 +75,11 @@ # define CONFIG_CBUTTONARRAYTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/NxWidgets/UnitTests/CCheckBox/ccheckboxtest.hxx b/NxWidgets/UnitTests/CCheckBox/ccheckboxtest.hxx index 0397b37dd..58099acdf 100644 --- a/NxWidgets/UnitTests/CCheckBox/ccheckboxtest.hxx +++ b/NxWidgets/UnitTests/CCheckBox/ccheckboxtest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CCHECKBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/NxWidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx b/NxWidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx index b3e5bb656..2c21d4cb1 100644 --- a/NxWidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx +++ b/NxWidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx @@ -76,11 +76,11 @@ # define CONFIG_CGLYPHBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/NxWidgets/UnitTests/CImage/cimagetest.hxx b/NxWidgets/UnitTests/CImage/cimagetest.hxx index 9592f2936..5b5901bb1 100644 --- a/NxWidgets/UnitTests/CImage/cimagetest.hxx +++ b/NxWidgets/UnitTests/CImage/cimagetest.hxx @@ -71,11 +71,11 @@ # define CONFIG_CIMAGETEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/NxWidgets/UnitTests/CKeypad/ckeypadtest.hxx b/NxWidgets/UnitTests/CKeypad/ckeypadtest.hxx index d11c92375..12d7e18fa 100644 --- a/NxWidgets/UnitTests/CKeypad/ckeypadtest.hxx +++ b/NxWidgets/UnitTests/CKeypad/ckeypadtest.hxx @@ -72,11 +72,11 @@ # define CONFIG_CKEYPADTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx b/NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx index 98c0a3bb3..80bf8fb71 100644 --- a/NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx +++ b/NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx @@ -75,11 +75,11 @@ # define CONFIG_CLATCHBUTTONARRAYTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/NxWidgets/UnitTests/CListBox/clistboxtest.hxx b/NxWidgets/UnitTests/CListBox/clistboxtest.hxx index a19a2fabc..dfe179503 100644 --- a/NxWidgets/UnitTests/CListBox/clistboxtest.hxx +++ b/NxWidgets/UnitTests/CListBox/clistboxtest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CLISTBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/NxWidgets/UnitTests/CProgressBar/cprogressbartest.hxx b/NxWidgets/UnitTests/CProgressBar/cprogressbartest.hxx index a7a4238e7..2223d8081 100644 --- a/NxWidgets/UnitTests/CProgressBar/cprogressbartest.hxx +++ b/NxWidgets/UnitTests/CProgressBar/cprogressbartest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CPROGRESSBARTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/NxWidgets/UnitTests/CRadioButton/cradiobuttontest.hxx b/NxWidgets/UnitTests/CRadioButton/cradiobuttontest.hxx index 540d5019b..3f81371db 100644 --- a/NxWidgets/UnitTests/CRadioButton/cradiobuttontest.hxx +++ b/NxWidgets/UnitTests/CRadioButton/cradiobuttontest.hxx @@ -70,11 +70,11 @@ # define CONFIG_CRADIOBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/NxWidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx b/NxWidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx index 774225091..30f66ca45 100644 --- a/NxWidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx +++ b/NxWidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CSCROLLBARHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/NxWidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx b/NxWidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx index 8b9fb1ee8..6323b0f26 100644 --- a/NxWidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx +++ b/NxWidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CSCROLLBARVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/NxWidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx b/NxWidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx index 9709a2b7c..fd333af5c 100644 --- a/NxWidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx +++ b/NxWidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CSLIDERHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/NxWidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx b/NxWidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx index 3bb174ba0..6a893e395 100644 --- a/NxWidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx +++ b/NxWidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CSLIDERVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/apps/examples/adc/adc.h b/apps/examples/adc/adc.h index 9f79db92a..2d8af87e1 100644 --- a/apps/examples/adc/adc.h +++ b/apps/examples/adc/adc.h @@ -74,7 +74,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_rawprintf(__VA_ARGS__) +# define message(...) syslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -82,7 +82,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_rawprintf +# define message syslog # define msgflush() # else # define message printf diff --git a/apps/examples/buttons/buttons_main.c b/apps/examples/buttons/buttons_main.c index 5f25c1ef1..655080def 100644 --- a/apps/examples/buttons/buttons_main.c +++ b/apps/examples/buttons/buttons_main.c @@ -299,11 +299,11 @@ static void show_buttons(uint8_t oldset, uint8_t newset) state = "released"; } - /* Use lib_lowprintf() because we make be executing from an + /* Use lowsyslog() because we make be executing from an * interrupt handler. */ - lib_lowprintf(" %s %s\n", g_buttoninfo[BUTTON_INDEX(i)].name, state); + lowsyslog(" %s %s\n", g_buttoninfo[BUTTON_INDEX(i)].name, state); } } } @@ -313,8 +313,8 @@ static void button_handler(int id, int irq) { uint8_t newset = up_buttons(); - lib_lowprintf("IRQ:%d Button %d:%s SET:%02x:\n", - irq, id, g_buttoninfo[BUTTON_INDEX(id)].name, newset); + lowsyslog("IRQ:%d Button %d:%s SET:%02x:\n", + irq, id, g_buttoninfo[BUTTON_INDEX(id)].name, newset); show_buttons(g_oldset, newset); g_oldset = newset; } @@ -409,7 +409,7 @@ int buttons_main(int argc, char *argv[]) { maxbuttons = strtol(argv[1], NULL, 10); } - lib_lowprintf("maxbuttons: %d\n", maxbuttons); + lowsyslog("maxbuttons: %d\n", maxbuttons); #endif /* Initialize the button GPIOs */ @@ -423,11 +423,11 @@ int buttons_main(int argc, char *argv[]) { xcpt_t oldhandler = up_irqbutton(i, g_buttoninfo[BUTTON_INDEX(i)].handler); - /* Use lib_lowprintf() for compatibility with interrrupt handler output. */ + /* Use lowsyslog() for compatibility with interrrupt handler output. */ - lib_lowprintf("Attached handler at %p to button %d [%s], oldhandler:%p\n", - g_buttoninfo[BUTTON_INDEX(i)].handler, i, - g_buttoninfo[BUTTON_INDEX(i)].name, oldhandler); + lowsyslog("Attached handler at %p to button %d [%s], oldhandler:%p\n", + g_buttoninfo[BUTTON_INDEX(i)].handler, i, + g_buttoninfo[BUTTON_INDEX(i)].name, oldhandler); /* Some hardware multiplexes different GPIO button sources to the same * physical interrupt. If we register multiple such multiplexed button @@ -438,9 +438,9 @@ int buttons_main(int argc, char *argv[]) if (oldhandler != NULL) { - lib_lowprintf("WARNING: oldhandler:%p is not NULL! " - "Button events may be lost or aliased!\n", - oldhandler); + lowsyslog("WARNING: oldhandler:%p is not NULL! " + "Button events may be lost or aliased!\n", + oldhandler); } } #endif @@ -468,11 +468,11 @@ int buttons_main(int argc, char *argv[]) flags = irqsave(); - /* Use lib_lowprintf() for compatibility with interrrupt handler + /* Use lowsyslog() for compatibility with interrrupt handler * output. */ - lib_lowprintf("POLL SET:%02x:\n", newset); + lowsyslog("POLL SET:%02x:\n", newset); show_buttons(g_oldset, newset); g_oldset = newset; irqrestore(flags); diff --git a/apps/examples/can/can.h b/apps/examples/can/can.h index 53a6b63ea..d9f9236f7 100644 --- a/apps/examples/can/can.h +++ b/apps/examples/can/can.h @@ -89,7 +89,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_rawprintf(__VA_ARGS__) +# define message(...) syslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -97,7 +97,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_rawprintf +# define message syslog # define msgflush() # else # define message printf diff --git a/apps/examples/cdcacm/cdcacm.h b/apps/examples/cdcacm/cdcacm.h index 18570bff0..1b3b2511c 100644 --- a/apps/examples/cdcacm/cdcacm.h +++ b/apps/examples/cdcacm/cdcacm.h @@ -112,7 +112,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -120,7 +120,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/apps/examples/composite/composite.h b/apps/examples/composite/composite.h index 73a4453be..3f7f7ebad 100644 --- a/apps/examples/composite/composite.h +++ b/apps/examples/composite/composite.h @@ -173,7 +173,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -181,7 +181,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/apps/examples/igmp/igmp.h b/apps/examples/igmp/igmp.h index 093f58c1f..5e1fa8d95 100644 --- a/apps/examples/igmp/igmp.h +++ b/apps/examples/igmp/igmp.h @@ -46,12 +46,12 @@ * Definitions ****************************************************************************/ -/* Used lib_rawprintf() so that there is no confusion from buffered IO */ +/* Used syslog() so that there is no confusion from buffered IO */ #ifdef CONFIG_CPP_HAVE_VARARGS -# define message(...) lib_rawprintf(__VA_ARGS__) +# define message(...) syslog(__VA_ARGS__) #else -# define message lib_rawprintf +# define message syslog #endif /**************************************************************************** diff --git a/apps/examples/nettest/nettest.h b/apps/examples/nettest/nettest.h index 37ac470d1..5021e05d6 100644 --- a/apps/examples/nettest/nettest.h +++ b/apps/examples/nettest/nettest.h @@ -69,12 +69,12 @@ #else - /* Used lib_rawprintf() so that there is not confusion from buffered IO */ + /* Used syslog() so that there is not confusion from buffered IO */ # ifdef CONFIG_CPP_HAVE_VARARGS -# define message(...) lib_rawprintf(__VA_ARGS__) +# define message(...) syslog(__VA_ARGS__) # else -# define message lib_rawprintf +# define message syslog # endif /* At present, uIP does only abortive disconnects */ diff --git a/apps/examples/nx/nx_internal.h b/apps/examples/nx/nx_internal.h index d9a6a2ade..53f1763b4 100644 --- a/apps/examples/nx/nx_internal.h +++ b/apps/examples/nx/nx_internal.h @@ -168,7 +168,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -176,7 +176,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/apps/examples/nxconsole/nxcon_internal.h b/apps/examples/nxconsole/nxcon_internal.h index c5ad760ad..c921bed38 100644 --- a/apps/examples/nxconsole/nxcon_internal.h +++ b/apps/examples/nxconsole/nxcon_internal.h @@ -239,7 +239,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -247,7 +247,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/apps/examples/nxffs/nxffs_main.c b/apps/examples/nxffs/nxffs_main.c index 5401fc932..8bb5cd1fe 100644 --- a/apps/examples/nxffs/nxffs_main.c +++ b/apps/examples/nxffs/nxffs_main.c @@ -120,7 +120,7 @@ #endif #if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_FS) -# define message lib_rawprintf +# define message syslog # define msgflush() #else # define message printf diff --git a/apps/examples/nxhello/nxhello.h b/apps/examples/nxhello/nxhello.h index 2dce7bf6c..f395b7018 100644 --- a/apps/examples/nxhello/nxhello.h +++ b/apps/examples/nxhello/nxhello.h @@ -96,7 +96,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -104,7 +104,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/apps/examples/nximage/nximage.h b/apps/examples/nximage/nximage.h index eac0f5dc2..ef475ca29 100644 --- a/apps/examples/nximage/nximage.h +++ b/apps/examples/nximage/nximage.h @@ -111,7 +111,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -119,7 +119,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/apps/examples/nxlines/nxlines.h b/apps/examples/nxlines/nxlines.h index a26db9f29..c9101124e 100644 --- a/apps/examples/nxlines/nxlines.h +++ b/apps/examples/nxlines/nxlines.h @@ -120,7 +120,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -128,7 +128,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/apps/examples/nxtext/nxtext_internal.h b/apps/examples/nxtext/nxtext_internal.h index f0001e0bb..1e64193a3 100644 --- a/apps/examples/nxtext/nxtext_internal.h +++ b/apps/examples/nxtext/nxtext_internal.h @@ -194,7 +194,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -202,7 +202,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/apps/examples/poll/poll_internal.h b/apps/examples/poll/poll_internal.h index b2400932e..759d23f1c 100644 --- a/apps/examples/poll/poll_internal.h +++ b/apps/examples/poll/poll_internal.h @@ -71,7 +71,7 @@ # undef HAVE_NETPOLL #endif -/* If debug is enabled, then use lib_rawprintf so that OS debug output and +/* If debug is enabled, then use syslog so that OS debug output and * the test output are synchronized. * * These macros will differ depending upon if the toolchain supports @@ -80,7 +80,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_rawprintf(__VA_ARGS__) +# define message(...) syslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -88,7 +88,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_rawprintf +# define message syslog # define msgflush() # else # define message printf diff --git a/apps/examples/pwm/pwm.h b/apps/examples/pwm/pwm.h index 5c049a8f8..a6132ca8b 100644 --- a/apps/examples/pwm/pwm.h +++ b/apps/examples/pwm/pwm.h @@ -92,7 +92,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_rawprintf(__VA_ARGS__) +# define message(...) syslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -100,7 +100,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_rawprintf +# define message syslog # define msgflush() # else # define message printf diff --git a/apps/examples/qencoder/qe.h b/apps/examples/qencoder/qe.h index 4c03689ab..3c20511ca 100644 --- a/apps/examples/qencoder/qe.h +++ b/apps/examples/qencoder/qe.h @@ -77,7 +77,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_rawprintf(__VA_ARGS__) +# define message(...) syslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -85,7 +85,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_rawprintf +# define message syslog # define msgflush() # else # define message printf diff --git a/apps/examples/thttpd/thttpd_main.c b/apps/examples/thttpd/thttpd_main.c index 97f922a76..9d08824e6 100644 --- a/apps/examples/thttpd/thttpd_main.c +++ b/apps/examples/thttpd/thttpd_main.c @@ -125,7 +125,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -133,7 +133,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/apps/examples/touchscreen/tc.h b/apps/examples/touchscreen/tc.h index 654b1d874..dddff11c3 100644 --- a/apps/examples/touchscreen/tc.h +++ b/apps/examples/touchscreen/tc.h @@ -82,7 +82,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_rawprintf(__VA_ARGS__) +# define message(...) syslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -90,7 +90,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_rawprintf +# define message syslog # define msgflush() # else # define message printf diff --git a/apps/examples/udp/udp-internal.h b/apps/examples/udp/udp-internal.h index 2a966c746..c8010e6c8 100644 --- a/apps/examples/udp/udp-internal.h +++ b/apps/examples/udp/udp-internal.h @@ -63,12 +63,12 @@ #else - /* If debug is enabled, use the synchronous lib_lowprintf so that the + /* If debug is enabled, use the synchronous lowsyslog so that the * program output does not get disassociated in the debug output. */ # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif diff --git a/apps/examples/uip/uip_main.c b/apps/examples/uip/uip_main.c index 6c2f96f39..8e485441c 100644 --- a/apps/examples/uip/uip_main.c +++ b/apps/examples/uip/uip_main.c @@ -86,13 +86,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message (void) # endif diff --git a/apps/examples/usbserial/usbserial_main.c b/apps/examples/usbserial/usbserial_main.c index 016c8b292..dc7e1959a 100644 --- a/apps/examples/usbserial/usbserial_main.c +++ b/apps/examples/usbserial/usbserial_main.c @@ -109,16 +109,16 @@ TRACE_TRANSFER_BITS|TRACE_CONTROLLER_BITS|TRACE_INTERRUPT_BITS) #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) -# define trmessage lib_lowprintf +# define message(...) lowsyslog(__VA_ARGS__) +# define trmessage lowsyslog # else # define message(...) printf(__VA_ARGS__) # define trmessage printf # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf -# define trmessage lib_lowprintf +# define message lowsyslog +# define trmessage lowsyslog # else # define message printf # define trmessage printf diff --git a/apps/examples/usbstorage/usbmsc.h b/apps/examples/usbstorage/usbmsc.h index 9d48c4521..95453198a 100644 --- a/apps/examples/usbstorage/usbmsc.h +++ b/apps/examples/usbstorage/usbmsc.h @@ -85,7 +85,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -93,7 +93,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/apps/examples/usbterm/usbterm.h b/apps/examples/usbterm/usbterm.h index 2534c2f3c..560e55346 100644 --- a/apps/examples/usbterm/usbterm.h +++ b/apps/examples/usbterm/usbterm.h @@ -101,16 +101,16 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_rawprintf(__VA_ARGS__) -# define trmessage lib_rawprintf +# define message(...) syslog(__VA_ARGS__) +# define trmessage syslog # else # define message(...) printf(__VA_ARGS__) # define trmessage printf # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf -# define trmessage lib_lowprintf +# define message lowsyslog +# define trmessage lowsyslog # else # define message printf # define trmessage printf diff --git a/apps/examples/watchdog/watchdog.h b/apps/examples/watchdog/watchdog.h index dc2dea944..dd4daebb9 100644 --- a/apps/examples/watchdog/watchdog.h +++ b/apps/examples/watchdog/watchdog.h @@ -89,7 +89,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_rawprintf(__VA_ARGS__) +# define message(...) syslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -97,7 +97,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_rawprintf +# define message syslog # define msgflush() # else # define message printf diff --git a/apps/include/usbmonitor.h b/apps/include/usbmonitor.h new file mode 100644 index 000000000..01fa060b0 --- /dev/null +++ b/apps/include/usbmonitor.h @@ -0,0 +1,96 @@ +/**************************************************************************** + * apps/include/usbmonitor.h + * + * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __APPS_INCLUDE_USBMONITOR_H +#define __APPS_INCLUDE_USBMONITOR_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#ifdef CONFIG_SYSTEM_USBMONITOR + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: usbmon_start and usbmon_stop + * + * Start and top the USB monitor daemon. These are normally controlled + * from the USB command line, but the ability to control these + * programmatically is also helpful (for example, so that the daemon is + * running before NSH starts). + * + * Input Parameters: + * Standard task parameters. These can be called or spawned. Since the + * return almost immediately, it is fine to just call the functions. The + * parameters are not used so you can pass 0 and NULL, respectivley; this + * is done this way so that these functions can be NSH builtin + * applications. + * + * Returned values: + * Standard task return values (zero meaning success). + * + **************************************************************************/ + +int usbmonitor_start(int argc, char **argv); +int usbmonitor_stop(int argc, char **argv); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* CONFIG_SYSTEM_USBMONITOR */ +#endif /* __APPS_INCLUDE_USBMONITOR_H */ diff --git a/apps/nshlib/nsh_usbdev.c b/apps/nshlib/nsh_usbdev.c index 3d123532a..d137e3dae 100644 --- a/apps/nshlib/nsh_usbdev.c +++ b/apps/nshlib/nsh_usbdev.c @@ -63,7 +63,7 @@ ****************************************************************************/ #if defined(CONFIG_DEBUG) || defined(CONFIG_NSH_USBCONSOLE) -# define trmessage lib_lowprintf +# define trmessage lowsyslog #else # define trmessage printf #endif diff --git a/apps/system/usbmonitor/Makefile b/apps/system/usbmonitor/Makefile index 04fcaf0ac..b4c323eb7 100644 --- a/apps/system/usbmonitor/Makefile +++ b/apps/system/usbmonitor/Makefile @@ -44,7 +44,6 @@ endif # Hello Application # TODO: appname can be automatically extracted from the directory name -APPNAME = usbmon PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 768 @@ -90,7 +89,8 @@ $(COBJS): %$(OBJEXT): %.c ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) + $(call REGISTER,"usbmon_start",$(PRIORITY),$(STACKSIZE),usbmonitor_start) + $(call REGISTER,"usbmon_stop",$(PRIORITY),$(STACKSIZE),usbmonintor_stop) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat else diff --git a/apps/system/usbmonitor/usbmonitor.c b/apps/system/usbmonitor/usbmonitor.c index b101b128c..b615b99f9 100644 --- a/apps/system/usbmonitor/usbmonitor.c +++ b/apps/system/usbmonitor/usbmonitor.c @@ -40,20 +40,29 @@ #include #include -#include -#include +#include +#include +#include + +#include event, trace->value); + return 0; +} + static int usbmonitor_daemon(int argc, char **argv) { -#ifdef CONFIG_NSH_BUILTIN_APPS - print("USB Monitor running: %d\n", g_usbmonitor.pid); -#endif + syslog(USBMON_PREFIX "Running: %d\n", g_usbmonitor.pid); -#ifdef CONFIG_NSH_BUILTIN_APPS - /* If we are running as an NSH command, then loop until we detect that - * there is a request to stop. - */ + /* Loop until we detect that there is a request to stop. */ while (!g_usbmonitor.stop) -#else - /* If we are running as a standalone program, then loop forever */ - - for (;;) -#endif { -#warning "Missing logic" + (void)usbmonitor_enumerate(nsh_tracecallback, NULL); } /* Stopped */ -#ifdef CONFIG_NSH_BUILTIN_APPS g_usbmonitor.stop = false; g_usbmonitor.started = false; - print("USB Monitor stopped: %d\n", g_usbmonitor.pid); -#endif + syslog(USBMON_PREFIX "Stopped: %d\n", g_usbmonitor.pid); + return 0; } @@ -101,9 +105,8 @@ static int usbmonitor_daemon(int argc, char **argv) * Public Functions ****************************************************************************/ -int usbmonitor_main(int argc, char **argv) +int usbmonitor_start(int argc, char **argv) { -#ifdef CONFIG_NSH_BUILTIN_APPS /* Has the monitor already started? */ sched_lock(); @@ -122,13 +125,14 @@ int usbmonitor_main(int argc, char **argv) if (ret < 0) { int errcode = errno; - fprintf(stderr, "ERROR: Failed to start the USB monitor: %d\n", - errcode); + syslog(USBMON_PREFIX + "ERROR: Failed to start the USB monitor: %d\n", + errcode); } else { g_usbmonitor.pid = ret; - print("USB Monitor started: %d\n", g_usbmonitor.pid); + syslog(USBMON_PREFIX "Started: %d\n", g_usbmonitor.pid); } sched_unlock(); @@ -136,27 +140,23 @@ int usbmonitor_main(int argc, char **argv) } sched_unlock(); - print("USB Monitor running: %d\n", g_usbmonitor.pid); + syslog(USBMON_PREFIX "Running: %d\n", g_usbmonitor.pid); return 0; -#else - return usbmonitor_daemon(argc, argv); -#endif } -#ifdef CONFIG_NSH_BUILTIN_APPS int usbmonitor_stop(int argc, char **argv) { /* Has the monitor already started? */ if (g_usbmonitor.started) { - print("USB Monitor stopping: %d\n", g_usbmonitor.pid); + syslog(USBMON_PREFIX "Stopping: %d\n", g_usbmonitor.pid); g_usbmonitor.stop = true; return 0; } - print("USB Monitor stopped: %d\n", g_usbmonitor.pid); + syslog(USBMON_PREFIX "Stopped: %d\n", g_usbmonitor.pid); return 0; } -#endif +#endif /* CONFIG_SYSTEM_USBMONITOR */ diff --git a/misc/tools/README.txt b/misc/tools/README.txt index e1c67c5f0..1eb8790f1 100644 --- a/misc/tools/README.txt +++ b/misc/tools/README.txt @@ -45,14 +45,14 @@ kconfig-frontends To suppress the 'nconf' and the graphical front-ends which are not used by NuttX, you can add: - ./configure --enable-mconfig --disable-nconf --disable-gconf --disable-qconf + ./configure --enable-mconf --disable-nconf --disable-gconf --disable-qconf make make install To suppress the graphical interfaces, use static libraries, and disable creation of other utilities: - ./configure --disable-shared --enable-static --enable-mconfig --disable-nconf --disable-gconf --disable-qconf --disable-nconf --disable-utils + ./configure --disable-shared --enable-static --enable-mconf --disable-nconf --disable-gconf --disable-qconf --disable-nconf --disable-utils make make install diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html index fd358f423..f2f7ada02 100644 --- a/nuttx/Documentation/NuttxPortingGuide.html +++ b/nuttx/Documentation/NuttxPortingGuide.html @@ -4324,17 +4324,17 @@ build
  • CONFIG_DEBUG: enables built-in debug options. 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; - Debug console output must also be enabled on a subsystem-by-subsystem basis as described below. + This option is also necessary (but not sufficient) to enable debug syslog output; + Debug syslog output must also be enabled on a subsystem-by-subsystem basis as described below.
  • - CONFIG_DEBUG_VERBOSE: If debug console output is enabled, the option enables more verbose debug output. + CONFIG_DEBUG_VERBOSE: If debug syslog output is enabled, the option enables more verbose debug output. Ignored if CONFIG_DEBUG is not defined. If only CONFIG_DEBUG then the only output will be errors, warnings, and critical information. - If CONFIG_DEBUG_VERBOSE is defined in addition, then general debug comments will also be included in the console output. + If CONFIG_DEBUG_VERBOSE is defined in addition, then general debug comments will also be included in the syslog output.
  • - CONFIG_DEBUG_ENABLE: Support an interface to enable or disable debug output. + CONFIG_SYSLOG_ENABLE: Support an interface to enable or disable syslog output.
  • CONFIG_DEBUG_SYMBOLS: build without optimization and with debug symbols (needed for use with a debugger). diff --git a/nuttx/Kconfig b/nuttx/Kconfig index 10d624efb..937bab2be 100644 --- a/nuttx/Kconfig +++ b/nuttx/Kconfig @@ -312,11 +312,12 @@ config DEBUG_VERBOSE often annoying) output will be generated. This means there are two levels of debug output: errors-only and everything. -config DEBUG_ENABLE +config SYSLOG_ENABLE bool "Enable Debug Controls" default n ---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" diff --git a/nuttx/TODO b/nuttx/TODO index 05e0fa99b..6b2c6c883 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -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 @@ -14,7 +14,7 @@ nuttx/ (6) Binary loaders (binfmt/) (16) Network (net/, drivers/net) (4) USB (drivers/usbdev, drivers/usbhost) - (12) Libraries (libc/, ) + (11) Libraries (libc/, ) (9) File system/Generic drivers (fs/, drivers/) (5) Graphics subystem (graphics/) (1) Pascal add-on (pcode/) @@ -812,19 +812,6 @@ o Libraries (libc/) Status: Open 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 Description: Only the %f floating point format is supported. Others are accepted but treated like %f. diff --git a/nuttx/arch/arm/src/arm/up_assert.c b/nuttx/arch/arm/src/arm/up_assert.c index 3d75a4655..3cc79df01 100644 --- a/nuttx/arch/arm/src/arm/up_assert.c +++ b/nuttx/arch/arm/src/arm/up_assert.c @@ -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 diff --git a/nuttx/arch/arm/src/arm/up_dataabort.c b/nuttx/arch/arm/src/arm/up_dataabort.c index f01941968..60ef8385e 100644 --- a/nuttx/arch/arm/src/arm/up_dataabort.c +++ b/nuttx/arch/arm/src/arm/up_dataabort.c @@ -62,7 +62,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/arm/src/arm/up_prefetchabort.c b/nuttx/arch/arm/src/arm/up_prefetchabort.c index 9af644fc0..9d028b0d4 100644 --- a/nuttx/arch/arm/src/arm/up_prefetchabort.c +++ b/nuttx/arch/arm/src/arm/up_prefetchabort.c @@ -62,7 +62,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/arm/src/arm/up_syscall.c b/nuttx/arch/arm/src/arm/up_syscall.c index 1bcd66502..eb9bac8ad 100644 --- a/nuttx/arch/arm/src/arm/up_syscall.c +++ b/nuttx/arch/arm/src/arm/up_syscall.c @@ -56,7 +56,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/arm/src/arm/up_undefinedinsn.c b/nuttx/arch/arm/src/arm/up_undefinedinsn.c index d61abe11b..88e3a79d9 100644 --- a/nuttx/arch/arm/src/arm/up_undefinedinsn.c +++ b/nuttx/arch/arm/src/arm/up_undefinedinsn.c @@ -54,7 +54,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/arm/src/armv7-m/up_assert.c b/nuttx/arch/arm/src/armv7-m/up_assert.c index ab30b09f3..8e29bfe80 100644 --- a/nuttx/arch/arm/src/armv7-m/up_assert.c +++ b/nuttx/arch/arm/src/armv7-m/up_assert.c @@ -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 diff --git a/nuttx/arch/arm/src/dm320/dm320_decodeirq.c b/nuttx/arch/arm/src/dm320/dm320_decodeirq.c index c7032c4b1..98ba76097 100644 --- a/nuttx/arch/arm/src/dm320/dm320_decodeirq.c +++ b/nuttx/arch/arm/src/dm320/dm320_decodeirq.c @@ -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 diff --git a/nuttx/arch/arm/src/imx/imx_decodeirq.c b/nuttx/arch/arm/src/imx/imx_decodeirq.c index ba37a60a2..230a4fc20 100644 --- a/nuttx/arch/arm/src/imx/imx_decodeirq.c +++ b/nuttx/arch/arm/src/imx/imx_decodeirq.c @@ -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 diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c b/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c index 652fe4d61..057e526c2 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c @@ -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 diff --git a/nuttx/arch/arm/src/lpc2378/lpc23xx_decodeirq.c b/nuttx/arch/arm/src/lpc2378/lpc23xx_decodeirq.c index a55ed339d..3a50beb50 100644 --- a/nuttx/arch/arm/src/lpc2378/lpc23xx_decodeirq.c +++ b/nuttx/arch/arm/src/lpc2378/lpc23xx_decodeirq.c @@ -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 diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_decodeirq.c b/nuttx/arch/arm/src/lpc31xx/lpc31_decodeirq.c index 41e1d3e13..0e73f131b 100644 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_decodeirq.c +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_decodeirq.c @@ -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 diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c.c b/nuttx/arch/arm/src/stm32/stm32_i2c.c index 18687c6f4..c2d638dd4 100644 --- a/nuttx/arch/arm/src/stm32/stm32_i2c.c +++ b/nuttx/arch/arm/src/stm32/stm32_i2c.c @@ -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); } diff --git a/nuttx/arch/arm/src/str71x/str71x_decodeirq.c b/nuttx/arch/arm/src/str71x/str71x_decodeirq.c index 326abd763..48c9aa7e4 100644 --- a/nuttx/arch/arm/src/str71x/str71x_decodeirq.c +++ b/nuttx/arch/arm/src/str71x/str71x_decodeirq.c @@ -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 diff --git a/nuttx/arch/avr/src/avr/up_dumpstate.c b/nuttx/arch/avr/src/avr/up_dumpstate.c index 902c2ce9f..3ce595bf0 100644 --- a/nuttx/arch/avr/src/avr/up_dumpstate.c +++ b/nuttx/arch/avr/src/avr/up_dumpstate.c @@ -63,7 +63,7 @@ */ #undef lldbg -#define lldbg lib_lowprintf +#define lldbg lowsyslog /**************************************************************************** * Private Data diff --git a/nuttx/arch/avr/src/avr32/up_dumpstate.c b/nuttx/arch/avr/src/avr32/up_dumpstate.c index 15a3e7ef8..d6113d40b 100644 --- a/nuttx/arch/avr/src/avr32/up_dumpstate.c +++ b/nuttx/arch/avr/src/avr32/up_dumpstate.c @@ -63,7 +63,7 @@ */ #undef lldbg -#define lldbg lib_lowprintf +#define lldbg lowsyslog /**************************************************************************** * Private Data diff --git a/nuttx/arch/avr/src/common/up_assert.c b/nuttx/arch/avr/src/common/up_assert.c index 12bb564d3..3e90094eb 100644 --- a/nuttx/arch/avr/src/common/up_assert.c +++ b/nuttx/arch/avr/src/common/up_assert.c @@ -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 /**************************************************************************** diff --git a/nuttx/arch/hc/src/m9s12/m9s12_assert.c b/nuttx/arch/hc/src/m9s12/m9s12_assert.c index ff9ce5ca4..65cc75590 100644 --- a/nuttx/arch/hc/src/m9s12/m9s12_assert.c +++ b/nuttx/arch/hc/src/m9s12/m9s12_assert.c @@ -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 diff --git a/nuttx/arch/mips/src/mips32/up_assert.c b/nuttx/arch/mips/src/mips32/up_assert.c index ed4ee4cf7..7d98e7427 100644 --- a/nuttx/arch/mips/src/mips32/up_assert.c +++ b/nuttx/arch/mips/src/mips32/up_assert.c @@ -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 diff --git a/nuttx/arch/mips/src/mips32/up_dumpstate.c b/nuttx/arch/mips/src/mips32/up_dumpstate.c index 866c17b4f..1cd426767 100644 --- a/nuttx/arch/mips/src/mips32/up_dumpstate.c +++ b/nuttx/arch/mips/src/mips32/up_dumpstate.c @@ -63,7 +63,7 @@ */ #undef lldbg -#define lldbg lib_lowprintf +#define lldbg lowsyslog /**************************************************************************** * Private Data diff --git a/nuttx/arch/sh/src/common/up_assert.c b/nuttx/arch/sh/src/common/up_assert.c index ccc0c98e6..5b56e7731 100644 --- a/nuttx/arch/sh/src/common/up_assert.c +++ b/nuttx/arch/sh/src/common/up_assert.c @@ -61,7 +61,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/sh/src/m16c/m16c_dumpstate.c b/nuttx/arch/sh/src/m16c/m16c_dumpstate.c index 438ff21d2..38571a7e1 100644 --- a/nuttx/arch/sh/src/m16c/m16c_dumpstate.c +++ b/nuttx/arch/sh/src/m16c/m16c_dumpstate.c @@ -62,7 +62,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/sh/src/sh1/sh1_dumpstate.c b/nuttx/arch/sh/src/sh1/sh1_dumpstate.c index 296e20a45..f54ea46ce 100644 --- a/nuttx/arch/sh/src/sh1/sh1_dumpstate.c +++ b/nuttx/arch/sh/src/sh1/sh1_dumpstate.c @@ -61,7 +61,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/sim/src/up_initialize.c b/nuttx/arch/sim/src/up_initialize.c index de11c7947..f8ae563e0 100644 --- a/nuttx/arch/sim/src/up_initialize.c +++ b/nuttx/arch/sim/src/up_initialize.c @@ -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 */ diff --git a/nuttx/arch/sim/src/up_tapdev.c b/nuttx/arch/sim/src/up_tapdev.c index f2bbcc14a..197049a34 100644 --- a/nuttx/arch/sim/src/up_tapdev.c +++ b/nuttx/arch/sim/src/up_tapdev.c @@ -61,7 +61,7 @@ #include #include -extern int lib_rawprintf(const char *format, ...); +extern int syslog(const char *format, ...); extern int uipdriver_setmacaddr(unsigned char *macaddr); /**************************************************************************** @@ -119,14 +119,14 @@ 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", - buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], - buf[6], buf[7], buf[8], buf[9], buf[10], buf[11], + 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 - buf[13], buf[12]); + buf[13], buf[12]); #else - buf[12], buf[13]); + buf[12], buf[13]); #endif } #else @@ -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); diff --git a/nuttx/arch/x86/src/common/up_assert.c b/nuttx/arch/x86/src/common/up_assert.c index aa752f84e..87958baa6 100644 --- a/nuttx/arch/x86/src/common/up_assert.c +++ b/nuttx/arch/x86/src/common/up_assert.c @@ -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 diff --git a/nuttx/arch/x86/src/i486/up_regdump.c b/nuttx/arch/x86/src/i486/up_regdump.c index b7547aec4..e30670128 100644 --- a/nuttx/arch/x86/src/i486/up_regdump.c +++ b/nuttx/arch/x86/src/i486/up_regdump.c @@ -51,7 +51,7 @@ /* Output debug info -- even if debug is not selected. */ #undef lldbg -#define lldbg lib_lowprintf +#define lldbg lowsyslog /**************************************************************************** * Private Data diff --git a/nuttx/arch/z16/src/common/up_assert.c b/nuttx/arch/z16/src/common/up_assert.c index 5832ead45..661d88833 100644 --- a/nuttx/arch/z16/src/common/up_assert.c +++ b/nuttx/arch/z16/src/common/up_assert.c @@ -62,7 +62,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/z16/src/common/up_registerdump.c b/nuttx/arch/z16/src/common/up_registerdump.c index dd1f210f7..178320dd2 100644 --- a/nuttx/arch/z16/src/common/up_registerdump.c +++ b/nuttx/arch/z16/src/common/up_registerdump.c @@ -58,7 +58,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/z16/src/common/up_stackdump.c b/nuttx/arch/z16/src/common/up_stackdump.c index b4930f620..077b0c8f7 100644 --- a/nuttx/arch/z16/src/common/up_stackdump.c +++ b/nuttx/arch/z16/src/common/up_stackdump.c @@ -55,7 +55,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/z16/src/z16f/z16f_sysexec.c b/nuttx/arch/z16/src/z16f/z16f_sysexec.c index 2fbc1e2c9..e824076b0 100644 --- a/nuttx/arch/z16/src/z16f/z16f_sysexec.c +++ b/nuttx/arch/z16/src/z16f/z16f_sysexec.c @@ -53,9 +53,9 @@ ***************************************************************************/ #ifdef CONFIG_ARCH_LOWPUTC -# define SYSDBG lib_lowprintf +# define SYSDBG lowsyslog #else -# define SYSDBG lib_rawprintf +# define SYSDBG syslog #endif /*************************************************************************** diff --git a/nuttx/arch/z80/src/common/up_assert.c b/nuttx/arch/z80/src/common/up_assert.c index ff4e569fb..11a2a4f2a 100644 --- a/nuttx/arch/z80/src/common/up_assert.c +++ b/nuttx/arch/z80/src/common/up_assert.c @@ -62,7 +62,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/z80/src/common/up_doirq.c b/nuttx/arch/z80/src/common/up_doirq.c index 4b57f8f7b..ad318e17f 100644 --- a/nuttx/arch/z80/src/common/up_doirq.c +++ b/nuttx/arch/z80/src/common/up_doirq.c @@ -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 */ diff --git a/nuttx/arch/z80/src/common/up_stackdump.c b/nuttx/arch/z80/src/common/up_stackdump.c index 817c2d315..f9c515337 100644 --- a/nuttx/arch/z80/src/common/up_stackdump.c +++ b/nuttx/arch/z80/src/common/up_stackdump.c @@ -56,7 +56,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/z80/src/ez80/ez80_registerdump.c b/nuttx/arch/z80/src/ez80/ez80_registerdump.c index a43bd6459..bf53f81f7 100644 --- a/nuttx/arch/z80/src/ez80/ez80_registerdump.c +++ b/nuttx/arch/z80/src/ez80/ez80_registerdump.c @@ -58,7 +58,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/z80/src/z180/z180_registerdump.c b/nuttx/arch/z80/src/z180/z180_registerdump.c index 65ae791db..17a44b059 100644 --- a/nuttx/arch/z80/src/z180/z180_registerdump.c +++ b/nuttx/arch/z80/src/z180/z180_registerdump.c @@ -58,7 +58,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/z80/src/z8/z8_registerdump.c b/nuttx/arch/z80/src/z8/z8_registerdump.c index 36b6cdd37..f1ce13a24 100644 --- a/nuttx/arch/z80/src/z8/z8_registerdump.c +++ b/nuttx/arch/z80/src/z8/z8_registerdump.c @@ -59,7 +59,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/arch/z80/src/z80/z80_registerdump.c b/nuttx/arch/z80/src/z80/z80_registerdump.c index 0d09a243a..7bf21a26f 100644 --- a/nuttx/arch/z80/src/z80/z80_registerdump.c +++ b/nuttx/arch/z80/src/z80/z80_registerdump.c @@ -58,7 +58,7 @@ #ifdef CONFIG_ARCH_STACKDUMP # undef lldbg -# define lldbg lib_lowprintf +# define lldbg lowsyslog #endif /**************************************************************************** diff --git a/nuttx/binfmt/libelf/libelf_read.c b/nuttx/binfmt/libelf/libelf_read.c index f4b725183..25ee7ba29 100644 --- a/nuttx/binfmt/libelf/libelf_read.c +++ b/nuttx/binfmt/libelf/libelf_read.c @@ -54,7 +54,7 @@ ****************************************************************************/ #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 */ /**************************************************************************** diff --git a/nuttx/binfmt/libnxflat/libnxflat_read.c b/nuttx/binfmt/libnxflat/libnxflat_read.c index 8deeb0805..103a81f81 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_read.c +++ b/nuttx/binfmt/libnxflat/libnxflat_read.c @@ -55,7 +55,7 @@ ****************************************************************************/ #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 */ /**************************************************************************** diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt index 1b78567a3..8d9bb381f 100644 --- a/nuttx/configs/README.txt +++ b/nuttx/configs/README.txt @@ -261,7 +261,7 @@ defconfig -- This is a configuration file similar to the Linux CONFIG_DEBUG - enables built-in debug options 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 debug symbols (needed for use with a debugger). CONFIG_DEBUG_SCHED - enable OS debug output (disabled by diff --git a/nuttx/configs/cloudctrl/src/up_nsh.c b/nuttx/configs/cloudctrl/src/up_nsh.c index f389460bb..6baeeeab8 100644 --- a/nuttx/configs/cloudctrl/src/up_nsh.c +++ b/nuttx/configs/cloudctrl/src/up_nsh.c @@ -101,13 +101,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/cloudctrl/src/up_usbmsc.c b/nuttx/configs/cloudctrl/src/up_usbmsc.c index 1e74e6f24..95fc0189a 100644 --- a/nuttx/configs/cloudctrl/src/up_usbmsc.c +++ b/nuttx/configs/cloudctrl/src/up_usbmsc.c @@ -61,7 +61,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -69,7 +69,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/demo9s12ne64/src/up_nsh.c b/nuttx/configs/demo9s12ne64/src/up_nsh.c index 7e53f7f07..c4773c0ac 100644 --- a/nuttx/configs/demo9s12ne64/src/up_nsh.c +++ b/nuttx/configs/demo9s12ne64/src/up_nsh.c @@ -54,13 +54,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/ea3131/src/up_nsh.c b/nuttx/configs/ea3131/src/up_nsh.c index 29ee7ed2c..b763c26f0 100644 --- a/nuttx/configs/ea3131/src/up_nsh.c +++ b/nuttx/configs/ea3131/src/up_nsh.c @@ -100,13 +100,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/ea3131/src/up_usbmsc.c b/nuttx/configs/ea3131/src/up_usbmsc.c index 5f4850ea1..e1869af4d 100644 --- a/nuttx/configs/ea3131/src/up_usbmsc.c +++ b/nuttx/configs/ea3131/src/up_usbmsc.c @@ -91,8 +91,8 @@ int usbmsc_archinitialize(void) pbuffer = (uint8_t *) malloc (BUFFER_SIZE); if (!pbuffer) { - lib_lowprintf ("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n", - BUFFER_SIZE); + lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n", + BUFFER_SIZE); return -ENOMEM; } diff --git a/nuttx/configs/ea3152/src/up_nsh.c b/nuttx/configs/ea3152/src/up_nsh.c index 2b523b44a..d4ac3da27 100644 --- a/nuttx/configs/ea3152/src/up_nsh.c +++ b/nuttx/configs/ea3152/src/up_nsh.c @@ -100,13 +100,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/ea3152/src/up_usbmsc.c b/nuttx/configs/ea3152/src/up_usbmsc.c index 2c3356b4e..ee67f0eed 100644 --- a/nuttx/configs/ea3152/src/up_usbmsc.c +++ b/nuttx/configs/ea3152/src/up_usbmsc.c @@ -91,8 +91,8 @@ int usbmsc_archinitialize(void) pbuffer = (uint8_t *) malloc (BUFFER_SIZE); if (!pbuffer) { - lib_lowprintf ("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n", - BUFFER_SIZE); + lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n", + BUFFER_SIZE); return -ENOMEM; } diff --git a/nuttx/configs/eagle100/src/up_nsh.c b/nuttx/configs/eagle100/src/up_nsh.c index 65fd30023..b1df8cde6 100644 --- a/nuttx/configs/eagle100/src/up_nsh.c +++ b/nuttx/configs/eagle100/src/up_nsh.c @@ -95,13 +95,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/ekk-lm3s9b96/src/up_nsh.c b/nuttx/configs/ekk-lm3s9b96/src/up_nsh.c index 6f9aac6b1..f54fb726c 100644 --- a/nuttx/configs/ekk-lm3s9b96/src/up_nsh.c +++ b/nuttx/configs/ekk-lm3s9b96/src/up_nsh.c @@ -55,13 +55,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/ez80f910200kitg/ostest/defconfig b/nuttx/configs/ez80f910200kitg/ostest/defconfig index d86177828..1abc3fb58 100644 --- a/nuttx/configs/ez80f910200kitg/ostest/defconfig +++ b/nuttx/configs/ez80f910200kitg/ostest/defconfig @@ -44,7 +44,7 @@ CONFIG_WINDOWS_CYGWIN=y # CONFIG_DEBUG=y # CONFIG_DEBUG_VERBOSE is not set -# CONFIG_DEBUG_ENABLE is not set +# CONFIG_SYSLOG_ENABLE is not set # # Subsystem Debug Options diff --git a/nuttx/configs/ez80f910200zco/ostest/defconfig b/nuttx/configs/ez80f910200zco/ostest/defconfig index e414cfcc1..146b56327 100644 --- a/nuttx/configs/ez80f910200zco/ostest/defconfig +++ b/nuttx/configs/ez80f910200zco/ostest/defconfig @@ -44,7 +44,7 @@ CONFIG_WINDOWS_CYGWIN=y # CONFIG_DEBUG=y # CONFIG_DEBUG_VERBOSE is not set -# CONFIG_DEBUG_ENABLE is not set +# CONFIG_SYSLOG_ENABLE is not set # # Subsystem Debug Options diff --git a/nuttx/configs/fire-stm32v2/src/up_composite.c b/nuttx/configs/fire-stm32v2/src/up_composite.c index 6ebc06176..15200caa8 100644 --- a/nuttx/configs/fire-stm32v2/src/up_composite.c +++ b/nuttx/configs/fire-stm32v2/src/up_composite.c @@ -60,7 +60,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -68,7 +68,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/fire-stm32v2/src/up_nsh.c b/nuttx/configs/fire-stm32v2/src/up_nsh.c index ba93d714f..fa261f561 100644 --- a/nuttx/configs/fire-stm32v2/src/up_nsh.c +++ b/nuttx/configs/fire-stm32v2/src/up_nsh.c @@ -127,13 +127,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/fire-stm32v2/src/up_usbmsc.c b/nuttx/configs/fire-stm32v2/src/up_usbmsc.c index 8a8269539..f1f6ee69c 100644 --- a/nuttx/configs/fire-stm32v2/src/up_usbmsc.c +++ b/nuttx/configs/fire-stm32v2/src/up_usbmsc.c @@ -60,7 +60,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -68,7 +68,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/hymini-stm32v/src/up_nsh.c b/nuttx/configs/hymini-stm32v/src/up_nsh.c index ae1ea03a6..5b823012d 100644 --- a/nuttx/configs/hymini-stm32v/src/up_nsh.c +++ b/nuttx/configs/hymini-stm32v/src/up_nsh.c @@ -110,13 +110,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/hymini-stm32v/src/up_usbmsc.c b/nuttx/configs/hymini-stm32v/src/up_usbmsc.c index 1ce55adcc..da8f02533 100644 --- a/nuttx/configs/hymini-stm32v/src/up_usbmsc.c +++ b/nuttx/configs/hymini-stm32v/src/up_usbmsc.c @@ -78,7 +78,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -86,7 +86,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/kwikstik-k40/src/up_nsh.c b/nuttx/configs/kwikstik-k40/src/up_nsh.c index 884ff3c44..1e52c931e 100644 --- a/nuttx/configs/kwikstik-k40/src/up_nsh.c +++ b/nuttx/configs/kwikstik-k40/src/up_nsh.c @@ -109,13 +109,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/kwikstik-k40/src/up_usbmsc.c b/nuttx/configs/kwikstik-k40/src/up_usbmsc.c index 8051ea1ba..ea97cb99f 100644 --- a/nuttx/configs/kwikstik-k40/src/up_usbmsc.c +++ b/nuttx/configs/kwikstik-k40/src/up_usbmsc.c @@ -74,7 +74,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -82,7 +82,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/lincoln60/src/up_nsh.c b/nuttx/configs/lincoln60/src/up_nsh.c index 2c829837a..a4a679415 100644 --- a/nuttx/configs/lincoln60/src/up_nsh.c +++ b/nuttx/configs/lincoln60/src/up_nsh.c @@ -56,13 +56,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/lm3s6432-s2e/src/up_nsh.c b/nuttx/configs/lm3s6432-s2e/src/up_nsh.c index 46726e753..75107be22 100644 --- a/nuttx/configs/lm3s6432-s2e/src/up_nsh.c +++ b/nuttx/configs/lm3s6432-s2e/src/up_nsh.c @@ -57,13 +57,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/lm3s6965-ek/src/up_nsh.c b/nuttx/configs/lm3s6965-ek/src/up_nsh.c index 409b351f0..24b8b0206 100644 --- a/nuttx/configs/lm3s6965-ek/src/up_nsh.c +++ b/nuttx/configs/lm3s6965-ek/src/up_nsh.c @@ -95,13 +95,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/lm3s8962-ek/src/up_nsh.c b/nuttx/configs/lm3s8962-ek/src/up_nsh.c index 693862184..f12c48988 100644 --- a/nuttx/configs/lm3s8962-ek/src/up_nsh.c +++ b/nuttx/configs/lm3s8962-ek/src/up_nsh.c @@ -95,13 +95,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/lpcxpresso-lpc1768/src/up_nsh.c b/nuttx/configs/lpcxpresso-lpc1768/src/up_nsh.c index b9c39ed16..6165cd9e9 100644 --- a/nuttx/configs/lpcxpresso-lpc1768/src/up_nsh.c +++ b/nuttx/configs/lpcxpresso-lpc1768/src/up_nsh.c @@ -103,13 +103,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/lpcxpresso-lpc1768/src/up_usbmsc.c b/nuttx/configs/lpcxpresso-lpc1768/src/up_usbmsc.c index c43028f1e..937c7857a 100644 --- a/nuttx/configs/lpcxpresso-lpc1768/src/up_usbmsc.c +++ b/nuttx/configs/lpcxpresso-lpc1768/src/up_usbmsc.c @@ -74,7 +74,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -82,7 +82,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/mbed/src/up_nsh.c b/nuttx/configs/mbed/src/up_nsh.c index 3a23ca7a5..883a0da15 100644 --- a/nuttx/configs/mbed/src/up_nsh.c +++ b/nuttx/configs/mbed/src/up_nsh.c @@ -72,13 +72,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/mcu123-lpc214x/src/up_composite.c b/nuttx/configs/mcu123-lpc214x/src/up_composite.c index 3540cdb8a..8feacc971 100644 --- a/nuttx/configs/mcu123-lpc214x/src/up_composite.c +++ b/nuttx/configs/mcu123-lpc214x/src/up_composite.c @@ -75,7 +75,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -83,7 +83,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/mcu123-lpc214x/src/up_nsh.c b/nuttx/configs/mcu123-lpc214x/src/up_nsh.c index 14b5d7d97..c4a56784f 100644 --- a/nuttx/configs/mcu123-lpc214x/src/up_nsh.c +++ b/nuttx/configs/mcu123-lpc214x/src/up_nsh.c @@ -95,13 +95,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/mcu123-lpc214x/src/up_usbmsc.c b/nuttx/configs/mcu123-lpc214x/src/up_usbmsc.c index 79d9344a4..f003d4c3c 100644 --- a/nuttx/configs/mcu123-lpc214x/src/up_usbmsc.c +++ b/nuttx/configs/mcu123-lpc214x/src/up_usbmsc.c @@ -74,7 +74,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -82,7 +82,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/ne64badge/src/up_nsh.c b/nuttx/configs/ne64badge/src/up_nsh.c index 17a52819b..10e0e74d5 100644 --- a/nuttx/configs/ne64badge/src/up_nsh.c +++ b/nuttx/configs/ne64badge/src/up_nsh.c @@ -54,13 +54,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/nucleus2g/src/up_nsh.c b/nuttx/configs/nucleus2g/src/up_nsh.c index 9986c8282..4453d73a1 100644 --- a/nuttx/configs/nucleus2g/src/up_nsh.c +++ b/nuttx/configs/nucleus2g/src/up_nsh.c @@ -97,13 +97,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/nucleus2g/src/up_usbmsc.c b/nuttx/configs/nucleus2g/src/up_usbmsc.c index 8c71a5ce7..f4a533cb6 100644 --- a/nuttx/configs/nucleus2g/src/up_usbmsc.c +++ b/nuttx/configs/nucleus2g/src/up_usbmsc.c @@ -74,7 +74,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -82,7 +82,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/olimex-lpc1766stk/src/up_nsh.c b/nuttx/configs/olimex-lpc1766stk/src/up_nsh.c index 99e9c4d9c..f201c8a1b 100644 --- a/nuttx/configs/olimex-lpc1766stk/src/up_nsh.c +++ b/nuttx/configs/olimex-lpc1766stk/src/up_nsh.c @@ -124,13 +124,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/olimex-lpc1766stk/src/up_usbmsc.c b/nuttx/configs/olimex-lpc1766stk/src/up_usbmsc.c index ce7c75771..5f97aff81 100644 --- a/nuttx/configs/olimex-lpc1766stk/src/up_usbmsc.c +++ b/nuttx/configs/olimex-lpc1766stk/src/up_usbmsc.c @@ -77,7 +77,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -85,7 +85,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/olimex-lpc2378/src/up_nsh.c b/nuttx/configs/olimex-lpc2378/src/up_nsh.c index 6279a7668..f5ec1fed8 100644 --- a/nuttx/configs/olimex-lpc2378/src/up_nsh.c +++ b/nuttx/configs/olimex-lpc2378/src/up_nsh.c @@ -84,13 +84,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/olimex-strp711/src/up_nsh.c b/nuttx/configs/olimex-strp711/src/up_nsh.c index 21c3efb83..7499a8d8f 100644 --- a/nuttx/configs/olimex-strp711/src/up_nsh.c +++ b/nuttx/configs/olimex-strp711/src/up_nsh.c @@ -99,13 +99,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/pic32-starterkit/src/up_nsh.c b/nuttx/configs/pic32-starterkit/src/up_nsh.c index 0f0f0dffe..f0e745112 100644 --- a/nuttx/configs/pic32-starterkit/src/up_nsh.c +++ b/nuttx/configs/pic32-starterkit/src/up_nsh.c @@ -154,13 +154,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/pic32-starterkit/src/up_usbmsc.c b/nuttx/configs/pic32-starterkit/src/up_usbmsc.c index c645c0fe5..51e450c56 100644 --- a/nuttx/configs/pic32-starterkit/src/up_usbmsc.c +++ b/nuttx/configs/pic32-starterkit/src/up_usbmsc.c @@ -50,7 +50,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -58,7 +58,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/pic32mx7mmb/src/up_nsh.c b/nuttx/configs/pic32mx7mmb/src/up_nsh.c index d063450d3..a1bfbeaa2 100644 --- a/nuttx/configs/pic32mx7mmb/src/up_nsh.c +++ b/nuttx/configs/pic32mx7mmb/src/up_nsh.c @@ -153,13 +153,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/pic32mx7mmb/src/up_usbmsc.c b/nuttx/configs/pic32mx7mmb/src/up_usbmsc.c index fbebaa3d1..d1f473d4f 100644 --- a/nuttx/configs/pic32mx7mmb/src/up_usbmsc.c +++ b/nuttx/configs/pic32mx7mmb/src/up_usbmsc.c @@ -50,7 +50,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -58,7 +58,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/rgmp/include/README.txt b/nuttx/configs/rgmp/include/README.txt index 006f13e7c..78da4eb92 100644 --- a/nuttx/configs/rgmp/include/README.txt +++ b/nuttx/configs/rgmp/include/README.txt @@ -1 +1 @@ -This directory is reserved for RGMP header files +This directory is reserved for RGMP header files diff --git a/nuttx/configs/rgmp/src/README.txt b/nuttx/configs/rgmp/src/README.txt index d7d216e24..3d0f237c0 100644 --- a/nuttx/configs/rgmp/src/README.txt +++ b/nuttx/configs/rgmp/src/README.txt @@ -1 +1 @@ -This directory is reserved for RGMP source files +This directory is reserved for RGMP source files diff --git a/nuttx/configs/sam3u-ek/src/up_nsh.c b/nuttx/configs/sam3u-ek/src/up_nsh.c index e8c0df87b..7b3174a74 100644 --- a/nuttx/configs/sam3u-ek/src/up_nsh.c +++ b/nuttx/configs/sam3u-ek/src/up_nsh.c @@ -100,13 +100,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_rawprintf(__VA_ARGS__) +# define message(...) syslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_rawprintf +# define message syslog # else # define message printf # endif diff --git a/nuttx/configs/sam3u-ek/src/up_usbmsc.c b/nuttx/configs/sam3u-ek/src/up_usbmsc.c index 7e04ee04a..dfe2e2c49 100644 --- a/nuttx/configs/sam3u-ek/src/up_usbmsc.c +++ b/nuttx/configs/sam3u-ek/src/up_usbmsc.c @@ -76,7 +76,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -84,7 +84,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/shenzhou/src/up_composite.c b/nuttx/configs/shenzhou/src/up_composite.c index 81c33dcc8..fb1640908 100644 --- a/nuttx/configs/shenzhou/src/up_composite.c +++ b/nuttx/configs/shenzhou/src/up_composite.c @@ -60,7 +60,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -68,7 +68,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/shenzhou/src/up_ili93xx.c b/nuttx/configs/shenzhou/src/up_ili93xx.c index a89e20d02..1a099f820 100644 --- a/nuttx/configs/shenzhou/src/up_ili93xx.c +++ b/nuttx/configs/shenzhou/src/up_ili93xx.c @@ -833,14 +833,14 @@ static void stm32_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixels { int i, j; - lib_rawprintf("\n%s:\n", msg); + syslog("\n%s:\n", msg); for (i = 0; i < npixels; i += 16) { up_putc(' '); - lib_rawprintf(" "); + syslog(" "); for (j = 0; j < 16; j++) { - lib_rawprintf(" %04x", *run++); + syslog(" %04x", *run++); } up_putc('\n'); } diff --git a/nuttx/configs/shenzhou/src/up_nsh.c b/nuttx/configs/shenzhou/src/up_nsh.c index 685281f5d..d68a734e0 100644 --- a/nuttx/configs/shenzhou/src/up_nsh.c +++ b/nuttx/configs/shenzhou/src/up_nsh.c @@ -149,13 +149,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/shenzhou/src/up_usbmsc.c b/nuttx/configs/shenzhou/src/up_usbmsc.c index 8566aedfd..eaecfb496 100644 --- a/nuttx/configs/shenzhou/src/up_usbmsc.c +++ b/nuttx/configs/shenzhou/src/up_usbmsc.c @@ -60,7 +60,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -68,7 +68,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/sim/cxxtest/defconfig b/nuttx/configs/sim/cxxtest/defconfig index 6ac45d44d..b12eda172 100644 --- a/nuttx/configs/sim/cxxtest/defconfig +++ b/nuttx/configs/sim/cxxtest/defconfig @@ -36,7 +36,7 @@ CONFIG_ARCH_FLOAT_H=y # CONFIG_DEBUG=y CONFIG_DEBUG_VERBOSE=y -# CONFIG_DEBUG_ENABLE is not set +# CONFIG_SYSLOG_ENABLE is not set # # Subsystem Debug Options diff --git a/nuttx/configs/sim/ostest/defconfig b/nuttx/configs/sim/ostest/defconfig index 65f5330fc..07a0f71b4 100644 --- a/nuttx/configs/sim/ostest/defconfig +++ b/nuttx/configs/sim/ostest/defconfig @@ -40,7 +40,7 @@ CONFIG_HOST_LINUX=y # CONFIG_DEBUG=y CONFIG_DEBUG_VERBOSE=y -# CONFIG_DEBUG_ENABLE is not set +# CONFIG_SYSLOG_ENABLE is not set # # Subsystem Debug Options diff --git a/nuttx/configs/stm3210e-eval/src/up_composite.c b/nuttx/configs/stm3210e-eval/src/up_composite.c index e80e0fcb4..de5759c78 100644 --- a/nuttx/configs/stm3210e-eval/src/up_composite.c +++ b/nuttx/configs/stm3210e-eval/src/up_composite.c @@ -79,7 +79,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -87,7 +87,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/stm3210e-eval/src/up_lcd.c b/nuttx/configs/stm3210e-eval/src/up_lcd.c index 8b832aafb..81cc3f20a 100644 --- a/nuttx/configs/stm3210e-eval/src/up_lcd.c +++ b/nuttx/configs/stm3210e-eval/src/up_lcd.c @@ -704,14 +704,14 @@ static void stm3210e_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npix { int i, j; - lib_rawprintf("\n%s:\n", msg); + syslog("\n%s:\n", msg); for (i = 0; i < npixels; i += 16) { up_putc(' '); - lib_rawprintf(" "); + syslog(" "); for (j = 0; j < 16; j++) { - lib_rawprintf(" %04x", *run++); + syslog(" %04x", *run++); } up_putc('\n'); } diff --git a/nuttx/configs/stm3210e-eval/src/up_nsh.c b/nuttx/configs/stm3210e-eval/src/up_nsh.c index 3e7c2013c..544a0e75e 100644 --- a/nuttx/configs/stm3210e-eval/src/up_nsh.c +++ b/nuttx/configs/stm3210e-eval/src/up_nsh.c @@ -108,13 +108,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/stm3210e-eval/src/up_pmbuttons.c b/nuttx/configs/stm3210e-eval/src/up_pmbuttons.c index c0f16ee8c..cc6f3cae0 100644 --- a/nuttx/configs/stm3210e-eval/src/up_pmbuttons.c +++ b/nuttx/configs/stm3210e-eval/src/up_pmbuttons.c @@ -308,9 +308,9 @@ void up_pmbuttons(void) if (oldhandler != NULL) { - lib_lowprintf("WARNING: oldhandler:%p is not NULL! " - "Button events may be lost or aliased!\n", - oldhandler); + lowsyslog("WARNING: oldhandler:%p is not NULL! " + "Button events may be lost or aliased!\n", + oldhandler); } } #endif diff --git a/nuttx/configs/stm3210e-eval/src/up_usbmsc.c b/nuttx/configs/stm3210e-eval/src/up_usbmsc.c index dce463abc..d1727174e 100644 --- a/nuttx/configs/stm3210e-eval/src/up_usbmsc.c +++ b/nuttx/configs/stm3210e-eval/src/up_usbmsc.c @@ -78,7 +78,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -86,7 +86,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/stm3220g-eval/src/up_lcd.c b/nuttx/configs/stm3220g-eval/src/up_lcd.c index a1fcceef7..4a1ce0953 100644 --- a/nuttx/configs/stm3220g-eval/src/up_lcd.c +++ b/nuttx/configs/stm3220g-eval/src/up_lcd.c @@ -550,14 +550,14 @@ static void stm3220g_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npix { int i, j; - lib_rawprintf("\n%s:\n", msg); + syslog("\n%s:\n", msg); for (i = 0; i < npixels; i += 16) { up_putc(' '); - lib_rawprintf(" "); + syslog(" "); for (j = 0; j < 16; j++) { - lib_rawprintf(" %04x", *run++); + syslog(" %04x", *run++); } up_putc('\n'); } diff --git a/nuttx/configs/stm3220g-eval/src/up_nsh.c b/nuttx/configs/stm3220g-eval/src/up_nsh.c index e1359de96..068deb1a6 100644 --- a/nuttx/configs/stm3220g-eval/src/up_nsh.c +++ b/nuttx/configs/stm3220g-eval/src/up_nsh.c @@ -122,13 +122,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/stm3240g-eval/discover/defconfig b/nuttx/configs/stm3240g-eval/discover/defconfig index e11d39ce1..37b74972f 100644 --- a/nuttx/configs/stm3240g-eval/discover/defconfig +++ b/nuttx/configs/stm3240g-eval/discover/defconfig @@ -35,7 +35,7 @@ CONFIG_RAW_BINARY=y # CONFIG_DEBUG=y # CONFIG_DEBUG_VERBOSE is not set -# CONFIG_DEBUG_ENABLE is not set +# CONFIG_SYSLOG_ENABLE is not set # # Subsystem Debug Options diff --git a/nuttx/configs/stm3240g-eval/src/up_lcd.c b/nuttx/configs/stm3240g-eval/src/up_lcd.c index 45e4a2b57..74088dc5e 100644 --- a/nuttx/configs/stm3240g-eval/src/up_lcd.c +++ b/nuttx/configs/stm3240g-eval/src/up_lcd.c @@ -550,14 +550,14 @@ static void stm3240g_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npix { int i, j; - lib_rawprintf("\n%s:\n", msg); + syslog("\n%s:\n", msg); for (i = 0; i < npixels; i += 16) { up_putc(' '); - lib_rawprintf(" "); + syslog(" "); for (j = 0; j < 16; j++) { - lib_rawprintf(" %04x", *run++); + syslog(" %04x", *run++); } up_putc('\n'); } diff --git a/nuttx/configs/stm3240g-eval/src/up_nsh.c b/nuttx/configs/stm3240g-eval/src/up_nsh.c index c106e9918..596f902db 100644 --- a/nuttx/configs/stm3240g-eval/src/up_nsh.c +++ b/nuttx/configs/stm3240g-eval/src/up_nsh.c @@ -128,13 +128,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/stm3240g-eval/xmlrpc/defconfig b/nuttx/configs/stm3240g-eval/xmlrpc/defconfig index 4f621d453..daa1efb8a 100644 --- a/nuttx/configs/stm3240g-eval/xmlrpc/defconfig +++ b/nuttx/configs/stm3240g-eval/xmlrpc/defconfig @@ -35,7 +35,7 @@ CONFIG_RAW_BINARY=y # CONFIG_DEBUG=y # CONFIG_DEBUG_VERBOSE is not set -# CONFIG_DEBUG_ENABLE is not set +# CONFIG_SYSLOG_ENABLE is not set # # Subsystem Debug Options diff --git a/nuttx/configs/stm32f4discovery/src/up_nsh.c b/nuttx/configs/stm32f4discovery/src/up_nsh.c index 2a933569f..fd3fe5cd9 100644 --- a/nuttx/configs/stm32f4discovery/src/up_nsh.c +++ b/nuttx/configs/stm32f4discovery/src/up_nsh.c @@ -89,13 +89,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/stm32f4discovery/src/up_pmbuttons.c b/nuttx/configs/stm32f4discovery/src/up_pmbuttons.c index aa72e3da1..4bc241fce 100644 --- a/nuttx/configs/stm32f4discovery/src/up_pmbuttons.c +++ b/nuttx/configs/stm32f4discovery/src/up_pmbuttons.c @@ -139,7 +139,7 @@ void up_pmbuttons(void) if (oldhandler != NULL) { - lib_lowprintf("WARNING: oldhandler:%p is not NULL! " + lowsyslog("WARNING: oldhandler:%p is not NULL! " "Button events may be lost or aliased!\n", oldhandler); } diff --git a/nuttx/configs/sure-pic32mx/src/up_nsh.c b/nuttx/configs/sure-pic32mx/src/up_nsh.c index 4b68350ed..94ae10d21 100644 --- a/nuttx/configs/sure-pic32mx/src/up_nsh.c +++ b/nuttx/configs/sure-pic32mx/src/up_nsh.c @@ -124,13 +124,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/teensy/src/up_usbmsc.c b/nuttx/configs/teensy/src/up_usbmsc.c index fcf7fe2f5..0b944eda3 100644 --- a/nuttx/configs/teensy/src/up_usbmsc.c +++ b/nuttx/configs/teensy/src/up_usbmsc.c @@ -78,7 +78,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -86,7 +86,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/twr-k60n512/src/up_nsh.c b/nuttx/configs/twr-k60n512/src/up_nsh.c index 3bb4e8527..8069e3f96 100644 --- a/nuttx/configs/twr-k60n512/src/up_nsh.c +++ b/nuttx/configs/twr-k60n512/src/up_nsh.c @@ -109,13 +109,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/twr-k60n512/src/up_usbmsc.c b/nuttx/configs/twr-k60n512/src/up_usbmsc.c index 1a8f7a70d..c893551ca 100644 --- a/nuttx/configs/twr-k60n512/src/up_usbmsc.c +++ b/nuttx/configs/twr-k60n512/src/up_usbmsc.c @@ -74,7 +74,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -82,7 +82,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/ubw32/src/up_nsh.c b/nuttx/configs/ubw32/src/up_nsh.c index 5e5895b63..7c6452004 100644 --- a/nuttx/configs/ubw32/src/up_nsh.c +++ b/nuttx/configs/ubw32/src/up_nsh.c @@ -54,13 +54,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/vsn/src/usbmsc.c b/nuttx/configs/vsn/src/usbmsc.c index c0eebf6bf..198e27dea 100644 --- a/nuttx/configs/vsn/src/usbmsc.c +++ b/nuttx/configs/vsn/src/usbmsc.c @@ -79,7 +79,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # define msgflush() # else # define message(...) printf(__VA_ARGS__) @@ -87,7 +87,7 @@ # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # define msgflush() # else # define message printf diff --git a/nuttx/configs/vsn/src/vsn.h b/nuttx/configs/vsn/src/vsn.h index eb999f246..f8414f36c 100644 --- a/nuttx/configs/vsn/src/vsn.h +++ b/nuttx/configs/vsn/src/vsn.h @@ -175,13 +175,13 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG -# define message(...) lib_lowprintf(__VA_ARGS__) +# define message(...) lowsyslog(__VA_ARGS__) # else # define message(...) printf(__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog # else # define message printf # endif diff --git a/nuttx/configs/z16f2800100zcog/ostest/defconfig b/nuttx/configs/z16f2800100zcog/ostest/defconfig index 64828738f..50c3a96c6 100644 --- a/nuttx/configs/z16f2800100zcog/ostest/defconfig +++ b/nuttx/configs/z16f2800100zcog/ostest/defconfig @@ -44,7 +44,7 @@ CONFIG_WINDOWS_CYGWIN=y # CONFIG_DEBUG=y # CONFIG_DEBUG_VERBOSE is not set -# CONFIG_DEBUG_ENABLE is not set +# CONFIG_SYSLOG_ENABLE is not set # # Subsystem Debug Options diff --git a/nuttx/configs/z16f2800100zcog/pashello/README.txt b/nuttx/configs/z16f2800100zcog/pashello/README.txt index bc9828184..97d326097 100644 --- a/nuttx/configs/z16f2800100zcog/pashello/README.txt +++ b/nuttx/configs/z16f2800100zcog/pashello/README.txt @@ -1,12 +1,12 @@ -README.txt -^^^^^^^^^^ - -pashello.zfpproj is a simple ZDS-II project that will allow you - to use the ZDS-II debugger. Before using, copy the following - files from the toplevel directory: - - nuttx.hex, nuttx.map, nuttx.lod - - to this directory as: - - pashello.hex, pashello.map, pashello.lod +README.txt +^^^^^^^^^^ + +pashello.zfpproj is a simple ZDS-II project that will allow you + to use the ZDS-II debugger. Before using, copy the following + files from the toplevel directory: + + nuttx.hex, nuttx.map, nuttx.lod + + to this directory as: + + pashello.hex, pashello.map, pashello.lod diff --git a/nuttx/configs/z16f2800100zcog/pashello/defconfig b/nuttx/configs/z16f2800100zcog/pashello/defconfig index ba99283d3..96bff8dee 100644 --- a/nuttx/configs/z16f2800100zcog/pashello/defconfig +++ b/nuttx/configs/z16f2800100zcog/pashello/defconfig @@ -44,7 +44,7 @@ CONFIG_WINDOWS_CYGWIN=y # CONFIG_DEBUG=y # CONFIG_DEBUG_VERBOSE is not set -# CONFIG_DEBUG_ENABLE is not set +# CONFIG_SYSLOG_ENABLE is not set # # Subsystem Debug Options diff --git a/nuttx/configs/z8encore000zco/ostest/defconfig b/nuttx/configs/z8encore000zco/ostest/defconfig index 7bd512727..605bec669 100644 --- a/nuttx/configs/z8encore000zco/ostest/defconfig +++ b/nuttx/configs/z8encore000zco/ostest/defconfig @@ -44,7 +44,7 @@ CONFIG_WINDOWS_CYGWIN=y # CONFIG_DEBUG=y # CONFIG_DEBUG_VERBOSE is not set -# CONFIG_DEBUG_ENABLE is not set +# CONFIG_SYSLOG_ENABLE is not set # # Subsystem Debug Options diff --git a/nuttx/configs/z8f64200100kit/ostest/defconfig b/nuttx/configs/z8f64200100kit/ostest/defconfig index e98e41561..aabfc6ee4 100644 --- a/nuttx/configs/z8f64200100kit/ostest/defconfig +++ b/nuttx/configs/z8f64200100kit/ostest/defconfig @@ -44,7 +44,7 @@ CONFIG_WINDOWS_CYGWIN=y # CONFIG_DEBUG=y # CONFIG_DEBUG_VERBOSE is not set -# CONFIG_DEBUG_ENABLE is not set +# CONFIG_SYSLOG_ENABLE is not set # # Subsystem Debug Options diff --git a/nuttx/drivers/lcd/mio283qt2.c b/nuttx/drivers/lcd/mio283qt2.c index 1758e230c..4c8835eef 100644 --- a/nuttx/drivers/lcd/mio283qt2.c +++ b/nuttx/drivers/lcd/mio283qt2.c @@ -495,14 +495,14 @@ static void mio283qt2_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npi { int i, j; - lib_rawprintf("\n%s:\n", msg); + syslog("\n%s:\n", msg); for (i = 0; i < npixels; i += 16) { up_putc(' '); - lib_rawprintf(" "); + syslog(" "); for (j = 0; j < 16; j++) { - lib_rawprintf(" %04x", *run++); + syslog(" %04x", *run++); } up_putc('\n'); } diff --git a/nuttx/drivers/lcd/ssd1289.c b/nuttx/drivers/lcd/ssd1289.c index e42b5bded..d78688be5 100644 --- a/nuttx/drivers/lcd/ssd1289.c +++ b/nuttx/drivers/lcd/ssd1289.c @@ -497,14 +497,14 @@ static void ssd1289_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixe { int i, j; - lib_rawprintf("\n%s:\n", msg); + syslog("\n%s:\n", msg); for (i = 0; i < npixels; i += 16) { up_putc(' '); - lib_rawprintf(" "); + syslog(" "); for (j = 0; j < 16; j++) { - lib_rawprintf(" %04x", *run++); + syslog(" %04x", *run++); } up_putc('\n'); } diff --git a/nuttx/drivers/mmcsd/mmcsd_debug.c b/nuttx/drivers/mmcsd/mmcsd_debug.c index 0bd7f896e..8cb5b2a2a 100644 --- a/nuttx/drivers/mmcsd/mmcsd_debug.c +++ b/nuttx/drivers/mmcsd/mmcsd_debug.c @@ -56,9 +56,9 @@ /* This needs to match the logic in include/debug.h */ #ifdef CONFIG_CPP_HAVE_VARARGS -# define message(format, arg...) lib_rawprintf(format, ##arg) +# define message(format, arg...) syslog(format, ##arg) #else -# define message lib_rawprintf +# define message syslog #endif /**************************************************************************** diff --git a/nuttx/drivers/net/enc28j60.c b/nuttx/drivers/net/enc28j60.c index 2346ee2d6..203259aeb 100644 --- a/nuttx/drivers/net/enc28j60.c +++ b/nuttx/drivers/net/enc28j60.c @@ -179,10 +179,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_ENC28J60_REGDEBUG -# define enc_wrdump(a,v) lib_lowprintf("ENC28J60: %02x<-%02x\n", a, v); -# define enc_rddump(a,v) lib_lowprintf("ENC28J60: %02x->%02x\n", a, v); -# define enc_cmddump(c) lib_lowprintf("ENC28J60: CMD: %02x\n", c); -# define enc_bmdump(c,b,s) lib_lowprintf("ENC28J60: CMD: %02x buffer: %p length: %d\n", c,b,s); +# define enc_wrdump(a,v) lowsyslog("ENC28J60: %02x<-%02x\n", a, v); +# define enc_rddump(a,v) lowsyslog("ENC28J60: %02x->%02x\n", a, v); +# define enc_cmddump(c) lowsyslog("ENC28J60: CMD: %02x\n", c); +# define enc_bmdump(c,b,s) lowsyslog("ENC28J60: CMD: %02x buffer: %p length: %d\n", c,b,s); #else # define enc_wrdump(a,v) # define enc_rddump(a,v) @@ -773,56 +773,56 @@ static int enc_waitbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg, #if 0 /* Sometimes useful */ static void enc_rxdump(FAR struct enc_driver_s *priv) { - lib_lowprintf("Rx Registers:\n"); - lib_lowprintf(" EIE: %02x EIR: %02x\n", - enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR)); - lib_lowprintf(" ESTAT: %02x ECON1: %02x ECON2: %02x\n", - enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1), - enc_rdgreg(priv, ENC_ECON2)); - lib_lowprintf(" ERXST: %02x %02x\n", - enc_rdbreg(priv, ENC_ERXSTH), enc_rdbreg(priv, ENC_ERXSTL)); - lib_lowprintf(" ERXND: %02x %02x\n", - enc_rdbreg(priv, ENC_ERXNDH), enc_rdbreg(priv, ENC_ERXNDL)); - lib_lowprintf(" ERXRDPT: %02x %02x\n", - enc_rdbreg(priv, ENC_ERXRDPTH), enc_rdbreg(priv, ENC_ERXRDPTL)); - lib_lowprintf(" ERXFCON: %02x EPKTCNT: %02x\n", - enc_rdbreg(priv, ENC_ERXFCON), enc_rdbreg(priv, ENC_EPKTCNT)); - lib_lowprintf(" MACON1: %02x MACON3: %02x\n", - enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3)); - lib_lowprintf(" MAMXFL: %02x %02x\n", - enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL)); - lib_lowprintf(" MAADR: %02x:%02x:%02x:%02x:%02x:%02x\n", - enc_rdbreg(priv, ENC_MAADR1), enc_rdbreg(priv, ENC_MAADR2), - enc_rdbreg(priv, ENC_MAADR3), enc_rdbreg(priv, ENC_MAADR4), - enc_rdbreg(priv, ENC_MAADR5), enc_rdbreg(priv, ENC_MAADR6)); + lowsyslog("Rx Registers:\n"); + lowsyslog(" EIE: %02x EIR: %02x\n", + enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR)); + lowsyslog(" ESTAT: %02x ECON1: %02x ECON2: %02x\n", + enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1), + enc_rdgreg(priv, ENC_ECON2)); + lowsyslog(" ERXST: %02x %02x\n", + enc_rdbreg(priv, ENC_ERXSTH), enc_rdbreg(priv, ENC_ERXSTL)); + lowsyslog(" ERXND: %02x %02x\n", + enc_rdbreg(priv, ENC_ERXNDH), enc_rdbreg(priv, ENC_ERXNDL)); + lowsyslog(" ERXRDPT: %02x %02x\n", + enc_rdbreg(priv, ENC_ERXRDPTH), enc_rdbreg(priv, ENC_ERXRDPTL)); + lowsyslog(" ERXFCON: %02x EPKTCNT: %02x\n", + enc_rdbreg(priv, ENC_ERXFCON), enc_rdbreg(priv, ENC_EPKTCNT)); + lowsyslog(" MACON1: %02x MACON3: %02x\n", + enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3)); + lowsyslog(" MAMXFL: %02x %02x\n", + enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL)); + lowsyslog(" MAADR: %02x:%02x:%02x:%02x:%02x:%02x\n", + enc_rdbreg(priv, ENC_MAADR1), enc_rdbreg(priv, ENC_MAADR2), + enc_rdbreg(priv, ENC_MAADR3), enc_rdbreg(priv, ENC_MAADR4), + enc_rdbreg(priv, ENC_MAADR5), enc_rdbreg(priv, ENC_MAADR6)); } #endif #if 0 /* Sometimes useful */ static void enc_txdump(FAR struct enc_driver_s *priv) { - lib_lowprintf("Tx Registers:\n"); - lib_lowprintf(" EIE: %02x EIR: %02x ESTAT: %02x\n", - enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR),); - lib_lowprintf(" ESTAT: %02x ECON1: %02x\n", - enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1)); - lib_lowprintf(" ETXST: %02x %02x\n", - enc_rdbreg(priv, ENC_ETXSTH), enc_rdbreg(priv, ENC_ETXSTL)); - lib_lowprintf(" ETXND: %02x %02x\n", - enc_rdbreg(priv, ENC_ETXNDH), enc_rdbreg(priv, ENC_ETXNDL)); - lib_lowprintf(" MACON1: %02x MACON3: %02x MACON4: %02x\n", - enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3), - enc_rdbreg(priv, ENC_MACON4)); - lib_lowprintf(" MACON1: %02x MACON3: %02x MACON4: %02x\n", - enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3), - enc_rdbreg(priv, ENC_MACON4)); - lib_lowprintf(" MABBIPG: %02x MAIPG %02x %02x\n", - enc_rdbreg(priv, ENC_MABBIPG), enc_rdbreg(priv, ENC_MAIPGH), - enc_rdbreg(priv, ENC_MAIPGL)); - lib_lowprintf(" MACLCON1: %02x MACLCON2: %02x\n", - enc_rdbreg(priv, ENC_MACLCON1), enc_rdbreg(priv, ENC_MACLCON2)); - lib_lowprintf(" MAMXFL: %02x %02x\n", - enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL)); + lowsyslog("Tx Registers:\n"); + lowsyslog(" EIE: %02x EIR: %02x ESTAT: %02x\n", + enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR),); + lowsyslog(" ESTAT: %02x ECON1: %02x\n", + enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1)); + lowsyslog(" ETXST: %02x %02x\n", + enc_rdbreg(priv, ENC_ETXSTH), enc_rdbreg(priv, ENC_ETXSTL)); + lowsyslog(" ETXND: %02x %02x\n", + enc_rdbreg(priv, ENC_ETXNDH), enc_rdbreg(priv, ENC_ETXNDL)); + lowsyslog(" MACON1: %02x MACON3: %02x MACON4: %02x\n", + enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3), + enc_rdbreg(priv, ENC_MACON4)); + lowsyslog(" MACON1: %02x MACON3: %02x MACON4: %02x\n", + enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3), + enc_rdbreg(priv, ENC_MACON4)); + lowsyslog(" MABBIPG: %02x MAIPG %02x %02x\n", + enc_rdbreg(priv, ENC_MABBIPG), enc_rdbreg(priv, ENC_MAIPGH), + enc_rdbreg(priv, ENC_MAIPGL)); + lowsyslog(" MACLCON1: %02x MACLCON2: %02x\n", + enc_rdbreg(priv, ENC_MACLCON1), enc_rdbreg(priv, ENC_MACLCON2)); + lowsyslog(" MAMXFL: %02x %02x\n", + enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL)); } #endif diff --git a/nuttx/drivers/syslog/ramlog.c b/nuttx/drivers/syslog/ramlog.c index b3a2ad0f5..08bbbfb59 100644 --- a/nuttx/drivers/syslog/ramlog.c +++ b/nuttx/drivers/syslog/ramlog.c @@ -726,10 +726,10 @@ int ramlog_sysloginit(void) * * Description: * This is the low-level system logging interface. The debugging/syslogging - * interfaces are lib_rawprintf() and lib_lowprinf(). The difference is - * the lib_rawprintf() writes to fd=1 (stdout) and lib_lowprintf() uses + * interfaces are syslog() and lowsyslog(). The difference is that + * the syslog() internface writes to fd=1 (stdout) whereas lowsyslog() uses * a lower level interface that works from interrupt handlers. This - * function is a a low-level interface used to implement lib_lowprintf() + * function is a a low-level interface used to implement lowsyslog() * when CONFIG_RAMLOG_SYSLOG=y and CONFIG_SYSLOG=y * ****************************************************************************/ diff --git a/nuttx/drivers/usbdev/usbdev_trace.c b/nuttx/drivers/usbdev/usbdev_trace.c index c8cc09292..c332c1358 100644 --- a/nuttx/drivers/usbdev/usbdev_trace.c +++ b/nuttx/drivers/usbdev/usbdev_trace.c @@ -168,9 +168,9 @@ void usbtrace(uint16_t event, uint16_t value) } } #else - /* Just print the data using lib_lowprintf */ + /* Just print the data using lowsyslog */ - usbtrace_trprintf((trprintf_t)lib_lowprintf, event, value); + usbtrace_trprintf((trprintf_t)lowsyslog, event, value); #endif } irqrestore(flags); diff --git a/nuttx/drivers/usbdev/usbmsc.h b/nuttx/drivers/usbdev/usbmsc.h index 883a49951..da35ae923 100644 --- a/nuttx/drivers/usbdev/usbmsc.h +++ b/nuttx/drivers/usbdev/usbmsc.h @@ -199,9 +199,9 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG # ifdef CONFIG_ARCH_LOWPUTC -# define dbgprintf(format, arg...) lib_lowprintf(format, ##arg) +# define dbgprintf(format, arg...) lowsyslog(format, ##arg) # else -# define dbgprintf(format, arg...) lib_rawprintf(format, ##arg) +# define dbgprintf(format, arg...) syslog(format, ##arg) # endif # else # define dbgprintf(x...) @@ -209,9 +209,9 @@ #else # ifdef CONFIG_DEBUG # ifdef CONFIG_ARCH_LOWPUTC -# define dbgprintf lib_lowprintf +# define dbgprintf lowsyslog # else -# define dbgprintf lib_rawprintf +# define dbgprintf syslog # endif # else # define dbgprintf (void) diff --git a/nuttx/fs/fs_syslog.c b/nuttx/fs/fs_syslog.c index ab6cec51e..779263a3c 100644 --- a/nuttx/fs/fs_syslog.c +++ b/nuttx/fs/fs_syslog.c @@ -357,10 +357,10 @@ int syslog_initialize(void) * * Description: * This is the low-level system logging interface. The debugging/syslogging - * interfaces are lib_rawprintf() and lib_lowprinf(). The difference is - * the lib_rawprintf() writes to fd=1 (stdout) and lib_lowprintf() uses + * interfaces are syslog() and lowsyslog(). The difference is is that + * the syslog() function writes to fd=1 (stdout) whereas lowsyslog() uses * a lower level interface that works from interrupt handlers. This - * function is a a low-level interface used to implement lib_lowprintf(). + * function is a a low-level interface used to implement lowsyslog(). * ****************************************************************************/ diff --git a/nuttx/fs/nxffs/nxffs_dump.c b/nuttx/fs/nxffs/nxffs_dump.c index 6a89aaf1d..9caac4c4b 100644 --- a/nuttx/fs/nxffs/nxffs_dump.c +++ b/nuttx/fs/nxffs/nxffs_dump.c @@ -60,7 +60,7 @@ */ #undef fdbg -#define fdbg lib_rawprintf +#define fdbg syslog /**************************************************************************** * Private Types diff --git a/nuttx/include/debug.h b/nuttx/include/debug.h index aa5efd432..70ae2ee18 100644 --- a/nuttx/include/debug.h +++ b/nuttx/include/debug.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/debug.h * - * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions @@ -104,22 +104,22 @@ #ifdef CONFIG_DEBUG # define dbg(format, arg...) \ - lib_rawprintf(EXTRA_FMT format EXTRA_ARG, ##arg) + syslog(EXTRA_FMT format EXTRA_ARG, ##arg) # ifdef CONFIG_ARCH_LOWPUTC # define lldbg(format, arg...) \ - lib_lowprintf(EXTRA_FMT format EXTRA_ARG, ##arg) + lowsyslog(EXTRA_FMT format EXTRA_ARG, ##arg) # else # define lldbg(x...) # endif # ifdef CONFIG_DEBUG_VERBOSE # define vdbg(format, arg...) \ - lib_rawprintf(EXTRA_FMT format EXTRA_ARG, ##arg) + syslog(EXTRA_FMT format EXTRA_ARG, ##arg) # ifdef CONFIG_ARCH_LOWPUTC # define llvdbg(format, arg...) \ - lib_lowprintf(EXTRA_FMT format EXTRA_ARG, ##arg) + lowsyslog(EXTRA_FMT format EXTRA_ARG, ##arg) # else # define llvdbg(x...) # endif @@ -576,29 +576,16 @@ extern "C" { #endif -/* These low-level debug APIs are provided by the NuttX library. If the - * cross-compiler's pre-processor supports a variable number of macro - * arguments, then the macros below will map all debug statements to one - * or the other of the following. - */ - -int lib_rawprintf(FAR const char *format, ...); - -#ifdef CONFIG_ARCH_LOWPUTC -int lib_lowprintf(FAR const char *format, ...); -#endif - /* Dump a buffer of data */ void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer, unsigned int buflen); -/* Enable or disable debug output */ - -#ifdef CONFIG_DEBUG_ENABLE -void dbg_enable(bool enable); -#endif - -/* If the cross-compiler's pre-processor does not support variable length +/* The system logging interfaces are pnormally accessed via the macros + * provided above. If the cross-compiler's C pre-processor supports a + * variable number of macro arguments, then those macros below will map all + * debug statements to the logging interfaces declared in syslog.h. + * + * If the cross-compiler's pre-processor does not support variable length * arguments, then these additional APIs will be built. */ diff --git a/nuttx/include/nuttx/syslog.h b/nuttx/include/nuttx/syslog.h index 3c340d23a..bb3c8f493 100644 --- a/nuttx/include/nuttx/syslog.h +++ b/nuttx/include/nuttx/syslog.h @@ -116,10 +116,10 @@ EXTERN int syslog_initialize(void); * * Description: * This is the low-level system logging interface. The debugging/syslogging - * interfaces are lib_rawprintf() and lib_lowprinf(). The difference is - * the lib_rawprintf() writes to fd=1 (stdout) and lib_lowprintf() uses + * interfaces are syslog() and lowsyslog(). The difference is that + * the syslog() internface writes to fd=1 (stdout) whereas lowsyslog() uses * a lower level interface that works from interrupt handlers. This - * function is a a low-level interface used to implement lib_lowprintf(). + * function is a a low-level interface used to implement lowsyslog(). * ****************************************************************************/ diff --git a/nuttx/include/syslog.h b/nuttx/include/syslog.h new file mode 100644 index 000000000..cfb2db97b --- /dev/null +++ b/nuttx/include/syslog.h @@ -0,0 +1,94 @@ +/**************************************************************************** + * include/syslog.h + * + * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __INCLUDE_SYSLOG_H +#define __INCLUDE_SYSLOG_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Type Declarations + ****************************************************************************/ + +/**************************************************************************** + * Public Variables + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#if defined(__cplusplus) +extern "C" +{ +#endif + +/* These low-level debug APIs are provided by the NuttX library. These are + * normally accessed via the macros in debug.h. If the cross-compiler's + * C pre-processor supports a variable number of macro arguments, then those + * macros below will map all debug statements to one or the other of the + * following. + */ + +int syslog(FAR const char *format, ...); +int vsyslog(const char *src, va_list ap); + +#ifdef CONFIG_ARCH_LOWPUTC +int lowsyslog(FAR const char *format, ...); +int lowvsyslog(const char *src, va_list ap); +#endif + +/* Enable or disable syslog output */ + +#ifdef CONFIG_SYSLOG_ENABLE +void syslog_enable(bool enable); +#endif + +#if defined(__cplusplus) +} +#endif + +#endif /* __INCLUDE_SYSLOG_H */ diff --git a/nuttx/libc/lib.csv b/nuttx/libc/lib.csv index 171f64e9b..29cdf39a6 100644 --- a/nuttx/libc/lib.csv +++ b/nuttx/libc/lib.csv @@ -16,7 +16,6 @@ "crc32","crc32.h","","uint32_t","FAR const uint8_t *","size_t" "crc32part","crc32.h","","uint32_t","FAR const uint8_t *","size_t","uint32_t" "dbg","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG)","int","const char *","..." -"dbg_enable","debug.h","defined(CONFIG_DEBUG_ENABLE)","void","bool" "dirname","libgen.h","","FAR char","FAR char *" "dq_addafter","queue.h","","void","FAR dq_entry_t *","FAR dq_entry_t *","FAR dq_queue_t *" "dq_addbefore","queue.h","","void","FAR dq_entry_t *","FAR dq_entry_t *","FAR dq_queue_t *" @@ -59,11 +58,10 @@ "inet_pton","arpa/inet.h","","int","int","FAR const char *","FAR void *" "labs","stdlib.h","","long int","long int" "lib_dumpbuffer","debug.h","","void","FAR const char *","FAR const uint8_t *","unsigned int" -"lib_lowprintf","debug.h","","int","FAR const char *","..." -"lib_rawprintf","debug.h","","int","FAR const char *","..." "llabs","stdlib.h","defined(CONFIG_HAVE_LONG_LONG)","long long int","long long int" "lldbg","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG) && defined(CONFIG_ARCH_LOWPUTC)","int","const char *","..." "llvdbg","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_VERBOSE) && defined(CONFIG_ARCH_LOWPUTC)","int","const char *","..." +"lowsyslog","syslog.h","","int","FAR const char *","..." "match","","","int","const char *","const char *" "memccpy","string.h","","FAR void","FAR void *","FAR const void *","int c","size_t" "memchr","string.h","","FAR void","FAR const void *","int c","size_t" @@ -154,6 +152,8 @@ "strtoll","stdlib.h","defined(CONFIG_HAVE_LONG_LONG)","long long","const char *nptr","char **endptr","int base" "strtoul","stdlib.h","","unsigned long","const char *","char **","int" "strtoull","stdlib.h","defined(CONFIG_HAVE_LONG_LONG)","unsigned long long","const char *","char **","int" +"syslog","syslog.h","","int","FAR const char *","..." +"syslog_enable","syslog.h","defined(CONFIG_SYSLOG_ENABLE)","void","bool" "tcflush","termios.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SERIAL_TERMIOS)","int","int","int" "tcgetattr","termios.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SERIAL_TERMIOS)","int","int","FAR struct termios *" "tcsetattr","termios.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SERIAL_TERMIOS)","int","int","int","FAR const struct termios *" diff --git a/nuttx/libc/lib_internal.h b/nuttx/libc/lib_internal.h index c09c751d4..17adff417 100644 --- a/nuttx/libc/lib_internal.h +++ b/nuttx/libc/lib_internal.h @@ -106,8 +106,8 @@ /* Debug output is initially disabled */ -#ifdef CONFIG_DEBUG_ENABLE -extern bool g_dbgenable; +#ifdef CONFIG_SYSLOG_ENABLE +extern bool g_syslogenable; #endif /**************************************************************************** @@ -137,14 +137,6 @@ int lib_sprintf(FAR struct lib_outstream_s *obj, int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const char *src, va_list ap); -/* Defined lib_rawprintf.c */ - -int lib_rawvprintf(const char *src, va_list ap); - -/* Defined lib_lowprintf.c */ - -int lib_lowvprintf(const char *src, va_list ap); - /* Defined in lib_dtoa.c */ #ifdef CONFIG_LIBC_FLOATINGPOINT diff --git a/nuttx/libc/misc/lib_dbg.c b/nuttx/libc/misc/lib_dbg.c index 5605ff828..921a4e24d 100644 --- a/nuttx/libc/misc/lib_dbg.c +++ b/nuttx/libc/misc/lib_dbg.c @@ -50,8 +50,8 @@ /* Debug output is initially disabled */ -#ifdef CONFIG_DEBUG_ENABLE -bool g_dbgenable; +#ifdef CONFIG_SYSLOG_ENABLE +bool g_syslogenable; #endif /**************************************************************************** @@ -59,17 +59,17 @@ bool g_dbgenable; ****************************************************************************/ /**************************************************************************** - * Name: dbg_enable + * Name: syslog_enable * * Description: * Enable or disable debug output. * ****************************************************************************/ -#ifdef CONFIG_DEBUG_ENABLE -void dbg_enable(bool enable) +#ifdef CONFIG_SYSLOG_ENABLE +void syslog_enable(bool enable) { - g_dbgenable = enable; + g_syslogenable = enable; } #endif @@ -89,13 +89,13 @@ int dbg(const char *format, ...) va_list ap; int ret; -#ifdef CONFIG_DEBUG_ENABLE +#ifdef CONFIG_SYSLOG_ENABLE ret = 0; - if (g_dbgenable) + if (g_syslogenable) #endif { va_start(ap, format); - ret = lib_rawvprintf(format, ap); + ret = vsyslog(format, ap); va_end(ap); } @@ -108,13 +108,13 @@ int lldbg(const char *format, ...) va_list ap; int ret; -#ifdef CONFIG_DEBUG_ENABLE +#ifdef CONFIG_SYSLOG_ENABLE ret = 0; - if (g_dbgenable) + if (g_syslogenable) #endif { va_start(ap, format); - ret = lib_lowvprintf(format, ap); + ret = lowvsyslog(format, ap); va_end(ap); } @@ -128,13 +128,13 @@ int vdbg(const char *format, ...) va_list ap; int ret; -#ifdef CONFIG_DEBUG_ENABLE +#ifdef CONFIG_SYSLOG_ENABLE ret = 0; - if (g_dbgenable) + if (g_syslogenable) #endif { va_start(ap, format); - ret = lib_rawvprintf(format, ap); + ret = vsyslog(format, ap); va_end(ap); } @@ -147,13 +147,13 @@ int llvdbg(const char *format, ...) va_list ap; int ret; -#ifdef CONFIG_DEBUG_ENABLE +#ifdef CONFIG_SYSLOG_ENABLE ret = 0; - if (g_dbgenable) + if (g_syslogenable) #endif { va_start(ap, format); - ret = lib_lowvprintf(format, ap); + ret = lowvsyslog(format, ap); va_end(ap); } diff --git a/nuttx/libc/misc/lib_dumpbuffer.c b/nuttx/libc/misc/lib_dumpbuffer.c index 52158b220..5194560fd 100644 --- a/nuttx/libc/misc/lib_dumpbuffer.c +++ b/nuttx/libc/misc/lib_dumpbuffer.c @@ -51,15 +51,15 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_ARCH_LOWPUTC -# define message(format, arg...) lib_lowprintf(format, ##arg) +# define message(format, arg...) lowsyslog(format, ##arg) # else -# define message(format, arg...) lib_rawprintf(format, ##arg) +# define message(format, arg...) syslog(format, ##arg) # endif #else # ifdef CONFIG_ARCH_LOWPUTC -# define message lib_lowprintf +# define message lowsyslog # else -# define message lib_rawprintf +# define message syslog # endif #endif diff --git a/nuttx/libc/stdio/Make.defs b/nuttx/libc/stdio/Make.defs index e18ab0220..ffc9b1a75 100644 --- a/nuttx/libc/stdio/Make.defs +++ b/nuttx/libc/stdio/Make.defs @@ -37,7 +37,7 @@ # This first group of C files do not depend on having file descriptors or # C streams. -CSRCS += lib_fileno.c lib_printf.c lib_rawprintf.c lib_lowprintf.c \ +CSRCS += lib_fileno.c lib_printf.c lib_syslog.c lib_lowsyslog.c\ lib_sprintf.c lib_asprintf.c lib_snprintf.c lib_libsprintf.c \ lib_vsprintf.c lib_avsprintf.c lib_vsnprintf.c lib_libvsprintf.c \ lib_meminstream.c lib_memoutstream.c lib_lowinstream.c \ diff --git a/nuttx/libc/stdio/lib_lowprintf.c b/nuttx/libc/stdio/lib_lowprintf.c deleted file mode 100644 index 667fad7be..000000000 --- a/nuttx/libc/stdio/lib_lowprintf.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * libc/stdio/lib_lowprintf.c - * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include "lib_internal.h" - -/* This interface can only be used from within the kernel */ - -#if !defined(CONFIG_NUTTX_KERNEL) || defined(__KERNEL__) - -/**************************************************************************** - * Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Global Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Global Constant Data - ****************************************************************************/ - -/**************************************************************************** - * Global Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Constant Data - ****************************************************************************/ - -/**************************************************************************** - * Private Variables - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lib_lowvprintf - ****************************************************************************/ - -#if defined(CONFIG_ARCH_LOWPUTC) || defined(CONFIG_SYSLOG) - -int lib_lowvprintf(const char *fmt, va_list ap) -{ - struct lib_outstream_s stream; - - /* Wrap the stdout in a stream object and let lib_vsprintf do the work. */ - -#ifdef CONFIG_SYSLOG - lib_syslogstream((FAR struct lib_outstream_s *)&stream); -#else - lib_lowoutstream((FAR struct lib_outstream_s *)&stream); -#endif - return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap); -} - -/**************************************************************************** - * Name: lib_lowprintf - ****************************************************************************/ - -int lib_lowprintf(const char *fmt, ...) -{ - va_list ap; - int ret; - -#ifdef CONFIG_DEBUG_ENABLE - ret = 0; - if (g_dbgenable) -#endif - { - va_start(ap, fmt); - ret = lib_lowvprintf(fmt, ap); - va_end(ap); - } - - return ret; -} - -#endif /* CONFIG_ARCH_LOWPUTC || CONFIG_SYSLOG */ -#endif /* __KERNEL__ */ diff --git a/nuttx/libc/stdio/lib_lowsyslog.c b/nuttx/libc/stdio/lib_lowsyslog.c new file mode 100644 index 000000000..bfe6a2cce --- /dev/null +++ b/nuttx/libc/stdio/lib_lowsyslog.c @@ -0,0 +1,130 @@ +/**************************************************************************** + * libc/stdio/lib_lowsyslog.c + * + * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "lib_internal.h" + +/* This interface can only be used from within the kernel */ + +#if !defined(CONFIG_NUTTX_KERNEL) || defined(__KERNEL__) + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Type Declarations + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Global Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Global Constant Data + ****************************************************************************/ + +/**************************************************************************** + * Global Variables + ****************************************************************************/ + +/**************************************************************************** + * Private Constant Data + ****************************************************************************/ + +/**************************************************************************** + * Private Variables + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: lowvsyslog + ****************************************************************************/ + +#if defined(CONFIG_ARCH_LOWPUTC) || defined(CONFIG_SYSLOG) + +int lowvsyslog(const char *fmt, va_list ap) +{ + struct lib_outstream_s stream; + + /* Wrap the stdout in a stream object and let lib_vsprintf do the work. */ + +#ifdef CONFIG_SYSLOG + lib_syslogstream((FAR struct lib_outstream_s *)&stream); +#else + lib_lowoutstream((FAR struct lib_outstream_s *)&stream); +#endif + return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap); +} + +/**************************************************************************** + * Name: lowsyslog + ****************************************************************************/ + +int lowsyslog(const char *fmt, ...) +{ + va_list ap; + int ret; + +#ifdef CONFIG_SYSLOG_ENABLE + ret = 0; + if (g_syslogenable) +#endif + { + va_start(ap, fmt); + ret = lowvsyslog(fmt, ap); + va_end(ap); + } + + return ret; +} + +#endif /* CONFIG_ARCH_LOWPUTC || CONFIG_SYSLOG */ +#endif /* __KERNEL__ */ diff --git a/nuttx/libc/stdio/lib_printf.c b/nuttx/libc/stdio/lib_printf.c index 0e90c7ca5..b035aa14f 100644 --- a/nuttx/libc/stdio/lib_printf.c +++ b/nuttx/libc/stdio/lib_printf.c @@ -93,9 +93,9 @@ int printf(const char *fmt, ...) #if CONFIG_NFILE_STREAMS > 0 ret = vfprintf(stdout, fmt, ap); #elif CONFIG_NFILE_DESCRIPTORS > 0 - ret = lib_rawvprintf(fmt, ap); + ret = vsyslog(fmt, ap); #elif defined(CONFIG_ARCH_LOWPUTC) - ret = lib_lowvprintf(fmt, ap); + ret = lowvsyslog(fmt, ap); #else # ifdef CONFIG_CPP_HAVE_WARNING # warning "printf has no data sink" diff --git a/nuttx/libc/stdio/lib_rawprintf.c b/nuttx/libc/stdio/lib_rawprintf.c deleted file mode 100644 index d8deba12d..000000000 --- a/nuttx/libc/stdio/lib_rawprintf.c +++ /dev/null @@ -1,154 +0,0 @@ -/**************************************************************************** - * libc/stdio/lib_rawprintf.c - * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include "lib_internal.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Some output destinations are only available from within the kernel */ - -#if defined(CONFIG_NUTTX_KERNEL) && !defined(__KERNEL__) -# undef CONFIG_SYSLOG -# undef CONFIG_ARCH_LOWPUTC -#endif - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Global Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Global Constant Data - ****************************************************************************/ - -/**************************************************************************** - * Global Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Constant Data - ****************************************************************************/ - -/**************************************************************************** - * Private Variables - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lib_rawvprintf - ****************************************************************************/ - -int lib_rawvprintf(const char *fmt, va_list ap) -{ -#if defined(CONFIG_SYSLOG) - - struct lib_outstream_s stream; - - /* Wrap the low-level output in a stream object and let lib_vsprintf - * do the work. - */ - - lib_syslogstream((FAR struct lib_outstream_s *)&stream); - return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap); - -#elif CONFIG_NFILE_DESCRIPTORS > 0 - - struct lib_rawoutstream_s rawoutstream; - - /* Wrap the stdout in a stream object and let lib_vsprintf - * do the work. - */ - - lib_rawoutstream(&rawoutstream, 1); - return lib_vsprintf(&rawoutstream.public, fmt, ap); - -#elif defined(CONFIG_ARCH_LOWPUTC) - - struct lib_outstream_s stream; - - /* Wrap the low-level output in a stream object and let lib_vsprintf - * do the work. - */ - - lib_lowoutstream((FAR struct lib_outstream_s *)&stream); - return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap); - -#else - return 0; -#endif -} - -/**************************************************************************** - * Name: lib_rawprintf - ****************************************************************************/ - -int lib_rawprintf(const char *fmt, ...) -{ - va_list ap; - int ret; - -#ifdef CONFIG_DEBUG_ENABLE - ret = 0; - if (g_dbgenable) -#endif - { - va_start(ap, fmt); - ret = lib_rawvprintf(fmt, ap); - va_end(ap); - } - - return ret; -} diff --git a/nuttx/libc/stdio/lib_syslog.c b/nuttx/libc/stdio/lib_syslog.c new file mode 100644 index 000000000..bbf7860d2 --- /dev/null +++ b/nuttx/libc/stdio/lib_syslog.c @@ -0,0 +1,154 @@ +/**************************************************************************** + * libc/stdio/lib_syslog.c + * + * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "lib_internal.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Some output destinations are only available from within the kernel */ + +#if defined(CONFIG_NUTTX_KERNEL) && !defined(__KERNEL__) +# undef CONFIG_SYSLOG +# undef CONFIG_ARCH_LOWPUTC +#endif + +/**************************************************************************** + * Private Type Declarations + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Global Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Global Constant Data + ****************************************************************************/ + +/**************************************************************************** + * Global Variables + ****************************************************************************/ + +/**************************************************************************** + * Private Constant Data + ****************************************************************************/ + +/**************************************************************************** + * Private Variables + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: vsyslog + ****************************************************************************/ + +int vsyslog(const char *fmt, va_list ap) +{ +#if defined(CONFIG_SYSLOG) + + struct lib_outstream_s stream; + + /* Wrap the low-level output in a stream object and let lib_vsprintf + * do the work. + */ + + lib_syslogstream((FAR struct lib_outstream_s *)&stream); + return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap); + +#elif CONFIG_NFILE_DESCRIPTORS > 0 + + struct lib_rawoutstream_s rawoutstream; + + /* Wrap the stdout in a stream object and let lib_vsprintf + * do the work. + */ + + lib_rawoutstream(&rawoutstream, 1); + return lib_vsprintf(&rawoutstream.public, fmt, ap); + +#elif defined(CONFIG_ARCH_LOWPUTC) + + struct lib_outstream_s stream; + + /* Wrap the low-level output in a stream object and let lib_vsprintf + * do the work. + */ + + lib_lowoutstream((FAR struct lib_outstream_s *)&stream); + return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap); + +#else + return 0; +#endif +} + +/**************************************************************************** + * Name: syslog + ****************************************************************************/ + +int syslog(const char *fmt, ...) +{ + va_list ap; + int ret; + +#ifdef CONFIG_SYSLOG_ENABLE + ret = 0; + if (g_syslogenable) +#endif + { + va_start(ap, fmt); + ret = vsyslog(fmt, ap); + va_end(ap); + } + + return ret; +} -- cgit v1.2.3