diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-03 15:03:35 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-04 11:01:18 +0200 |
commit | 24934e36e2513f972510d7c746103be1f766dc6a (patch) | |
tree | 66e3c8840cec6c1262f142e25ec545926140dbf9 /cpukit/score/src/threadrestart.c | |
parent | score: Add and use Scheduler_simple_Control (diff) | |
download | rtems-24934e36e2513f972510d7c746103be1f766dc6a.tar.bz2 |
score: Add scheduler control to scheduler ops
Scheduler operations must be free of a global scheduler context to
enable partitioned/clustered scheduling.
Diffstat (limited to 'cpukit/score/src/threadrestart.c')
-rw-r--r-- | cpukit/score/src/threadrestart.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c index 02371acfdb..fcf9d6ce3e 100644 --- a/cpukit/score/src/threadrestart.c +++ b/cpukit/score/src/threadrestart.c @@ -71,7 +71,7 @@ static void _Thread_Free( Thread_Control *the_thread ) /* * Free the per-thread scheduling information. */ - _Scheduler_Free( the_thread ); + _Scheduler_Free( _Scheduler_Get( the_thread ), the_thread ); /* * The thread might have been FP. So deal with that. @@ -216,8 +216,9 @@ void _Thread_Life_action_handler( } static void _Thread_Start_life_change( - Thread_Control *the_thread, - Priority_Control priority + Thread_Control *the_thread, + Scheduler_Control *scheduler, + Priority_Control priority ) { the_thread->is_preemptible = the_thread->Start.is_preemptible; @@ -228,7 +229,7 @@ static void _Thread_Start_life_change( _Thread_Set_transient( the_thread ); _Thread_queue_Extract_with_proxy( the_thread ); _Watchdog_Remove( &the_thread->Timer ); - _Scheduler_Set_priority_if_higher( the_thread, priority ); + _Scheduler_Set_priority_if_higher( scheduler, the_thread, priority ); _Thread_Add_post_switch_action( the_thread, &the_thread->Life.Action ); _Thread_Ready( the_thread ); _Thread_Request_dispatch_if_executing( the_thread ); @@ -244,29 +245,37 @@ static void _Thread_Request_life_change( Thread_Life_state previous_life_state; Per_CPU_Control *cpu; ISR_Level level; + Scheduler_Control *scheduler; cpu = _Thread_Action_ISR_disable_and_acquire( the_thread, &level ); previous_life_state = the_thread->Life.state; the_thread->Life.state = previous_life_state | additional_life_state; _Thread_Action_release_and_ISR_enable( cpu, level ); + scheduler = _Scheduler_Get( the_thread ); if ( the_thread == executing ) { executing->real_priority = priority; - _Scheduler_Set_priority_if_higher( the_thread, priority ); + _Scheduler_Set_priority_if_higher( scheduler, the_thread, priority ); _Thread_Start_life_change_for_executing( executing ); } else if ( previous_life_state == THREAD_LIFE_NORMAL ) { - _Thread_Start_life_change( the_thread, priority ); + _Thread_Start_life_change( the_thread, scheduler, priority ); } else { _Thread_Clear_state( the_thread, STATES_SUSPENDED ); if ( _Thread_Is_life_terminating( additional_life_state ) ) { the_thread->real_priority = _Scheduler_Highest_priority_of_two( + scheduler, the_thread->real_priority, priority ); - _Scheduler_Change_priority_if_higher( the_thread, priority, false ); + _Scheduler_Change_priority_if_higher( + scheduler, + the_thread, + priority, + false + ); } } } |