summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-06-29 09:44:16 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-06-29 11:15:50 +0200
commit15dbc710b62084e101bd2a46b3faa1ddc7ee417e (patch)
treed71a7668156a8713d01a3c30413fd2115d409293 /cpukit/score/src
parentsmptests: Split smpscheduler03 (diff)
downloadrtems-15dbc710b62084e101bd2a46b3faa1ddc7ee417e.tar.bz2
score: Add red-black tree node to Scheduler_Node
In SMP configurations, add a red-black tree node to Scheduler_Node to enable an EDF scheduler implementation. Update #3056.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/schedulerpriorityaffinitysmp.c8
-rw-r--r--cpukit/score/src/schedulersimplesmp.c16
-rw-r--r--cpukit/score/src/schedulersmpstartidle.c2
-rw-r--r--cpukit/score/src/schedulerstrongapa.c14
4 files changed, 23 insertions, 17 deletions
diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c b/cpukit/score/src/schedulerpriorityaffinitysmp.c
index 45afb571ef..1fa5dbf920 100644
--- a/cpukit/score/src/schedulerpriorityaffinitysmp.c
+++ b/cpukit/score/src/schedulerpriorityaffinitysmp.c
@@ -248,8 +248,14 @@ static Scheduler_Node * _Scheduler_priority_affinity_SMP_Get_lowest_scheduled(
* than filter thread is, then we can't schedule the filter thread
* to execute.
*/
- if ( (*order)( &node->Base.Base.Base.Node, &filter->Base.Base.Base.Node ) )
+ if (
+ (*order)(
+ &node->Base.Base.Base.Node.Chain,
+ &filter->Base.Base.Base.Node.Chain
+ )
+ ) {
break;
+ }
/* cpu_index is the processor number thread is executing on */
thread = _Scheduler_Node_get_owner( &node->Base.Base.Base );
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c
index 41eb491019..2884876381 100644
--- a/cpukit/score/src/schedulersimplesmp.c
+++ b/cpukit/score/src/schedulersimplesmp.c
@@ -88,7 +88,7 @@ static Scheduler_Node *_Scheduler_simple_SMP_Get_highest_ready(
(void) node;
- _Assert( &first->Node != _Chain_Tail( &self->Ready ) );
+ _Assert( &first->Node.Chain != _Chain_Tail( &self->Ready ) );
return first;
}
@@ -101,10 +101,10 @@ static void _Scheduler_simple_SMP_Move_from_scheduled_to_ready(
Scheduler_simple_SMP_Context *self =
_Scheduler_simple_SMP_Get_self( context );
- _Chain_Extract_unprotected( &scheduled_to_ready->Node );
+ _Chain_Extract_unprotected( &scheduled_to_ready->Node.Chain );
_Chain_Insert_ordered_unprotected(
&self->Ready,
- &scheduled_to_ready->Node,
+ &scheduled_to_ready->Node.Chain,
_Scheduler_SMP_Insert_priority_lifo_order
);
}
@@ -117,10 +117,10 @@ static void _Scheduler_simple_SMP_Move_from_ready_to_scheduled(
Scheduler_simple_SMP_Context *self =
_Scheduler_simple_SMP_Get_self( context );
- _Chain_Extract_unprotected( &ready_to_scheduled->Node );
+ _Chain_Extract_unprotected( &ready_to_scheduled->Node.Chain );
_Chain_Insert_ordered_unprotected(
&self->Base.Scheduled,
- &ready_to_scheduled->Node,
+ &ready_to_scheduled->Node.Chain,
_Scheduler_SMP_Insert_priority_fifo_order
);
}
@@ -135,7 +135,7 @@ static void _Scheduler_simple_SMP_Insert_ready_lifo(
_Chain_Insert_ordered_unprotected(
&self->Ready,
- &node_to_insert->Node,
+ &node_to_insert->Node.Chain,
_Scheduler_SMP_Insert_priority_lifo_order
);
}
@@ -150,7 +150,7 @@ static void _Scheduler_simple_SMP_Insert_ready_fifo(
_Chain_Insert_ordered_unprotected(
&self->Ready,
- &node_to_insert->Node,
+ &node_to_insert->Node.Chain,
_Scheduler_SMP_Insert_priority_fifo_order
);
}
@@ -162,7 +162,7 @@ static void _Scheduler_simple_SMP_Extract_from_ready(
{
(void) context;
- _Chain_Extract_unprotected( &node_to_extract->Node );
+ _Chain_Extract_unprotected( &node_to_extract->Node.Chain );
}
void _Scheduler_simple_SMP_Block(
diff --git a/cpukit/score/src/schedulersmpstartidle.c b/cpukit/score/src/schedulersmpstartidle.c
index d34ba12a43..d396a159fe 100644
--- a/cpukit/score/src/schedulersmpstartidle.c
+++ b/cpukit/score/src/schedulersmpstartidle.c
@@ -30,6 +30,6 @@ void _Scheduler_SMP_Start_idle(
node->state = SCHEDULER_SMP_NODE_SCHEDULED;
_Thread_Set_CPU( idle, cpu );
- _Chain_Append_unprotected( &self->Scheduled, &node->Base.Node );
+ _Chain_Append_unprotected( &self->Scheduled, &node->Base.Node.Chain );
_Scheduler_SMP_Release_idle_thread( &self->Base, idle );
}
diff --git a/cpukit/score/src/schedulerstrongapa.c b/cpukit/score/src/schedulerstrongapa.c
index d8d3280ed9..f6313584f6 100644
--- a/cpukit/score/src/schedulerstrongapa.c
+++ b/cpukit/score/src/schedulerstrongapa.c
@@ -51,9 +51,9 @@ static void _Scheduler_strong_APA_Move_from_scheduled_to_ready(
Scheduler_strong_APA_Node *node =
_Scheduler_strong_APA_Node_downcast( scheduled_to_ready );
- _Chain_Extract_unprotected( &node->Base.Base.Node );
+ _Chain_Extract_unprotected( &node->Base.Base.Node.Chain );
_Scheduler_priority_Ready_queue_enqueue_first(
- &node->Base.Base.Node,
+ &node->Base.Base.Node.Chain,
&node->Ready_queue,
&self->Bit_map
);
@@ -70,13 +70,13 @@ static void _Scheduler_strong_APA_Move_from_ready_to_scheduled(
_Scheduler_strong_APA_Node_downcast( ready_to_scheduled );
_Scheduler_priority_Ready_queue_extract(
- &node->Base.Base.Node,
+ &node->Base.Base.Node.Chain,
&node->Ready_queue,
&self->Bit_map
);
_Chain_Insert_ordered_unprotected(
&self->Base.Scheduled,
- &node->Base.Base.Node,
+ &node->Base.Base.Node.Chain,
_Scheduler_SMP_Insert_priority_fifo_order
);
}
@@ -92,7 +92,7 @@ static void _Scheduler_strong_APA_Insert_ready_lifo(
_Scheduler_strong_APA_Node_downcast( the_thread );
_Scheduler_priority_Ready_queue_enqueue(
- &node->Base.Base.Node,
+ &node->Base.Base.Node.Chain,
&node->Ready_queue,
&self->Bit_map
);
@@ -109,7 +109,7 @@ static void _Scheduler_strong_APA_Insert_ready_fifo(
_Scheduler_strong_APA_Node_downcast( the_thread );
_Scheduler_priority_Ready_queue_enqueue_first(
- &node->Base.Base.Node,
+ &node->Base.Base.Node.Chain,
&node->Ready_queue,
&self->Bit_map
);
@@ -126,7 +126,7 @@ static void _Scheduler_strong_APA_Extract_from_ready(
_Scheduler_strong_APA_Node_downcast( the_thread );
_Scheduler_priority_Ready_queue_extract(
- &node->Base.Base.Node,
+ &node->Base.Base.Node.Chain,
&node->Ready_queue,
&self->Bit_map
);