summaryrefslogtreecommitdiff
path: root/nuttx/sched/os_start.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-21 23:37:11 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-21 23:37:11 +0000
commit7406abbc5ac56892524846c8a19d2aabfc34eef4 (patch)
tree407cb38c04306722a9e3fb6136fa4e3058e22e5c /nuttx/sched/os_start.c
parent7fd81076443ca5685f38f02ecd926e8bda368c9b (diff)
downloadnuttx-7406abbc5ac56892524846c8a19d2aabfc34eef4.tar.gz
nuttx-7406abbc5ac56892524846c8a19d2aabfc34eef4.tar.bz2
nuttx-7406abbc5ac56892524846c8a19d2aabfc34eef4.zip
Corrections needed after further test of stack-based task arguments
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5771 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/os_start.c')
-rw-r--r--nuttx/sched/os_start.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/nuttx/sched/os_start.c b/nuttx/sched/os_start.c
index fbb3b7743..100c736b2 100644
--- a/nuttx/sched/os_start.c
+++ b/nuttx/sched/os_start.c
@@ -286,12 +286,27 @@ void os_start(void)
g_idletcb.cmn.task_state = TSTATE_TASK_RUNNING;
g_idletcb.cmn.entry.main = (main_t)os_start;
+ /* Set the IDLE task name */
+
#if CONFIG_TASK_NAME_SIZE > 0
strncpy(g_idletcb.cmn.name, g_idlename, CONFIG_TASK_NAME_SIZE-1);
+#endif /* CONFIG_TASK_NAME_SIZE */
+
+ /* Configure the task name in the argument list. The IDLE task does
+ * not really have an argument list, but this name is still useful
+ * for things like the NSH PS command.
+ *
+ * In the kernel mode build, the arguments are saved on the task's stack
+ * and there is no support that yet.
+ */
+
+#if defined(CONFIG_CUSTOM_STACK) || !defined(CONFIG_NUTTX_KERNEL)
+#if CONFIG_TASK_NAME_SIZE > 0
g_idletcb.argv[0] = g_idletcb.cmn.name;
#else
g_idletcb.argv[0] = (char*)g_idlename;
#endif /* CONFIG_TASK_NAME_SIZE */
+#endif /* CONFIG_CUSTOM_STACK || !CONFIG_NUTTX_KERNEL */
/* Then add the idle task's TCB to the head of the ready to run list */