diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-25 16:00:17 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-11-06 09:06:21 +0100 |
commit | 0c286e3d7c176a4fb7faf6ba9f809996d599ca10 (patch) | |
tree | bf30809e9a4f92d19254fa1acb1f833effa8dc40 /cpukit/score/src/schedulersimplesmp.c | |
parent | score: Remove superfluous include (diff) | |
download | rtems-0c286e3d7c176a4fb7faf6ba9f809996d599ca10.tar.bz2 |
score: _Chain_Insert_ordered_unprotected()
Change the chain order relation to use a directly specified left hand
side value. This is similar to _RBTree_Insert_inline() and helps the
compiler to better optimize the code.
Diffstat (limited to 'cpukit/score/src/schedulersimplesmp.c')
-rw-r--r-- | cpukit/score/src/schedulersimplesmp.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c index 4be43abff1..df08a19eab 100644 --- a/cpukit/score/src/schedulersimplesmp.c +++ b/cpukit/score/src/schedulersimplesmp.c @@ -98,13 +98,17 @@ static void _Scheduler_simple_SMP_Move_from_scheduled_to_ready( Scheduler_Node *scheduled_to_ready ) { - Scheduler_simple_SMP_Context *self = - _Scheduler_simple_SMP_Get_self( context ); + Scheduler_simple_SMP_Context *self; + Priority_Control priority_to_insert; + + self = _Scheduler_simple_SMP_Get_self( context ); + priority_to_insert = _Scheduler_SMP_Node_priority( scheduled_to_ready ); _Chain_Extract_unprotected( &scheduled_to_ready->Node.Chain ); _Chain_Insert_ordered_unprotected( &self->Ready, &scheduled_to_ready->Node.Chain, + &priority_to_insert, _Scheduler_SMP_Insert_priority_lifo_order ); } @@ -114,13 +118,17 @@ static void _Scheduler_simple_SMP_Move_from_ready_to_scheduled( Scheduler_Node *ready_to_scheduled ) { - Scheduler_simple_SMP_Context *self = - _Scheduler_simple_SMP_Get_self( context ); + Scheduler_simple_SMP_Context *self; + Priority_Control priority_to_insert; + + self = _Scheduler_simple_SMP_Get_self( context ); + priority_to_insert = _Scheduler_SMP_Node_priority( ready_to_scheduled ); _Chain_Extract_unprotected( &ready_to_scheduled->Node.Chain ); _Chain_Insert_ordered_unprotected( &self->Base.Scheduled, &ready_to_scheduled->Node.Chain, + &priority_to_insert, _Scheduler_SMP_Insert_priority_fifo_order ); } @@ -130,12 +138,16 @@ static void _Scheduler_simple_SMP_Insert_ready_lifo( Scheduler_Node *node_to_insert ) { - Scheduler_simple_SMP_Context *self = - _Scheduler_simple_SMP_Get_self( context ); + Scheduler_simple_SMP_Context *self; + Priority_Control priority_to_insert; + + self = _Scheduler_simple_SMP_Get_self( context ); + priority_to_insert = _Scheduler_SMP_Node_priority( node_to_insert ); _Chain_Insert_ordered_unprotected( &self->Ready, &node_to_insert->Node.Chain, + &priority_to_insert, _Scheduler_SMP_Insert_priority_lifo_order ); } @@ -145,12 +157,16 @@ static void _Scheduler_simple_SMP_Insert_ready_fifo( Scheduler_Node *node_to_insert ) { - Scheduler_simple_SMP_Context *self = - _Scheduler_simple_SMP_Get_self( context ); + Scheduler_simple_SMP_Context *self; + Priority_Control priority_to_insert; + + self = _Scheduler_simple_SMP_Get_self( context ); + priority_to_insert = _Scheduler_SMP_Node_priority( node_to_insert ); _Chain_Insert_ordered_unprotected( &self->Ready, &node_to_insert->Node.Chain, + &priority_to_insert, _Scheduler_SMP_Insert_priority_fifo_order ); } |