diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-14 10:11:05 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-14 11:57:37 +0200 |
commit | 3eda7e54930df8b3f7601ba60ff6a049b3aa45c3 (patch) | |
tree | bce0ce525095770094e2ff28aa1873e026acf3c5 /cpukit | |
parent | posix: Add pthread_setschedprio() (diff) | |
download | rtems-3eda7e54930df8b3f7601ba60ff6a049b3aa45c3.tar.bz2 |
score: _Thread_Create_idle_for_CPU()
Use priority maximum of scheduler instance.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/threadcreateidle.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c index 560804082b..0df53ecfab 100644 --- a/cpukit/score/src/threadcreateidle.c +++ b/cpukit/score/src/threadcreateidle.c @@ -25,12 +25,20 @@ #include <rtems/score/userextimpl.h> #include <rtems/config.h> -static void _Thread_Create_idle_for_cpu( Per_CPU_Control *cpu ) +static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu ) { Objects_Name name; Thread_Control *idle; const Scheduler_Control *scheduler; + scheduler = _Scheduler_Get_by_CPU( cpu ); + +#if defined(RTEMS_SMP) + if (scheduler == NULL) { + return; + } +#endif + name.name_u32 = _Objects_Build_name( 'I', 'D', 'L', 'E' ); /* @@ -43,11 +51,11 @@ static void _Thread_Create_idle_for_cpu( Per_CPU_Control *cpu ) _Thread_Initialize( &_Thread_Internal_information, idle, - _Scheduler_Get_by_CPU( cpu ), + scheduler, NULL, /* allocate the stack */ _Stack_Ensure_minimum( rtems_configuration_get_idle_task_stack_size() ), CPU_IDLE_TASK_IS_FP, - PRIORITY_MAXIMUM, + scheduler->maximum_priority, true, /* preemptable */ THREAD_CPU_BUDGET_ALGORITHM_NONE, NULL, /* no budget algorithm callout */ @@ -67,14 +75,6 @@ static void _Thread_Create_idle_for_cpu( Per_CPU_Control *cpu ) _Thread_Load_environment( idle ); - scheduler = _Scheduler_Get_by_CPU( cpu ); - -#if defined(RTEMS_SMP) - if (scheduler == NULL) { - return; - } -#endif - idle->current_state = STATES_READY; _Scheduler_Start_idle( scheduler, idle, cpu ); _User_extensions_Thread_start( idle ); @@ -91,7 +91,7 @@ void _Thread_Create_idle( void ) Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index ); if ( _Per_CPU_Is_processor_online( cpu ) ) { - _Thread_Create_idle_for_cpu( cpu ); + _Thread_Create_idle_for_CPU( cpu ); } } } |