summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-06-06 15:28:41 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-06-14 16:26:07 +0200
commit1ccb64e18f1e4c1f51c12b9dc31a881e2829b2b6 (patch)
treecc5940c391f4e6fcdd63ec31fd129126d84b2329 /cpukit/score/src
parentscore: Simplify _Thread_Create_idle() (diff)
downloadrtems-1ccb64e18f1e4c1f51c12b9dc31a881e2829b2b6.tar.bz2
scheduler: Add start idle thread operation
Add and use _Scheduler_Start_idle().
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/schedulerdefaultstartidle.c22
-rw-r--r--cpukit/score/src/threadcreateidle.c3
-rw-r--r--cpukit/score/src/threadstart.c10
3 files changed, 32 insertions, 3 deletions
diff --git a/cpukit/score/src/schedulerdefaultstartidle.c b/cpukit/score/src/schedulerdefaultstartidle.c
new file mode 100644
index 0000000000..043fe68b52
--- /dev/null
+++ b/cpukit/score/src/schedulerdefaultstartidle.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2013 embedded brains GmbH
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
+#include <rtems/score/scheduler.h>
+
+void _Scheduler_default_Start_idle(
+ Thread_Control *thread,
+ Per_CPU_Control *processor
+)
+{
+ (void) processor;
+ _Scheduler_Unblock( thread );
+}
diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c
index 7ad24cfdb3..d075510135 100644
--- a/cpukit/score/src/threadcreateidle.c
+++ b/cpukit/score/src/threadcreateidle.c
@@ -73,7 +73,8 @@ static void _Thread_Create_idle_for_cpu( Per_CPU_Control *per_cpu )
THREAD_START_NUMERIC,
rtems_configuration_get_idle_task(),
NULL,
- 0
+ 0,
+ per_cpu
);
}
diff --git a/cpukit/score/src/threadstart.c b/cpukit/score/src/threadstart.c
index d9ce62a091..4e24f39cfc 100644
--- a/cpukit/score/src/threadstart.c
+++ b/cpukit/score/src/threadstart.c
@@ -38,7 +38,8 @@ bool _Thread_Start(
Thread_Start_types the_prototype,
void *entry_point,
void *pointer_argument,
- Thread_Entry_numeric_type numeric_argument
+ Thread_Entry_numeric_type numeric_argument,
+ Per_CPU_Control *processor
)
{
if ( _States_Is_dormant( the_thread->current_state ) ) {
@@ -51,7 +52,12 @@ bool _Thread_Start(
_Thread_Load_environment( the_thread );
- _Thread_Ready( the_thread );
+ if ( processor == NULL ) {
+ _Thread_Ready( the_thread );
+ } else {
+ the_thread->current_state = STATES_READY;
+ _Scheduler_Start_idle( the_thread, processor );
+ }
_User_extensions_Thread_start( the_thread );