Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 297 → Rev 298

/shark/trunk/ports/first/modules/edfstar.c
670,7 → 670,7
lev->activated = NIL;
 
lev->scheduling_level = master;
lev->cap_lev=NIL;
lev->cap_lev = NIL;
NULL_TIMESPEC(&lev->cap_lasttime);
 
return l;
/shark/trunk/ports/first/modules/grubstar.c
236,7 → 236,7
b->avail -= tx - b->last_reclaiming;
 
#ifdef GRUBSTAR_DEBUG
//kern_printf("(GS:Cap p%d av=%d Uf=%u U=%u, tx=%d)", p, b->avail, lev->Uf, lev->U,(int)tx);
kern_printf("(GS:Cap p%d av=%d Uf=%u U=%u, tx=%d)", p, b->avail, lev->Uf, lev->U,(int)tx);
#endif
 
if (b->avail <= 0) b->flags = GRUBSTAR_NOACTIVE;
258,32 → 258,14
}
}
 
 
/* The on-line guarantee is enabled only if the appropriate flag is set... */
static int GRUBSTAR_public_guarantee(LEVEL l, bandwidth_t *freebandwidth)
{
GRUBSTAR_level_des *lev = (GRUBSTAR_level_des *)(level_table[l]);
 
#ifdef GRUBSTAR_DEBUG
kern_printf("(GS:Gua)");
#endif
 
if (*freebandwidth >= lev->U) {
*freebandwidth -= lev->U;
return 1;
}
else
return 0;
}
 
static void capacity_handler(void *l)
{
GRUBSTAR_level_des *lev = l;
lev->cap_lev = NIL;
#ifdef GRUBSTAR_DEBUG
kern_printf("(*)");
#endif
#ifdef GRUBSTAR_DEBUG
kern_printf("(*)");
#endif
event_need_reschedule();
}
292,12 → 274,12
{
GRUBSTAR_level_des *lev = (GRUBSTAR_level_des *)(level_table[l]);
struct budget_struct *b=&lev->b[lev->tb[p]];
JOB_TASK_MODEL job;
if ( TIMESPEC_A_LT_B(&b->dline, &schedule_time)) {
JOB_TASK_MODEL job;
if ( TIMESPEC_A_LT_B(&b->dline, &schedule_time)) {
#ifdef GRUBSTAR_DEBUG
kern_printf("(GS:Eli:%d)",p);
 
#endif
if (lev->cap_lev!=NIL) {
kern_event_delete(lev->cap_lev);
lev->cap_lev=NIL;
307,7 → 289,7
level_table[ lev->scheduling_level ]->
private_extract(lev->scheduling_level, p);
/* we modify the deadline ... */
TIMESPEC_ASSIGN(&b->dline, &schedule_time);
kern_gettime(&b->dline);
ADDUSEC2TIMESPEC(b->T, &b->dline);
 
/* and the capacity */
471,9 → 453,6
if (p==exec) b = &lev->b[lev->tb[p]];
else if (lev->tb[exec]!=NIL) {
b = &lev->b[lev->tb[exec]];
#ifdef GRUBSTAR_DEBUG
kern_printf("(ex%d, c%d)***************************", exec, p);
#endif
p=exec;
skip_epilog=1;
}
480,9 → 459,7
else return;
 
GRUBSTAR_account_capacity(lev,p);
// L'evento di capacità va cancellato perchè sarà ripristinato nella successiva dispatch
/* we have to check if the capacity is still available */
GRUBSTAR_account_capacity(lev,p);
if (b->flags) {
 
/* there is capacity available, maybe it is simply a preemption;
493,9 → 470,9
} else {
/* we kill the current activation */
#ifdef GRUBSTAR_DEBUG
kern_printf("(GS:HRExt:%d",p);
#endif
#ifdef GRUBSTAR_DEBUG
kern_printf("(GS:HRExt:%d",p);
#endif
level_table[ lev->scheduling_level ]->
private_extract(lev->scheduling_level, p);
 
554,7 → 531,7
lev->l.private_dispatch = GRUBSTAR_private_dispatch;
lev->l.private_epilogue = GRUBSTAR_private_epilogue;
 
lev->l.public_guarantee = GRUBSTAR_public_guarantee;
lev->l.public_guarantee = NULL;
lev->l.public_message = GRUBSTAR_public_message;
 
lev->b = (struct budget_struct *)kern_alloc(sizeof(struct budget_struct)*n);
565,7 → 542,7
lev->b[i].Ub = 0;
NULL_TIMESPEC(&lev->b[i].dline);
lev->b[i].dline_timer = NIL;
lev->b[i].vtimer=NIL;
lev->b[i].vtimer = NIL;
lev->b[i].avail = 0;
lev->b[i].current = -1;
lev->b[i].flags = GRUBSTAR_ACTIVE;
660,10 → 637,16
{
 
GRUBSTAR_level_des *lev = (GRUBSTAR_level_des *)(level_table[l]);
bandwidth_t b;
 
b = (MAX_BANDWIDTH / lev->b[budget].T) * lev->b[budget].Q;
 
lev->U -= b;
 
lev->b[budget].Q = Q;
lev->b[budget].T = T;
lev->b[budget].Ub = (MAX_BANDWIDTH / T) * Q;
lev->U += lev->b[budget].Ub;
 
return 0;
 
/shark/trunk/ports/first/modules/posixstar.c
89,7 → 89,6
{
POSIXSTAR_level_des *lev = l;
lev->cap_lev = NIL;
//kern_printf("(/)");
event_need_reschedule();
}
/* the private scheduler choice a task and insert in cbsstar module */
122,7 → 121,7
 
if ((proc_table[p].control /* & CONTROL_CAP */) &&
(proc_table[p].avail_time <= 0)) {
if (proc_table[p].avail_time<=0)
while (proc_table[p].avail_time<=0)
proc_table[p].avail_time += proc_table[p].wcet;
iq_extract(p,&lev->ready[prio]);
iq_insertlast(p,&lev->ready[prio]);
499,7 → 498,7
lev->slice = slice;
lev->activated = NIL;
lev->scheduling_level = master;
lev->cap_lev=NIL;
lev->cap_lev = NIL;
NULL_TIMESPEC(&lev->cap_lasttime);
 
return l;
/shark/trunk/ports/first/first-server.c
139,7 → 139,6
void *local_scheduler_arg)
{
 
NRT_TASK_MODEL nrt;
int local_scheduler_level,scheduler_id;
 
#ifdef FSF_DEBUG
157,15 → 156,10
switch (scheduler_id) {
case FSF_SCHEDULER_POSIX:
 
if (local_scheduler_arg == NULL) {
nrt_task_default_model(nrt);
nrt_task_def_save_arrivals(nrt);
nrt_task_def_arg(nrt,arg);
nrt_task_def_ctrl_jet(nrt);
nrt_task_def_level(nrt,local_scheduler_level);
nrt_task_def_arg(*(NRT_TASK_MODEL *)(local_scheduler_arg),arg);
nrt_task_def_level(*(NRT_TASK_MODEL *)(local_scheduler_arg),local_scheduler_level);
 
*thread = task_create("POSIXSTAR", thread_code, &nrt, NULL);
}
*thread = task_create("POSIXSTAR", thread_code, local_scheduler_arg, NULL);
if (*thread == NIL) {
#ifdef FSF_DEBUG
kern_printf("(FSF:Error creating thread)");