aboutsummaryrefslogtreecommitdiff
path: root/nuttx/sched
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-07 21:41:20 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-07 21:41:20 +0000
commit66cdd288ab6a4d19c67300a73a26e9ee5a958187 (patch)
treeb5cbba4326a2edbbb9b1723492e38a408fcb3241 /nuttx/sched
parenta5f001189e1a056be275e1d736e38893f96cd395 (diff)
downloadpx4-firmware-66cdd288ab6a4d19c67300a73a26e9ee5a958187.tar.gz
px4-firmware-66cdd288ab6a4d19c67300a73a26e9ee5a958187.tar.bz2
px4-firmware-66cdd288ab6a4d19c67300a73a26e9ee5a958187.zip
Add ostest vfork test (does not work yet)
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5488 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched')
-rw-r--r--nuttx/sched/sched_addprioritized.c2
-rw-r--r--nuttx/sched/sched_addreadytorun.c8
-rw-r--r--nuttx/sched/task_vfork.c9
3 files changed, 13 insertions, 6 deletions
diff --git a/nuttx/sched/sched_addprioritized.c b/nuttx/sched/sched_addprioritized.c
index 8f19a4731..20178fb9c 100644
--- a/nuttx/sched/sched_addprioritized.c
+++ b/nuttx/sched/sched_addprioritized.c
@@ -114,7 +114,7 @@ bool sched_addprioritized(FAR _TCB *tcb, DSEG dq_queue_t *list)
(next && sched_priority <= next->sched_priority);
next = next->flink);
- /* Add the tcb to the spot found in the list. Check if the tcb
+ /* Add the tcb to the spot found in the list. Check if the tcb
* goes at the end of the list. NOTE: This could only happen if list
* is the g_pendingtasks list!
*/
diff --git a/nuttx/sched/sched_addreadytorun.c b/nuttx/sched/sched_addreadytorun.c
index f6117b6ff..1e1829343 100644
--- a/nuttx/sched/sched_addreadytorun.c
+++ b/nuttx/sched/sched_addreadytorun.c
@@ -84,8 +84,8 @@
* btcb - Points to the blocked TCB that is ready-to-run
*
* Return Value:
- * true if the currently active task (the head of the
- * g_readytorun list) has changed.
+ * true if the currently active task (the head of the g_readytorun list)
+ * has changed.
*
* Assumptions:
* - The caller has established a critical section before
@@ -104,7 +104,7 @@ bool sched_addreadytorun(FAR _TCB *btcb)
bool ret;
/* Check if pre-emption is disabled for the current running task and if
- * the new ready-to-run task would cause the current running task to be
+ * the new ready-to-run task would cause the current running task to be
* preempted.
*/
@@ -123,7 +123,7 @@ bool sched_addreadytorun(FAR _TCB *btcb)
else if (sched_addprioritized(btcb, (FAR dq_queue_t*)&g_readytorun))
{
- /* Information the instrumentation logic that we are switching tasks */
+ /* Inform the instrumentation logic that we are switching tasks */
sched_note_switch(rtcb, btcb);
diff --git a/nuttx/sched/task_vfork.c b/nuttx/sched/task_vfork.c
index 93fcb46da..64f6f0636 100644
--- a/nuttx/sched/task_vfork.c
+++ b/nuttx/sched/task_vfork.c
@@ -43,6 +43,7 @@
#include <assert.h>
#include <queue.h>
#include <errno.h>
+#include <debug.h>
#include <nuttx/sched.h>
@@ -151,12 +152,14 @@ FAR _TCB *task_vforksetup(start_t retaddr)
/* Initialize the task control block. This calls up_initial_state() */
+ svdbg("Child priority=%d start=%p\n", priority, retaddr);
ret = task_schedsetup(child, priority, retaddr, parent->entry.main);
if (ret != OK)
{
goto errout_with_tcb;
}
+ svdbg("parent=%p, returning child=%p\n", parent, child);
return child;
errout_with_tcb:
@@ -210,10 +213,14 @@ errout_with_tcb:
pid_t task_vforkstart(FAR _TCB *child)
{
+#if CONFIG_TASK_NAME_SIZE > 0
+ _TCB *parent = (FAR _TCB *)g_readytorun.head;
+#endif
FAR const char *name;
pid_t pid;
int ret;
+ svdbg("Starting Child TCB=%p, parent=%p\n", child, g_readytorun.head);
DEBUGASSERT(child);
/* Setup to pass parameters to the new task */
@@ -221,7 +228,7 @@ pid_t task_vforkstart(FAR _TCB *child)
#if CONFIG_TASK_NAME_SIZE > 0
name = parent->name;
#else
- name = "<noname>";
+ name = NULL;
#endif
(void)task_argsetup(child, name, (const char **)NULL);