/shark/trunk/ports/first/first-sync.c |
---|
113,7 → 113,7 |
*was_budget_overran = false; |
if (at_absolute_time != NULL) |
kern_event_post(at_absolute_time, (void (*)(void *))&task_activate, (void *)(exec_shadow)); |
kern_event_post(at_absolute_time, (void (*)(void *))task_activate, (void *)(exec_shadow)); |
#ifdef FSF_DEBUG |
if (at_absolute_time != NULL) |
/shark/trunk/ports/first/modules/edfstar.c |
---|
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) */ |
/shark/trunk/ports/first/modules/rmstar.c |
---|
185,6 → 185,7 |
#endif |
lev = (RMSTAR_level_des *)level_table[proc_table[p].task_level]; |
lev->deadline_timer[p] = NIL; |
switch (proc_table[p].status) { |
case RMSTAR_IDLE: |
368,13 → 369,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] & RMSTAR_FLAG_SPORADIC) { |
if (proc_table[p].status != RMSTAR_IDLE) { |
if (proc_table[p].status != RMSTAR_IDLE) { |
if (lev->flag[p] & RMSTAR_FLAG_SPORADIC) { |
lev->nact[p]++; |
return; |
} |
} else { |
kern_raise(XACTIVATION,p); |
} else { |
kern_raise(XACTIVATION,p); |
} |
} |
} |
468,6 → 469,7 |
/* count the deadline miss */ |
lev->dline_miss[p]++; |
kern_event_delete(lev->deadline_timer[p]); |
lev->deadline_timer[p] = NIL; |
} |
} |
475,11 → 477,16 |
#ifdef RMSTAR_DEBUG |
rmstar_printf("e%d",p); |
#endif |
if (lev->flag[p] & RMSTAR_FLAG_SPORADIC && lev->deadline_timer[p] != NIL) |
if (lev->flag[p] & RMSTAR_FLAG_SPORADIC && lev->deadline_timer[p] != NIL) { |
kern_event_delete(lev->deadline_timer[p]); |
lev->deadline_timer[p] = NIL; |
} |
/* the task has terminated his job before it consume the wcet. All OK! */ |
proc_table[p].status = RMSTAR_IDLE; |
if (lev->flag[p] & RMSTAR_FLAG_SPORADIC) |
proc_table[p].status = SLEEP; |
else |
proc_table[p].status = RMSTAR_IDLE; |
/* and finally, a preemption check! */ |
RMSTAR_check_preemption(lev); |
518,6 → 525,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) */ |