summaryrefslogtreecommitdiff
path: root/nuttx/sched/os_start.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-12 21:53:18 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-12 21:53:18 +0000
commit177f3484f71b2d03fc5b809a024ff32d137494ba (patch)
treec1c81390b64b5e303bad0ea2638d979d9c2e8607 /nuttx/sched/os_start.c
parenteb1679e6fac9aa613baf90f285ef3e5e5413ea18 (diff)
downloadnuttx-177f3484f71b2d03fc5b809a024ff32d137494ba.tar.gz
nuttx-177f3484f71b2d03fc5b809a024ff32d137494ba.tar.bz2
nuttx-177f3484f71b2d03fc5b809a024ff32d137494ba.zip
Fix some ARMv7-M syscall logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5736 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/os_start.c')
-rw-r--r--nuttx/sched/os_start.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/nuttx/sched/os_start.c b/nuttx/sched/os_start.c
index b7c8bb15c..6894ddc1b 100644
--- a/nuttx/sched/os_start.c
+++ b/nuttx/sched/os_start.c
@@ -237,6 +237,7 @@ void os_start(void)
slldbg("Entry\n");
+ /* Initialize RTOS Data ***************************************************/
/* Initialize all task lists */
dq_init(&g_readytorun);
@@ -272,6 +273,7 @@ void os_start(void)
g_pidhash[ PIDHASH(0)].tcb = &g_idletcb.cmn;
g_pidhash[ PIDHASH(0)].pid = 0;
+ /* Initialize the IDLE task TCB *******************************************/
/* Initialize a TCB for this thread of execution. NOTE: The default
* value for most components of the g_idletcb are zero. The entire
* structure is set to zero. Then only the (potentially) non-zero
@@ -298,6 +300,7 @@ void os_start(void)
up_initial_state(&g_idletcb.cmn);
+ /* Initialize RTOS facilities *********************************************/
/* Initialize the semaphore facility(if in link). This has to be done
* very early because many subsystems depend upon fully functional
* semaphores.
@@ -344,12 +347,6 @@ void os_start(void)
}
#endif
- /* Allocate the IDLE group and suppress child status. */
-
-#ifdef HAVE_TASK_GROUP
- (void)group_allocate(&g_idletcb);
-#endif
-
/* Initialize the interrupt handling subsystem (if included) */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
@@ -462,6 +459,13 @@ void os_start(void)
lib_initialize();
}
+ /* IDLE Group Initialization **********************************************/
+ /* Allocate the IDLE group and suppress child status. */
+
+#ifdef HAVE_TASK_GROUP
+ (void)group_allocate(&g_idletcb);
+#endif
+
/* Create stdout, stderr, stdin on the IDLE task. These will be
* inherited by all of the threads created by the IDLE task.
*/
@@ -477,10 +481,12 @@ void os_start(void)
g_idletcb.cmn.group->tg_flags = GROUP_FLAG_NOCLDWAIT;
#endif
+ /* Bring Up the System ****************************************************/
/* Create initial tasks and bring-up the system */
(void)os_bringup();
+ /* The IDLE Loop **********************************************************/
/* When control is return to this point, the system is idle. */
sdbg("Beginning Idle Loop\n");