diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-05-13 16:03:05 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-05-14 14:46:19 +0200 |
commit | beab7329fca655c93743fbb590d00bb4ea5a6d78 (patch) | |
tree | fbeb6b27f887b46a41f84acc64aecfce18686540 /cpukit/score/src/schedulersimplesmp.c | |
parent | score: Scheduler documentation (diff) | |
download | rtems-beab7329fca655c93743fbb590d00bb4ea5a6d78.tar.bz2 |
score: Introduce scheduler nodes
Rename scheduler per-thread information into scheduler nodes using
Scheduler_Node as the base type. Use inheritance for specialized
schedulers.
Move the scheduler specific states from the thread control block into
the scheduler node structure.
Validate the SMP scheduler node state transitions in case RTEMS_DEBUG is
defined.
Diffstat (limited to 'cpukit/score/src/schedulersimplesmp.c')
-rw-r--r-- | cpukit/score/src/schedulersimplesmp.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c index 5448d5d3de..7fe2fd7943 100644 --- a/cpukit/score/src/schedulersimplesmp.c +++ b/cpukit/score/src/schedulersimplesmp.c @@ -3,7 +3,7 @@ * * @brief Simple SMP Scheduler Implementation * - * @ingroup ScoreSchedulerSMP + * @ingroup ScoreSchedulerSMPSimple */ /* @@ -44,6 +44,18 @@ void _Scheduler_simple_smp_Initialize( const Scheduler_Control *scheduler ) _Chain_Initialize_empty( &self->Ready ); } +bool _Scheduler_simple_smp_Allocate( + const Scheduler_Control *scheduler, + Thread_Control *the_thread +) +{ + Scheduler_SMP_Node *node = _Scheduler_SMP_Node_get( the_thread ); + + _Scheduler_SMP_Node_initialize( node ); + + return true; +} + static Thread_Control *_Scheduler_simple_smp_Get_highest_ready( Scheduler_SMP_Context *smp_base ) @@ -122,10 +134,15 @@ static void _Scheduler_simple_smp_Do_extract( Thread_Control *thread ) { + Scheduler_SMP_Node *node = _Scheduler_SMP_Node_get( thread ); + (void) smp_base; - thread->is_in_the_air = thread->is_scheduled; - thread->is_scheduled = false; + if ( node->state == SCHEDULER_SMP_NODE_SCHEDULED ) { + _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_IN_THE_AIR ); + } else { + _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_BLOCKED ); + } _Chain_Extract_unprotected( &thread->Object.Node ); } |