Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1115 → Rev 1116

/demos/trunk/first/cbsstar.c
20,11 → 20,11
 
/*
------------
CVS : $Id: cbsstar.c,v 1.2 2002-10-28 08:16:09 pj Exp $
CVS : $Id: cbsstar.c,v 1.3 2002-11-11 08:17:59 pj Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2002-10-28 08:16:09 $
Revision: $Revision: 1.3 $
Last update: $Date: 2002-11-11 08:17:59 $
------------
 
Read CBSSTAR.h for general details.
130,7 → 130,7
 
PID current; /* the task currently put in execution */
 
QQUEUE tasks; /* a FIFO queue for the tasks handled
IQUEUE tasks; /* a FIFO queue for the tasks handled
using the budget */
};
 
360,9 → 360,6
static void CBSSTAR_task_sleep(LEVEL l, PID p)
{ kern_raise(XINVALID_TASK,exec_shadow); }
 
static void CBSSTAR_task_delay(LEVEL l, PID p, TIME usdelay)
{ kern_raise(XINVALID_TASK,exec_shadow); }
 
static int CBSSTAR_guest_create(LEVEL l, PID p, TASK_MODEL *m)
{
/* A task has been activated for some reason. Basically, the task is
388,7 → 385,7
/* 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 */
qq_insertlast(p,&lev->b[budget->b].tasks);
iq_insertlast(p,&lev->b[budget->b].tasks);
#ifdef CBSSTAR_DEBUG
cbsstar_printf(" ilast");
cbsstar_printq(&lev->b[budget->b].tasks);
426,7 → 423,7
#endif
 
/* check if the buffer has someone else to schedule */
if (qq_queryfirst(&lev->b[lev->tb[p]].tasks) == NIL) {
if (iq_query_first(&lev->b[lev->tb[p]].tasks) == NIL) {
/* the buffer has no tasks! */
lev->b[lev->tb[p]].current = NIL;
}
436,7 → 433,7
struct timespec t;
ll_gettime(TIME_EXACT, &t);
n = qq_getfirst(&lev->b[lev->tb[p]].tasks);
n = iq_getfirst(&lev->b[lev->tb[p]].tasks);
#ifdef CBSSTAR_DEBUG
cbsstar_printf("{p%d n%d}",p,n);
#endif
444,7 → 441,7
}
}
else
qq_extract(p, &lev->b[lev->tb[p]].tasks);
iq_extract(p, &lev->b[lev->tb[p]].tasks);
}
 
static void CBSSTAR_guest_dispatch(LEVEL l, PID p, int nostop)
550,12 → 547,9
static void CBSSTAR_guest_sleep(LEVEL l, PID p)
{ kern_raise(XINVALID_GUEST,exec_shadow); }
 
static void CBSSTAR_guest_delay(LEVEL l, PID p, DWORD tickdelay)
{ kern_raise(XINVALID_GUEST,exec_shadow); }
 
 
 
 
/* Registration functions */
 
/*+ Registration function:
609,7 → 603,6
lev->l.task_endcycle = CBSSTAR_task_endcycle;
lev->l.task_end = CBSSTAR_task_end;
lev->l.task_sleep = CBSSTAR_task_sleep;
lev->l.task_delay = CBSSTAR_task_delay;
 
lev->l.guest_create = CBSSTAR_guest_create;
lev->l.guest_detach = CBSSTAR_guest_detach;
621,7 → 614,6
lev->l.guest_endcycle = CBSSTAR_guest_endcycle;
lev->l.guest_end = CBSSTAR_guest_end;
lev->l.guest_sleep = CBSSTAR_guest_sleep;
lev->l.guest_delay = CBSSTAR_guest_delay;
 
/* fill the CBSSTAR descriptor part */
lev->b = (struct budget_struct *)kern_alloc(sizeof(struct budget_struct)*n);
633,7 → 625,7
lev->b[i].dline_timer = 0;
lev->b[i].avail = 0;
lev->b[i].current = -1;
qq_init(&lev->b[i].tasks);
iq_init(&lev->b[i].tasks, &freedesc, 0);
}
 
lev->n = n;