Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 265 → Rev 266

/shark/trunk/ports/first/modules/grubstar.c
39,7 → 39,7
 
#include "grubstar.h"
 
#define GRUBSTAR_DEBUG
//#define GRUBSTAR_DEBUG
 
/* this structure contains the status for a single budget */
struct budget_struct {
165,7 → 165,7
#endif
 
b->vtimer = NIL;
if (b->current != NIL && iq_query_first(&(b->tasks)) != NIL) {
if (b->current == NIL && iq_query_first(&(b->tasks)) == NIL) {
bandwidth_t bw;
 
b->flags=GRUBSTAR_RECLAIMING;
253,10 → 253,14
 
SUBTIMESPEC(&schedule_time, &cap_lasttime, &ty);
tx = TIMESPEC2USEC(&ty);
b->avail -= (int)((long long)tx * (long long)lev->Uf / (int)lev->U);
#ifdef GRUBSTAR_DEBUG
kern_printf("(GS:Cap p%d av=%d)", p, b->avail);
#endif
 
b->avail -= (tx-(unsigned int)((long long)tx * (long long)(lev->U - lev->Uf)/MAX_BANDWIDTH));
 
#ifdef GRUBSTAR_DEBUG
kern_printf("(GS:Cap p%d av=%d Uf=%u U=%u)", p, b->avail,lev->Uf, lev->U);
kern_printf("(GS:Cap p%d av=%d Uf=%u U=%u, tx=%d)", p, b->avail,lev->Uf, lev->U,tx);
#endif
 
if (b->avail <= 0) b->flags = GRUBSTAR_NOACTIVE;