[e5ca54c9] | 1 | /** |
---|
| 2 | * @file |
---|
| 3 | * |
---|
| 4 | * @ingroup ScoreSchedulerEDF |
---|
| 5 | * |
---|
| 6 | * @brief EDF Scheduler Implementation |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | /* |
---|
| 10 | * Copryight (c) 2011 Petr Benes. |
---|
| 11 | * Copyright (C) 2011 On-Line Applications Research Corporation (OAR). |
---|
| 12 | * |
---|
| 13 | * The license and distribution terms for this file may be |
---|
| 14 | * found in the file LICENSE in this distribution or at |
---|
[c499856] | 15 | * http://www.rtems.org/license/LICENSE. |
---|
[e5ca54c9] | 16 | */ |
---|
| 17 | |
---|
| 18 | #ifndef _RTEMS_SCORE_SCHEDULEREDFIMPL_H |
---|
| 19 | #define _RTEMS_SCORE_SCHEDULEREDFIMPL_H |
---|
| 20 | |
---|
| 21 | #include <rtems/score/scheduleredf.h> |
---|
| 22 | #include <rtems/score/schedulerimpl.h> |
---|
| 23 | |
---|
| 24 | #ifdef __cplusplus |
---|
| 25 | extern "C" { |
---|
| 26 | #endif |
---|
| 27 | |
---|
| 28 | /** |
---|
| 29 | * @addtogroup ScoreSchedulerEDF EDF |
---|
| 30 | * |
---|
| 31 | * @{ |
---|
| 32 | */ |
---|
| 33 | |
---|
[e1598a6] | 34 | RTEMS_INLINE_ROUTINE Scheduler_EDF_Context * |
---|
| 35 | _Scheduler_EDF_Get_context( const Scheduler_Control *scheduler ) |
---|
[3891983] | 36 | { |
---|
[e1598a6] | 37 | return (Scheduler_EDF_Context *) scheduler->context; |
---|
[3891983] | 38 | } |
---|
| 39 | |
---|
[beab7329] | 40 | RTEMS_INLINE_ROUTINE Scheduler_EDF_Node *_Scheduler_EDF_Node_get( |
---|
| 41 | Thread_Control *the_thread |
---|
| 42 | ) |
---|
| 43 | { |
---|
| 44 | return (Scheduler_EDF_Node *) _Scheduler_Node_get( the_thread ); |
---|
| 45 | } |
---|
| 46 | |
---|
[e5ca54c9] | 47 | RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Schedule_body( |
---|
[e1598a6] | 48 | const Scheduler_Control *scheduler, |
---|
| 49 | Thread_Control *the_thread, |
---|
| 50 | bool force_dispatch |
---|
[e5ca54c9] | 51 | ) |
---|
| 52 | { |
---|
[e1598a6] | 53 | Scheduler_EDF_Context *context = |
---|
| 54 | _Scheduler_EDF_Get_context( scheduler ); |
---|
| 55 | RBTree_Node *first = _RBTree_First( &context->Ready, RBT_LEFT ); |
---|
[beab7329] | 56 | Scheduler_EDF_Node *node = |
---|
| 57 | _RBTree_Container_of(first, Scheduler_EDF_Node, Node); |
---|
| 58 | Thread_Control *heir = node->thread; |
---|
[e5ca54c9] | 59 | |
---|
[24934e36] | 60 | ( void ) the_thread; |
---|
[e5ca54c9] | 61 | |
---|
| 62 | _Scheduler_Update_heir( heir, force_dispatch ); |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | /**@}*/ |
---|
| 66 | |
---|
| 67 | #ifdef __cplusplus |
---|
| 68 | } |
---|
| 69 | #endif |
---|
| 70 | |
---|
| 71 | #endif |
---|
| 72 | /* end of include file */ |
---|