diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-09-08 14:07:12 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-09-21 08:59:32 +0200 |
commit | 266d3835d883f908c0e4cbf547359d683f72dcc4 (patch) | |
tree | ab1cfe81a9574d984d39c1d27d88d3032c31a594 /cpukit/score/include | |
parent | score: Add scheduler node table for each thread (diff) | |
download | rtems-266d3835d883f908c0e4cbf547359d683f72dcc4.tar.bz2 |
score: Manage scheduler nodes via thread queues
Update #2556.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/include/rtems/score/schedulerimpl.h | 7 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/schedulernode.h | 12 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/schedulernodeimpl.h | 1 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/thread.h | 8 |
4 files changed, 28 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h index 2fdc01a695..7ac8964909 100644 --- a/cpukit/score/include/rtems/score/schedulerimpl.h +++ b/cpukit/score/include/rtems/score/schedulerimpl.h @@ -1423,6 +1423,13 @@ RTEMS_INLINE_ROUTINE Status_Control _Scheduler_Set( ); #if defined(RTEMS_SMP) + _Chain_Extract_unprotected( &old_scheduler_node->Thread.Wait_node ); + _Assert( _Chain_Is_empty( &the_thread->Scheduler.Wait_nodes ) ); + _Chain_Initialize_one( + &the_thread->Scheduler.Wait_nodes, + &new_scheduler_node->Thread.Wait_node + ); + { const Scheduler_Control *old_scheduler; diff --git a/cpukit/score/include/rtems/score/schedulernode.h b/cpukit/score/include/rtems/score/schedulernode.h index 2954db5350..8d00a43d31 100644 --- a/cpukit/score/include/rtems/score/schedulernode.h +++ b/cpukit/score/include/rtems/score/schedulernode.h @@ -138,6 +138,18 @@ typedef struct Scheduler_Node { * not SCHEDULER_HELP_YOURSELF. */ struct _Thread_Control *accepts_help; + + /** + * @brief Block to register and manage this scheduler node in the thread + * control block of the owner of this scheduler node. + */ + struct { + /** + * @brief Node to add this scheduler node to + * Thread_Control::Scheduler::Wait_nodes. + */ + Chain_Node Wait_node; + } Thread; #endif /** diff --git a/cpukit/score/include/rtems/score/schedulernodeimpl.h b/cpukit/score/include/rtems/score/schedulernodeimpl.h index b0f7d77bbe..cf096aae13 100644 --- a/cpukit/score/include/rtems/score/schedulernodeimpl.h +++ b/cpukit/score/include/rtems/score/schedulernodeimpl.h @@ -42,6 +42,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize( node->Priority.prepend_it = false; #if defined(RTEMS_SMP) + _Chain_Initialize_node( &node->Thread.Wait_node ); node->Wait.Priority.scheduler = scheduler; node->user = the_thread; node->help_state = SCHEDULER_HELP_YOURSELF; diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 17aeacde29..a86d81b4e2 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -287,6 +287,14 @@ typedef struct { * @brief The processor assigned by the current scheduler. */ struct Per_CPU_Control *cpu; + + /** + * @brief Scheduler nodes immediately available to the thread by its home + * scheduler instance and due to thread queue ownerships. + * + * This chain is protected by the thread wait lock. + */ + Chain_Control Wait_nodes; #endif /** |