diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-09-30 14:38:04 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-02 10:05:40 +0100 |
commit | 501043a18bae037ca7195ce6989d3ffa8cc72660 (patch) | |
tree | 57e5051298373efcf465be0d0675a0efce50c80f /cpukit/score/src/schedulerprioritychangepriority.c | |
parent | score: Rename scheduler ask for help stuff (diff) | |
download | rtems-501043a18bae037ca7195ce6989d3ffa8cc72660.tar.bz2 |
score: Pass scheduler node to update priority op
This enables to call this scheduler operation for all scheduler nodes
available to a thread.
Update #2556.
Diffstat (limited to 'cpukit/score/src/schedulerprioritychangepriority.c')
-rw-r--r-- | cpukit/score/src/schedulerprioritychangepriority.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/cpukit/score/src/schedulerprioritychangepriority.c b/cpukit/score/src/schedulerprioritychangepriority.c index 4fc46cf15a..339168f20c 100644 --- a/cpukit/score/src/schedulerprioritychangepriority.c +++ b/cpukit/score/src/schedulerprioritychangepriority.c @@ -23,11 +23,12 @@ Scheduler_Void_or_thread _Scheduler_priority_Update_priority( const Scheduler_Control *scheduler, - Thread_Control *the_thread + Thread_Control *the_thread, + Scheduler_Node *node ) { Scheduler_priority_Context *context; - Scheduler_priority_Node *node; + Scheduler_priority_Node *the_node; unsigned int priority; bool prepend_it; @@ -36,11 +37,11 @@ Scheduler_Void_or_thread _Scheduler_priority_Update_priority( SCHEDULER_RETURN_VOID_OR_NULL; } - node = _Scheduler_priority_Thread_get_node( the_thread ); + the_node = _Scheduler_priority_Node_downcast( node ); priority = (unsigned int ) - _Scheduler_Node_get_priority( &node->Base, &prepend_it ); + _Scheduler_Node_get_priority( &the_node->Base, &prepend_it ); - if ( priority == node->Ready_queue.current_priority ) { + if ( priority == the_node->Ready_queue.current_priority ) { /* Nothing to do */ SCHEDULER_RETURN_VOID_OR_NULL; } @@ -49,12 +50,12 @@ Scheduler_Void_or_thread _Scheduler_priority_Update_priority( _Scheduler_priority_Ready_queue_extract( &the_thread->Object.Node, - &node->Ready_queue, + &the_node->Ready_queue, &context->Bit_map ); _Scheduler_priority_Ready_queue_update( - &node->Ready_queue, + &the_node->Ready_queue, priority, &context->Bit_map, &context->Ready[ 0 ] @@ -63,13 +64,13 @@ Scheduler_Void_or_thread _Scheduler_priority_Update_priority( if ( prepend_it ) { _Scheduler_priority_Ready_queue_enqueue_first( &the_thread->Object.Node, - &node->Ready_queue, + &the_node->Ready_queue, &context->Bit_map ); } else { _Scheduler_priority_Ready_queue_enqueue( &the_thread->Object.Node, - &node->Ready_queue, + &the_node->Ready_queue, &context->Bit_map ); } |