188,6 → 188,7 |
EDFSTAR_level_des *lev; |
|
lev = (EDFSTAR_level_des *)level_table[proc_table[p].task_level]; |
lev->deadline_timer[p] = NIL; |
|
switch (proc_table[p].status) { |
case EDFSTAR_IDLE: |
378,13 → 379,13 |
if (proc_table[p].status != SLEEP) { |
/* a periodic task cannot be activated when it is already active */ |
/* but aperiodic task can be reactivate before */ |
if (lev->flag[p] & EDFSTAR_FLAG_SPORADIC) { |
if (proc_table[p].status != EDFSTAR_IDLE) { |
if (proc_table[p].status != EDFSTAR_IDLE) { |
if (lev->flag[p] & EDFSTAR_FLAG_SPORADIC) { |
lev->nact[p]++; |
return; |
} |
} else { |
kern_raise(XACTIVATION,p); |
} else { |
kern_raise(XACTIVATION,p); |
} |
} |
} |
|
479,6 → 480,7 |
/* count the deadline miss */ |
lev->dline_miss[p]++; |
kern_event_delete(lev->deadline_timer[p]); |
lev->deadline_timer[p] = NIL; |
} |
|
} else { |
488,10 → 490,15 |
#endif |
|
/* the task has terminated his job before it consume the wcet. All OK! */ |
proc_table[p].status = EDFSTAR_IDLE; |
if (lev->flag[p] & EDFSTAR_FLAG_SPORADIC) |
proc_table[p].status = SLEEP; |
else |
proc_table[p].status = EDFSTAR_IDLE; |
|
if (lev->flag[p] & EDFSTAR_FLAG_SPORADIC && lev->deadline_timer[p] != NIL) |
if (lev->flag[p] & EDFSTAR_FLAG_SPORADIC && lev->deadline_timer[p] != NIL) { |
kern_event_delete(lev->deadline_timer[p]); |
lev->deadline_timer[p] = NIL; |
} |
|
/* and finally, a preemption check! */ |
EDFSTAR_check_preemption(lev); |
534,6 → 541,7 |
|
if (lev->deadline_timer[p] != -1) { |
kern_event_delete(lev->deadline_timer[p]); |
lev->deadline_timer[p] = NIL; |
} |
|
/* and finally, a preemption check! (it will also call guest_end) */ |