diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-02-19 22:51:18 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-02-19 22:51:18 +0000 |
commit | 0924f81f32294abaae83d0fd9f4ff7a6257065ac (patch) | |
tree | bc6c6bc6997a73744ef28aa82f8e5738d1173e3d /nuttx/sched/task_create.c | |
parent | 71989f8323da84187bb4b06ef9d4435d037d7a27 (diff) | |
download | px4-nuttx-0924f81f32294abaae83d0fd9f4ff7a6257065ac.tar.gz px4-nuttx-0924f81f32294abaae83d0fd9f4ff7a6257065ac.tar.bz2 px4-nuttx-0924f81f32294abaae83d0fd9f4ff7a6257065ac.zip |
Fix ARM IRQ handling problem + ARM context restore problem
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@9 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/task_create.c')
-rw-r--r-- | nuttx/sched/task_create.c | 41 |
1 files changed, 24 insertions, 17 deletions
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)); |