summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-10-10 14:50:19 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-02 10:05:41 +0100
commit72e0bdba4580072c33da09fcacbd3063dbc4f2c1 (patch)
treef2daa6386cdbef84266bb363bd6c26de610a146b /cpukit/score/src
parentscore: Pass scheduler node to block operation (diff)
downloadrtems-72e0bdba4580072c33da09fcacbd3063dbc4f2c1.tar.bz2
score: Pass scheduler node to unblock operation
Changed for consistency with other scheduler operations. Update #2556.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/schedulercbsunblock.c15
-rw-r--r--cpukit/score/src/scheduleredfunblock.c13
-rw-r--r--cpukit/score/src/schedulerpriorityaffinitysmp.c6
-rw-r--r--cpukit/score/src/schedulerprioritysmp.c4
-rw-r--r--cpukit/score/src/schedulerpriorityunblock.c15
-rw-r--r--cpukit/score/src/schedulersimplesmp.c4
-rw-r--r--cpukit/score/src/schedulersimpleunblock.c5
-rw-r--r--cpukit/score/src/schedulerstrongapa.c4
8 files changed, 40 insertions, 26 deletions
diff --git a/cpukit/score/src/schedulercbsunblock.c b/cpukit/score/src/schedulercbsunblock.c
index c09f471afa..63abc12c70 100644
--- a/cpukit/score/src/schedulercbsunblock.c
+++ b/cpukit/score/src/schedulercbsunblock.c
@@ -27,17 +27,18 @@
Scheduler_Void_or_thread _Scheduler_CBS_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Scheduler_Node *node
)
{
- Scheduler_CBS_Node *node;
+ Scheduler_CBS_Node *the_node;
Scheduler_CBS_Server *serv_info;
Priority_Control priority;
bool prepend_it;
- node = _Scheduler_CBS_Thread_get_node( the_thread );
- serv_info = node->cbs_server;
- priority = _Scheduler_Node_get_priority( &node->Base.Base, &prepend_it );
+ the_node = _Scheduler_CBS_Node_downcast( node );
+ serv_info = the_node->cbs_server;
+ priority = _Scheduler_Node_get_priority( &the_node->Base.Base, &prepend_it );
(void) prepend_it;
/*
@@ -60,12 +61,12 @@ Scheduler_Void_or_thread _Scheduler_CBS_Unblock(
_Scheduler_CBS_Cancel_job(
scheduler,
the_thread,
- node->deadline_node,
+ the_node->deadline_node,
&queue_context
);
}
}
- _Scheduler_EDF_Unblock( scheduler, the_thread );
+ _Scheduler_EDF_Unblock( scheduler, the_thread, &the_node->Base.Base );
SCHEDULER_RETURN_VOID_OR_NULL;
}
diff --git a/cpukit/score/src/scheduleredfunblock.c b/cpukit/score/src/scheduleredfunblock.c
index a5cc4b6a37..5b3fbb3943 100644
--- a/cpukit/score/src/scheduleredfunblock.c
+++ b/cpukit/score/src/scheduleredfunblock.c
@@ -24,21 +24,22 @@
Scheduler_Void_or_thread _Scheduler_EDF_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Scheduler_Node *node
)
{
Scheduler_EDF_Context *context;
- Scheduler_EDF_Node *node;
+ Scheduler_EDF_Node *the_node;
Priority_Control priority;
bool prepend_it;
context = _Scheduler_EDF_Get_context( scheduler );
- node = _Scheduler_EDF_Thread_get_node( the_thread );
- priority = _Scheduler_Node_get_priority( &node->Base, &prepend_it );
+ the_node = _Scheduler_EDF_Node_downcast( node );
+ priority = _Scheduler_Node_get_priority( &the_node->Base, &prepend_it );
(void) prepend_it;
- node->priority = priority;
- _Scheduler_EDF_Enqueue( context, node, priority );
+ the_node->priority = priority;
+ _Scheduler_EDF_Enqueue( context, the_node, priority );
/*
* If the thread that was unblocked is more important than the heir,
diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c b/cpukit/score/src/schedulerpriorityaffinitysmp.c
index 451df88d83..f684b1ae55 100644
--- a/cpukit/score/src/schedulerpriorityaffinitysmp.c
+++ b/cpukit/score/src/schedulerpriorityaffinitysmp.c
@@ -364,7 +364,8 @@ static void _Scheduler_priority_affinity_SMP_Check_for_migrations(
*/
Thread_Control *_Scheduler_priority_affinity_SMP_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *thread
+ Thread_Control *thread,
+ Scheduler_Node *node
)
{
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
@@ -373,6 +374,7 @@ Thread_Control *_Scheduler_priority_affinity_SMP_Unblock(
needs_help = _Scheduler_SMP_Unblock(
context,
thread,
+ node,
_Scheduler_priority_SMP_Do_update,
_Scheduler_priority_affinity_SMP_Enqueue_fifo
);
@@ -610,7 +612,7 @@ bool _Scheduler_priority_affinity_SMP_Set_affinity(
/*
* FIXME: Do not ignore threads in need for help.
*/
- (void) _Scheduler_priority_affinity_SMP_Unblock( scheduler, thread );
+ (void) _Scheduler_priority_affinity_SMP_Unblock( scheduler, thread, &node->Base.Base.Base );
}
return true;
diff --git a/cpukit/score/src/schedulerprioritysmp.c b/cpukit/score/src/schedulerprioritysmp.c
index ab3e663a81..f80c3b8c4c 100644
--- a/cpukit/score/src/schedulerprioritysmp.c
+++ b/cpukit/score/src/schedulerprioritysmp.c
@@ -214,7 +214,8 @@ static Thread_Control *_Scheduler_priority_SMP_Enqueue_scheduled_fifo(
Thread_Control *_Scheduler_priority_SMP_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *thread
+ Thread_Control *thread,
+ Scheduler_Node *node
)
{
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
@@ -222,6 +223,7 @@ Thread_Control *_Scheduler_priority_SMP_Unblock(
return _Scheduler_SMP_Unblock(
context,
thread,
+ node,
_Scheduler_priority_SMP_Do_update,
_Scheduler_priority_SMP_Enqueue_fifo
);
diff --git a/cpukit/score/src/schedulerpriorityunblock.c b/cpukit/score/src/schedulerpriorityunblock.c
index 7186103f2b..99d4310a4c 100644
--- a/cpukit/score/src/schedulerpriorityunblock.c
+++ b/cpukit/score/src/schedulerpriorityunblock.c
@@ -24,23 +24,24 @@
Scheduler_Void_or_thread _Scheduler_priority_Unblock (
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;
context = _Scheduler_priority_Get_context( scheduler );
- 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 );
(void) prepend_it;
- if ( priority != node->Ready_queue.current_priority ) {
+ if ( priority != the_node->Ready_queue.current_priority ) {
_Scheduler_priority_Ready_queue_update(
- &node->Ready_queue,
+ &the_node->Ready_queue,
priority,
&context->Bit_map,
&context->Ready[ 0 ]
@@ -49,7 +50,7 @@ Scheduler_Void_or_thread _Scheduler_priority_Unblock (
_Scheduler_priority_Ready_queue_enqueue(
&the_thread->Object.Node,
- &node->Ready_queue,
+ &the_node->Ready_queue,
&context->Bit_map
);
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c
index 3d4efeade0..28410ea6c5 100644
--- a/cpukit/score/src/schedulersimplesmp.c
+++ b/cpukit/score/src/schedulersimplesmp.c
@@ -281,7 +281,8 @@ static Thread_Control *_Scheduler_simple_SMP_Enqueue_scheduled_fifo(
Thread_Control *_Scheduler_simple_SMP_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *thread
+ Thread_Control *thread,
+ Scheduler_Node *node
)
{
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
@@ -289,6 +290,7 @@ Thread_Control *_Scheduler_simple_SMP_Unblock(
return _Scheduler_SMP_Unblock(
context,
thread,
+ node,
_Scheduler_simple_SMP_Do_update,
_Scheduler_simple_SMP_Enqueue_fifo
);
diff --git a/cpukit/score/src/schedulersimpleunblock.c b/cpukit/score/src/schedulersimpleunblock.c
index de08fc1a5a..5eeaf6cc35 100644
--- a/cpukit/score/src/schedulersimpleunblock.c
+++ b/cpukit/score/src/schedulersimpleunblock.c
@@ -23,12 +23,15 @@
Scheduler_Void_or_thread _Scheduler_simple_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Scheduler_Node *node
)
{
Scheduler_simple_Context *context;
Priority_Control priority;
+ (void) node;
+
context = _Scheduler_simple_Get_context( scheduler );
_Scheduler_simple_Insert_priority_fifo( &context->Ready, the_thread );
priority = _Thread_Get_priority( the_thread );
diff --git a/cpukit/score/src/schedulerstrongapa.c b/cpukit/score/src/schedulerstrongapa.c
index b5a5545a5f..7dd65c0f8a 100644
--- a/cpukit/score/src/schedulerstrongapa.c
+++ b/cpukit/score/src/schedulerstrongapa.c
@@ -340,7 +340,8 @@ static Thread_Control *_Scheduler_strong_APA_Enqueue_scheduled_fifo(
Thread_Control *_Scheduler_strong_APA_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Scheduler_Node *node
)
{
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
@@ -348,6 +349,7 @@ Thread_Control *_Scheduler_strong_APA_Unblock(
return _Scheduler_SMP_Unblock(
context,
the_thread,
+ node,
_Scheduler_strong_APA_Do_update,
_Scheduler_strong_APA_Enqueue_fifo
);