262,7 → 262,7 |
kern_gettime(&acttime); |
SUBTIMESPEC(&acttime, &(lev->act_time), &time); |
delta_time = TIMESPEC2USEC(&time); |
mul32div32to32(delta_time, (MAX_BANDWIDTH-lev->U), MAX_BANDWIDTH, delta_capacity); |
mul32div32to32(delta_time, (1-lev->U), MAX_BANDWIDTH, delta_capacity); |
lev->avail -= delta_capacity; |
|
//lev->avail -= TIMESPEC2USEC(&time); |
337,7 → 337,7 |
/* Registration functions */ |
|
/*+ Registration function: +*/ |
LEVEL INTDRIVE_register_level(TIME capacity, TIME q_theta, int U, int flags) |
LEVEL INTDRIVE_register_level(TIME capacity, TIME replenish_period, int flags) |
{ |
LEVEL l; /* the level that we register */ |
INTDRIVE_level_des *lev; |
363,15 → 363,14 |
NULL_TIMESPEC(&(lev->act_time)); |
|
lev->capacity = capacity; |
//lev->replenish_period = replenish_period; |
lev->replenish_timer = NIL; |
//lev->wcet_timer = NIL; |
lev->flags = flags; |
lev->act_number = 0; |
lev->avail = 0; |
lev->q_theta = q_theta; |
mul32div32to32(MAX_BANDWIDTH,U,10000,lev->U); |
|
//!!!calcolare parametro |
intdrive_taskinit(10000); |
lev->q_theta = capacity; |
mul32div32to32(MAX_BANDWIDTH,lev->capacity,replenish_period,lev->U); |
|
return l; |
} |