X-Git-Url: http://rtime.felk.cvut.cz/gitweb/rtems-pluggable-edf.git/blobdiff_plain/68c82034021dc770d88b4033ebb81cb73a329cef..e0308b07954f8077977cd28d6d23da75af828082:/src/edf/scheduler_edf.c diff --git a/src/edf/scheduler_edf.c b/src/edf/scheduler_edf.c index 5568009..51f7652 100644 --- a/src/edf/scheduler_edf.c +++ b/src/edf/scheduler_edf.c @@ -10,21 +10,27 @@ #include -/** - * The threads wanted to be served on a priority base will be assigned the very - * longest deadlines. - */ -// inline void edf_initial_priority_shift(Priority_Control *prio) { -// prio += EDF_ABS_DEADLINE_MAX + 1; -// } - -void edf_next_period(Thread_Control *the_thread) { +void edf_next_period(void) { + Thread_Control *the_thread = _Per_CPU_Information.executing; RBT_Node *node = (RBT_Node*)the_thread->scheduler_info; the_thread->real_priority = the_thread->current_priority = (_Watchdog_Ticks_since_boot + node->rel_deadline) % EDF_HYBRID_MASK; - node->abs_deadline = the_thread->current_priority; + _Scheduler_edf_Update(the_thread); } +void edf_deadline_init(uint32_t __rel_deadline__) { + Thread_Control *the_thread = _Per_CPU_Information.executing; + RBT_Node *node = (RBT_Node*)the_thread->scheduler_info; + node->rel_deadline = __rel_deadline__; +} + +void edf_deadline_cancel(void) { + Thread_Control *the_thread = _Per_CPU_Information.executing; + the_thread->real_priority = the_thread->Start.initial_priority + EDF_HYBRID_MASK; + the_thread->current_priority = the_thread->real_priority; + _Scheduler_edf_Update(the_thread); +} +//======================================================================================= int _Scheduler_edf_Priority_compare (Priority_Control p1, Priority_Control p2) { uint32_t time = _Watchdog_Ticks_since_boot;