diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-09 21:30:40 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-22 14:37:11 +0200 |
commit | 99fc1d1d1b44e70a0bed4c94a514bd3f3b5df64f (patch) | |
tree | 3d290aed9fb42872d1ec6457025eb66a7303dec5 /cpukit/score/src/scheduleredf.c | |
parent | score: Modify release job scheduler operation (diff) | |
download | rtems-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/scheduleredf.c')
-rw-r--r-- | cpukit/score/src/scheduleredf.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/cpukit/score/src/scheduleredf.c b/cpukit/score/src/scheduleredf.c index 372612819a..21bbe240c8 100644 --- a/cpukit/score/src/scheduleredf.c +++ b/cpukit/score/src/scheduleredf.c @@ -20,47 +20,6 @@ #include <rtems/score/scheduleredfimpl.h> -int _Scheduler_EDF_Priority_compare ( - Priority_Control p1, - Priority_Control p2 -) -{ - Watchdog_Interval time = _Watchdog_Ticks_since_boot; - - /* - * Reorder priorities to separate deadline driven and background tasks. - * - * The background tasks have p1 or p2 > SCHEDULER_EDF_PRIO_MSB. - * The deadline driven tasks need to have subtracted current time in order - * to see which deadline is closer wrt. current time. - */ - if (!(p1 & SCHEDULER_EDF_PRIO_MSB)) - p1 = (p1 - time) & ~SCHEDULER_EDF_PRIO_MSB; - if (!(p2 & SCHEDULER_EDF_PRIO_MSB)) - p2 = (p2 - time) & ~SCHEDULER_EDF_PRIO_MSB; - - return ((p1<p2) - (p1>p2)); -} - -RBTree_Compare_result _Scheduler_EDF_Compare( - const RBTree_Node* n1, - const RBTree_Node* n2 -) -{ - Scheduler_EDF_Node *edf1 = - RTEMS_CONTAINER_OF( n1, Scheduler_EDF_Node, Node ); - Scheduler_EDF_Node *edf2 = - RTEMS_CONTAINER_OF( n2, Scheduler_EDF_Node, Node ); - Priority_Control value1 = edf1->thread->current_priority; - Priority_Control value2 = edf2->thread->current_priority; - - /* - * This function compares only numbers for the red-black tree, - * but priorities have an opposite sense. - */ - return (-1)*_Scheduler_EDF_Priority_compare(value1, value2); -} - void _Scheduler_EDF_Initialize( const Scheduler_Control *scheduler ) { Scheduler_EDF_Context *context = |