summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-09-30 14:38:04 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-02 10:05:40 +0100
commit501043a18bae037ca7195ce6989d3ffa8cc72660 (patch)
tree57e5051298373efcf465be0d0675a0efce50c80f /cpukit/score/src
parentscore: Rename scheduler ask for help stuff (diff)
downloadrtems-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')
-rw-r--r--cpukit/score/src/scheduleredfchangepriority.c19
-rw-r--r--cpukit/score/src/schedulerpriorityaffinitysmp.c4
-rw-r--r--cpukit/score/src/schedulerprioritychangepriority.c19
-rw-r--r--cpukit/score/src/schedulerprioritysmp.c4
-rw-r--r--cpukit/score/src/schedulersimplechangepriority.c5
-rw-r--r--cpukit/score/src/schedulersimplesmp.c4
-rw-r--r--cpukit/score/src/schedulerstrongapa.c4
7 files changed, 34 insertions, 25 deletions
diff --git a/cpukit/score/src/scheduleredfchangepriority.c b/cpukit/score/src/scheduleredfchangepriority.c
index 8940b1d54b..8fcc1115f4 100644
--- a/cpukit/score/src/scheduleredfchangepriority.c
+++ b/cpukit/score/src/scheduleredfchangepriority.c
@@ -38,11 +38,12 @@ Priority_Control _Scheduler_EDF_Unmap_priority(
Scheduler_Void_or_thread _Scheduler_EDF_Update_priority(
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;
@@ -51,23 +52,23 @@ Scheduler_Void_or_thread _Scheduler_EDF_Update_priority(
SCHEDULER_RETURN_VOID_OR_NULL;
}
- 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 );
- if ( priority == node->priority ) {
+ if ( priority == the_node->priority ) {
/* Nothing to do */
SCHEDULER_RETURN_VOID_OR_NULL;
}
- node->priority = priority;
+ the_node->priority = priority;
context = _Scheduler_EDF_Get_context( scheduler );
- _Scheduler_EDF_Extract( context, node );
+ _Scheduler_EDF_Extract( context, the_node );
if ( prepend_it ) {
- _Scheduler_EDF_Enqueue_first( context, node, priority );
+ _Scheduler_EDF_Enqueue_first( context, the_node, priority );
} else {
- _Scheduler_EDF_Enqueue( context, node, priority );
+ _Scheduler_EDF_Enqueue( context, the_node, priority );
}
_Scheduler_EDF_Schedule_body( scheduler, the_thread, false );
diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c b/cpukit/score/src/schedulerpriorityaffinitysmp.c
index a15ff0f2f2..9282b1a845 100644
--- a/cpukit/score/src/schedulerpriorityaffinitysmp.c
+++ b/cpukit/score/src/schedulerpriorityaffinitysmp.c
@@ -500,7 +500,8 @@ static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_scheduled_fifo(
*/
Thread_Control *_Scheduler_priority_affinity_SMP_Update_priority(
const Scheduler_Control *scheduler,
- Thread_Control *thread
+ Thread_Control *thread,
+ Scheduler_Node *node
)
{
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
@@ -509,6 +510,7 @@ Thread_Control *_Scheduler_priority_affinity_SMP_Update_priority(
displaced = _Scheduler_SMP_Update_priority(
context,
thread,
+ node,
_Scheduler_priority_SMP_Extract_from_ready,
_Scheduler_priority_SMP_Do_update,
_Scheduler_priority_affinity_SMP_Enqueue_fifo,
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
);
}
diff --git a/cpukit/score/src/schedulerprioritysmp.c b/cpukit/score/src/schedulerprioritysmp.c
index 2445503485..4936b05fce 100644
--- a/cpukit/score/src/schedulerprioritysmp.c
+++ b/cpukit/score/src/schedulerprioritysmp.c
@@ -227,7 +227,8 @@ Thread_Control *_Scheduler_priority_SMP_Unblock(
Thread_Control *_Scheduler_priority_SMP_Update_priority(
const Scheduler_Control *scheduler,
- Thread_Control *thread
+ Thread_Control *thread,
+ Scheduler_Node *node
)
{
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
@@ -235,6 +236,7 @@ Thread_Control *_Scheduler_priority_SMP_Update_priority(
return _Scheduler_SMP_Update_priority(
context,
thread,
+ node,
_Scheduler_priority_SMP_Extract_from_ready,
_Scheduler_priority_SMP_Do_update,
_Scheduler_priority_SMP_Enqueue_fifo,
diff --git a/cpukit/score/src/schedulersimplechangepriority.c b/cpukit/score/src/schedulersimplechangepriority.c
index 9d4a565dbd..e430c75e08 100644
--- a/cpukit/score/src/schedulersimplechangepriority.c
+++ b/cpukit/score/src/schedulersimplechangepriority.c
@@ -23,11 +23,11 @@
Scheduler_Void_or_thread _Scheduler_simple_Update_priority(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Scheduler_Node *node
)
{
Scheduler_simple_Context *context;
- Scheduler_Node *node;
bool prepend_it;
if ( !_Thread_Is_ready( the_thread ) ) {
@@ -36,7 +36,6 @@ Scheduler_Void_or_thread _Scheduler_simple_Update_priority(
}
context = _Scheduler_simple_Get_context( scheduler );
- node = _Scheduler_Thread_get_node( the_thread );
_Scheduler_Node_get_priority( node, &prepend_it );
_Scheduler_simple_Extract( scheduler, the_thread );
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c
index f51990e9c7..2d333c9400 100644
--- a/cpukit/score/src/schedulersimplesmp.c
+++ b/cpukit/score/src/schedulersimplesmp.c
@@ -294,7 +294,8 @@ Thread_Control *_Scheduler_simple_SMP_Unblock(
Thread_Control *_Scheduler_simple_SMP_Update_priority(
const Scheduler_Control *scheduler,
- Thread_Control *thread
+ Thread_Control *thread,
+ Scheduler_Node *node
)
{
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
@@ -302,6 +303,7 @@ Thread_Control *_Scheduler_simple_SMP_Update_priority(
return _Scheduler_SMP_Update_priority(
context,
thread,
+ node,
_Scheduler_simple_SMP_Extract_from_ready,
_Scheduler_simple_SMP_Do_update,
_Scheduler_simple_SMP_Enqueue_fifo,
diff --git a/cpukit/score/src/schedulerstrongapa.c b/cpukit/score/src/schedulerstrongapa.c
index 7dfe0759b8..f42f470cfc 100644
--- a/cpukit/score/src/schedulerstrongapa.c
+++ b/cpukit/score/src/schedulerstrongapa.c
@@ -353,7 +353,8 @@ Thread_Control *_Scheduler_strong_APA_Unblock(
Thread_Control *_Scheduler_strong_APA_Update_priority(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Scheduler_Node *node
)
{
Scheduler_Context *context = _Scheduler_Get_context( scheduler );
@@ -361,6 +362,7 @@ Thread_Control *_Scheduler_strong_APA_Update_priority(
return _Scheduler_SMP_Update_priority(
context,
the_thread,
+ node,
_Scheduler_strong_APA_Extract_from_ready,
_Scheduler_strong_APA_Do_update,
_Scheduler_strong_APA_Enqueue_fifo,