diff options
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/os_start.c | 6 | ||||
-rw-r--r-- | nuttx/sched/task_create.c | 41 |
2 files changed, 27 insertions, 20 deletions
diff --git a/nuttx/sched/os_start.c b/nuttx/sched/os_start.c index b4bae75c5..1b249a5b9 100644 --- a/nuttx/sched/os_start.c +++ b/nuttx/sched/os_start.c @@ -192,7 +192,7 @@ void os_start(void) int init_taskid; int i; - lldbg("os_start:\n"); + lldbg("%s: Entry\n", __FUNCTION__); /* Initialize all task lists */ @@ -349,7 +349,7 @@ void os_start(void) * started by spawning the user init thread of execution. */ - dbg("os_start: Starting init thread\n"); + dbg("%s: Starting init thread\n", __FUNCTION__); init_taskid = task_create("init", SCHED_PRIORITY_DEFAULT, CONFIG_PROC_STACK_SIZE, (main_t)user_start, 0, 0, 0, 0); @@ -357,7 +357,7 @@ void os_start(void) /* When control is return to this point, the system is idle. */ - dbg("os_start: Beginning Idle Loop\n"); + dbg("%s: Beginning Idle Loop\n", __FUNCTION__); for (;;) { /* Check if there is anything in the delayed deallocation list. */ diff --git a/nuttx/sched/task_create.c b/nuttx/sched/task_create.c index ecfd68056..dd7da112e 100644 --- a/nuttx/sched/task_create.c +++ b/nuttx/sched/task_create.c @@ -41,6 +41,7 @@ #include <sched.h> #include <string.h> #include <errno.h> +#include <debug.h> #include <nuttx/arch.h> #include <nuttx/os_external.h> #include "os_internal.h" @@ -225,6 +226,8 @@ STATUS _task_init(_TCB *tcb, char *name, int priority, { STATUS ret; + vdbg("%s: Entry\n", __FUNCTION__); + /* Assign a unique task ID to the task. */ ret = task_assignpid(tcb); @@ -376,33 +379,35 @@ STATUS task_init(_TCB *tcb, char *name, int priority, STATUS task_activate(_TCB *tcb) { #ifdef CONFIG_SCHED_INSTRUMENTATION - uint32 savedState; + uint32 flags; #endif + vdbg("%s: Entry\n", __FUNCTION__); + #ifdef CONFIG_SCHED_INSTRUMENTATION - savedState = irqsave(); + flags = irqsave(); - /* Check if this is really a re-start */ + /* Check if this is really a re-start */ - if (tcb->task_state != TSTATE_TASK_INACTIVE) - { - /* Inform the instrumentation layer that the task - * has stopped - */ + if (tcb->task_state != TSTATE_TASK_INACTIVE) + { + /* Inform the instrumentation layer that the task + * has stopped + */ - sched_note_stop(tcb); - } + sched_note_stop(tcb); + } - /* Inform the instrumentation layer that the task - * has started - */ + /* Inform the instrumentation layer that the task + * has started + */ - sched_note_start(tcb); - irqrestore(savedState); + sched_note_start(tcb); + irqrestore(flags); #endif - up_unblock_task(tcb); - return OK; + up_unblock_task(tcb); + return OK; } /************************************************************ @@ -444,6 +449,8 @@ int task_create(char *name, int priority, STATUS status; pid_t pid; + vdbg("%s: Entry\n", __FUNCTION__); + /* Allocate a TCB for the new task. */ tcb = (_TCB*)kzmalloc(sizeof(_TCB)); |