Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 673 → Rev 674

/shark/trunk/kernel/modules/elastic.c
102,15 → 102,29
struct timespec *acttime)
{
JOB_TASK_MODEL job;
/*
job_task_default_model(job, lev->cbs_dline[p]);
job_task_def_noexc(job);
 
/* Job deadline */
TIMESPEC_ASSIGN(&(lev->elist[p].dline),acttime);
ADDUSEC2TIMESPEC(lev->elist[p].period,&(lev->elist[p].dline));
 
/* Job insertion */
job_task_default_model(job, lev->elist[p].dline);
level_table[ lev->scheduling_level ]->
private_insert(lev->scheduling_level, p, (TASK_MODEL *)&job);
 
*/
}
 
static void ELASTIC_timer_act(void *arg) {
PID p = (PID)(arg);
ELASTIC_level_des *lev;
struct timespec acttime;
kern_gettime(&acttime);
lev = (ELASTIC_level_des *)level_table[proc_table[p].task_level];
ELASTIC_activation(lev, p, &acttime);
}
 
/* The on-line guarantee is enabled only if the appropriate flag is set... */
157,10 → 171,9
return -1;
}
 
lev->elist[p].flags |= ELASTIC_PRESENT;
 
proc_table[p].avail_time = elastic->wcet;
proc_table[p].wcet = elastic->wcet;
proc_table[p].control &= ~CONTROL_CAP;
proc_table[p].control |= CONTROL_CAP;
 
if (elastic->arrivals == SAVE_ARRIVALS)
lev->elist[p].flags |= ELASTIC_SAVE_ARRIVALS;
188,8 → 201,10
static void ELASTIC_public_dispatch(LEVEL l, PID p, int nostop)
{
ELASTIC_level_des *lev = (ELASTIC_level_des *)(level_table[l]);
 
level_table[ lev->scheduling_level ]->
private_dispatch(lev->scheduling_level,p,nostop);
 
}
 
static void ELASTIC_public_epilogue(LEVEL l, PID p)
197,6 → 212,17
ELASTIC_level_des *lev = (ELASTIC_level_des *)(level_table[l]);
JOB_TASK_MODEL job;
 
/* check if the wcet is finished... */
if (proc_table[p].avail_time <= 0) {
TRACER_LOGEVENT(FTrace_EVT_task_wcet_violation,(unsigned short int)proc_table[p].context,0);
kern_raise(XWCET_VIOLATION,p);
}
level_table[ lev->scheduling_level ]->
private_epilogue(lev->scheduling_level,p);
 
}
 
static void ELASTIC_public_activate(LEVEL l, PID p, struct timespec *t)
203,6 → 229,33
{
ELASTIC_level_des *lev = (ELASTIC_level_des *)(level_table[l]);
 
#ifdef ELASTIC_DEBUG
printk("(ELASTIC:Act:%d)", p);
#endif
/* check if we are not in the SLEEP state */
if (proc_table[p].status != SLEEP) {
if (lev->flags & ELASTIC_SAVE_ARRIVALS) {
/* skip the sporadic job, but increase a counter */
#ifdef ELASTIC_DEBUG
printk("(ELASTIC:SaveAct:%d)", p);
#endif
lev->elist[p].nact++;
}
return;
}
 
ELASTIC_activation(lev,p,t);
 
/* Next activation */
kern_event_post(&(lev->elist[p].dline), ELASTIC_timer_act, (void *)(p));
 
}
 
static void ELASTIC_public_unblock(LEVEL l, PID p)