From 0c286e3d7c176a4fb7faf6ba9f809996d599ca10 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 25 Oct 2017 16:00:17 +0200 Subject: 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. --- cpukit/score/src/schedulersimplesmp.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'cpukit/score/src/schedulersimplesmp.c') 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 ); } -- cgit v1.2.3