Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 981 → Rev 982

/shark/trunk/ports/first/modules/edfstar.c
138,7 → 138,7
 
static void EDFSTAR_check_preemption(EDFSTAR_level_des *lev)
{
PID first;
PID first=NIL;
 
#ifdef EDFSTAR_DEBUG
edfstar_printf("(E:chk)");
205,9 → 205,9
break;
 
default:
#ifdef EDFSTAR_DEBUG
// #ifdef EDFSTAR_DEBUG
kern_printf("(E:Dl:%d)",p);
#endif
// #endif
/* else, a deadline miss occurred!!! */
lev->dline_miss[p]++;
TRACER_LOGEVENT(FTrace_EVT_task_deadline_miss,proc_table[p].context,proc_table[p].task_level);
317,6 → 317,7
/* Enable wcet check */
proc_table[p].avail_time = h->wcet;
proc_table[p].wcet = h->wcet;
proc_table[p].status = SLEEP;
 
return 0; /* OK, also if the task cannot be guaranteed... */
}
327,6 → 328,7
struct timespec ty;
TIME tx;
 
 
SUBTIMESPEC(&schedule_time, &lev->cap_lasttime, &ty);
tx = TIMESPEC2USEC(&ty);
 
412,7 → 414,7
level_table[ lev->scheduling_level ]->
private_epilogue(lev->scheduling_level,p);
 
proc_table[exec].status = EDFSTAR_READY;
proc_table[exec].status = EDFSTAR_READY;
} else
level_table[proc_table[exec].task_level]->public_epilogue(proc_table[exec].task_level,p);
 
435,6 → 437,8
if (lev->flag[p] & EDFSTAR_FLAG_SPORADIC) {
if (proc_table[p].status != EDFSTAR_IDLE) {
lev->nact[p]++;
//kern_printf("(Inc nact %d)",p);
//kern_printf("(%d STATUS %d %ds %dns)", p, proc_table[p].status, o->tv_sec, o->tv_nsec/1000);
return;
}
} else {
522,8 → 526,8
if (lev->nact[p] > 0) {
#ifdef EDFSTAR_DEBUG
edfstar_printf2("E%d",p);
#endif
kern_printf("E%d",p);
#endif
/* Pending activation: reactivate the thread!!! */
lev->nact[p]--;
640,7 → 644,10
#endif
 
iq_extract(p,&lev->ready);
level_table[ lev->scheduling_level ]->
private_extract(lev->scheduling_level, p);
 
 
/* we finally put the task in the ready queue */
proc_table[p].status = FREE;
/shark/trunk/ports/first/modules/grubstar.c
142,11 → 142,11
if (lev->Uf < lev->U) lev->Uf += b->Ub;
 
if (b->current == NIL && b->flags) {
if (iq_query_first(&(b->tasks)) != NIL) {
if (iq_query_first(&(b->tasks)) != NIL) {
JOB_TASK_MODEL job;
 
p = iq_getfirst(&b->tasks);
#ifdef GRUBSTAR_DEBUG
kern_printf("%d",p);
#endif
161,6 → 161,7
job_task_default_model(job, b->dline);
job_task_def_noexc(job);
level_table[ lev->scheduling_level ]->
private_insert(lev->scheduling_level, p, (TASK_MODEL *)&job);
221,7 → 222,7
t3.tv_nsec = (t % 1000000) * 1000;
 
#ifdef GRUBSTAR_DEBUG
kern_printf("(GS:Act %d)",p);
kern_printf("(GS:Act %d avail %d)",p, b->avail);
#endif
 
TRACER_LOGEVENT(FTrace_EVT_server_active,proc_table[p].context,(unsigned int)b);
274,18 → 275,20
TIME tx;
struct budget_struct *b = &lev->b[lev->tb[p]];
TIME t;
struct timespec t2,t3;
struct timespec t2,t3,t4;
 
if (b->vtimer!=NIL) kern_event_delete(b->vtimer);
b->vtimer=NIL;
tx = 0;
 
if (lev->cap_lev != NIL) {
kern_event_delete(lev->cap_lev);
lev->cap_lev = NIL;
SUBTIMESPEC(&schedule_time, &lev->cap_lasttime, &ty);
tx = TIMESPEC2USEC(&ty);
}
 
SUBTIMESPEC(&schedule_time, &lev->cap_lasttime, &ty);
tx = TIMESPEC2USEC(&ty);
// recalculate the new effective last reclaiming
mul32div32to32(tx,(lev->U - lev->Uf),lev->U,b->last_reclaiming);
433,13 → 436,16
/* This is the first task in the budget,
the task have to be inserted into the master module */
struct timespec t;
kern_gettime(&t);
GRUBSTAR_activation(lev,p,&t);
 
} else {
/* The budget is not empty, another task is already into the
master module, so the task is inserted at the end of the budget
queue */
iq_insertlast(p,&lev->b[budget->b].tasks);
kern_printf("(NP act %d cur %d, flag %d)",p, lev->b[budget->b].current, lev->b[budget->b].flags );
}
 
#ifdef GRUBSTAR_DEBUG
467,6 → 473,9
level_table[ lev->scheduling_level ]->
private_extract(lev->scheduling_level, p);
 
iq_extract(p, &lev->b[lev->tb[p]].tasks);
//lev->b[lev->tb[p]].current = NIL;
 
/* check if the buffer has someone else to schedule */
if (iq_query_first(&lev->b[lev->tb[p]].tasks) == NIL) {
/* the buffer has no tasks! */
569,11 → 578,15
/* we kill the current activation */
#ifdef GRUBSTAR_DEBUG
kern_printf("(GS:HRExt:%d)",p);
#endif
#endif
level_table[ lev->scheduling_level ]->
private_extract(lev->scheduling_level, p);
//iq_extract(p, &b->tasks);
 
iq_insertfirst(p, &b->tasks);
//iq_insertfirst(p, &b->tasks);
b->current = NIL;
}
668,6 → 681,7
lev->b[i].negotiation = 0;
lev->b[i].loc_sched_level=-1;
iq_init(&lev->b[i].tasks, NULL, 0);
}
 
lev->n = n;