summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/scheduleredfupdate.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-09 21:30:40 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-22 14:37:11 +0200
commit99fc1d1d1b44e70a0bed4c94a514bd3f3b5df64f (patch)
tree3d290aed9fb42872d1ec6457025eb66a7303dec5 /cpukit/score/src/scheduleredfupdate.c
parentscore: Modify release job scheduler operation (diff)
downloadrtems-99fc1d1d1b44e70a0bed4c94a514bd3f3b5df64f.tar.bz2
score: Rework EDF scheduler
Use inline red-black tree insert. Do not use shifting priorities since this is not supported by the thread queues. Due to the 32-bit Priority_Control this currently limits the uptime to 49days with a 1ms clock tick. Update #2173.
Diffstat (limited to 'cpukit/score/src/scheduleredfupdate.c')
-rw-r--r--cpukit/score/src/scheduleredfupdate.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/cpukit/score/src/scheduleredfupdate.c b/cpukit/score/src/scheduleredfupdate.c
index dfa2e81281..5d475fe5f1 100644
--- a/cpukit/score/src/scheduleredfupdate.c
+++ b/cpukit/score/src/scheduleredfupdate.c
@@ -26,16 +26,13 @@ void _Scheduler_EDF_Update_priority(
Priority_Control new_priority
)
{
- Scheduler_EDF_Node *node = _Scheduler_EDF_Thread_get_node( the_thread );
+ Scheduler_EDF_Node *node;
- (void) scheduler;
- (void) new_priority;
+ node = _Scheduler_EDF_Thread_get_node( the_thread );
- if (node->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) {
- /* Shifts the priority to the region of background tasks. */
- the_thread->Start.initial_priority |= (SCHEDULER_EDF_PRIO_MSB);
- the_thread->real_priority = the_thread->Start.initial_priority;
- the_thread->current_priority = the_thread->Start.initial_priority;
- node->queue_state = SCHEDULER_EDF_QUEUE_STATE_NOT_PRESENTLY;
+ if ( ( new_priority & SCHEDULER_EDF_PRIO_MSB ) != 0 ) {
+ node->background_priority = new_priority;
}
+
+ node->current_priority = new_priority;
}