From 1ea219af1ed405eba0c1de0cb35436f347d3d2ef Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 1 Sep 2014 16:49:42 -0600 Subject: Fix error in initialize of IDLE TCB due to last change. The argument list is no long in the TCB, but in the stack. But not for the IDLE task. It needs its own mini-argv[] list so that it looks more like other threads. --- nuttx/sched/init/os_start.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nuttx/sched/init/os_start.c b/nuttx/sched/init/os_start.c index cf83b93b9..7879eaeec 100644 --- a/nuttx/sched/init/os_start.c +++ b/nuttx/sched/init/os_start.c @@ -218,6 +218,10 @@ static FAR struct task_tcb_s g_idletcb; static FAR const char g_idlename[] = "Idle Task"; +/* This the IDLE idle threads argument list. */ + +static char *g_idleargv[2]; + /**************************************************************************** * Private Function Prototypes ****************************************************************************/ @@ -311,13 +315,13 @@ void os_start(void) * and there is no support that yet. */ -#if !defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL) #if CONFIG_TASK_NAME_SIZE > 0 - g_idletcb.argv[0] = g_idletcb.cmn.name; + g_idleargv[0] = g_idletcb.cmn.name; #else - g_idletcb.argv[0] = (char*)g_idlename; + g_idleargv[0] = (FAR char *)g_idlename; #endif /* CONFIG_TASK_NAME_SIZE */ -#endif /* !CONFIG_BUILD_PROTECTED && !CONFIG_BUILD_KERNEL */ + g_idleargv[1] = NULL; + g_idletcb.argv = &g_idleargv; /* Then add the idle task's TCB to the head of the ready to run list */ -- cgit v1.2.3