Subversion Repositories shark

Compare Revisions

Regard whitespace Rev 1176 → Rev 1175

/demos/trunk/first/posixstar.c
File deleted
/demos/trunk/first/makefile
7,7 → 7,7
endif
include $(BASE)/config/config.mk
 
PROGS= test1 test2 test3 test4 test5 test6 test7 testiq
PROGS= test1 test2 test3 test4 test5 test6 testiq
 
include $(BASE)/config/example.mk
 
29,8 → 29,5
test6:
make -f $(SUBMAKE) APP=test6 INIT= OTHEROBJS="rmstar.o cbsstar.o" OTHERINCL= SHARKOPT=__OLDCHAR__
 
test7:
make -f $(SUBMAKE) APP=test7 INIT= OTHEROBJS="posixstar.o cbsstar.o" OTHERINCL= SHARKOPT=__OLDCHAR__
 
#testiq:
# make -f $(SUBMAKE) APP=testiq INIT= OTHEROBJS="iqueue.o " OTHERINCL=
/demos/trunk/first/cbsstar.c
20,11 → 20,11
 
/*
------------
CVS : $Id: cbsstar.c,v 1.5 2003-06-18 08:13:01 trimarchi Exp $
CVS : $Id: cbsstar.c,v 1.4 2003-01-07 17:10:16 pj Exp $
 
File: $File$
Revision: $Revision: 1.5 $
Last update: $Date: 2003-06-18 08:13:01 $
Revision: $Revision: 1.4 $
Last update: $Date: 2003-01-07 17:10:16 $
------------
 
Read CBSSTAR.h for general details.
75,8 → 75,10
* DEBUG stuffs begin
*/
 
#ifdef CBSSTAR_DEBUG_OLD
//#define CBSSTAR_DEBUG
 
#ifdef CBSSTAR_DEBUG
 
static __inline__ void fake_printf(char *fmt, ...) {}
 
//#define cbsstar_printf kern_printf
88,7 → 90,7
#define cbsstar_printf3 fake_printf
 
#if 0
void cbsstar_printq(IQUEUE *q)
void cbsstar_printq(QQUEUE *q)
{
PID p;
kern_printf("[");
143,8 → 145,6
 
bandwidth_t U; /*+ the used bandwidth by the server +*/
int cap_lev;
 
LEVEL scheduling_level;
 
} CBSSTAR_level_des;
189,7 → 189,6
/* and the capacity */
b->avail = b->Q;
 
 
#ifdef CBSSTAR_DEBUG
cbsstar_printf3("±%d±",lev->tb[p]);
cbsstar_printblob(lev->tb[p]);
202,7 → 201,7
#ifdef CBSSTAR_DEBUG
cbsstar_printf("(C:iact p%d %ld.%ld av=%d)",p,b->dline.tv_sec,b->dline.tv_nsec/1000, b->avail);
#endif
//kern_printf("Pid %d, Act %d, Dd %d", p,acttime->tv_nsec/1000,(b->dline).tv_nsec/1000);
 
/* and, finally, we reinsert the task in the master level */
job_task_default_model(job, b->dline);
job_task_def_noexc(job);
277,6 → 276,7
cbsstar_printf3("±%d±",lev->tb[p]);
cbsstar_printblob(lev->tb[p]);
#endif
 
/* and, finally, we reinsert the task in the master level */
job_task_default_model(job, b->dline);
job_task_def_noexc(job);
292,7 → 292,6
return 0;
}
 
 
static void CBSSTAR_private_insert(LEVEL l, PID p, TASK_MODEL *m)
{
/* A task has been activated for some reason. Basically, the task is
382,14 → 381,6
iq_extract(p, &lev->b[lev->tb[p]].tasks);
}
 
static void capacity_handler()
{
//kern_printf("!");
event_need_reschedule();
}
 
 
static void CBSSTAR_private_dispatch(LEVEL l, PID p, int nostop)
{
CBSSTAR_level_des *lev = (CBSSTAR_level_des *)(level_table[l]);
413,7 → 404,7
if (!nostop) {
TIMESPEC_ASSIGN(&ty, &schedule_time);
ADDUSEC2TIMESPEC(lev->b[lev->tb[p]].avail,&ty);
lev->cap_lev = kern_event_post(&ty, capacity_handler, NULL);
cap_timer = kern_event_post(&ty, capacity_timer, NULL);
}
}
 
428,10 → 419,6
 
CBSSTAR_account_capacity(lev,p);
 
if (lev->cap_lev!=NIL)
kern_event_delete(lev->cap_lev);
lev->cap_lev=NIL;
 
/* we have to check if the capacity is still available */
if (b->avail > 0) {
/* there is capacity available, maybe it is simply a preemption;
439,10 → 426,9
level_table[ lev->scheduling_level ]->
private_epilogue(lev->scheduling_level,p);
#ifdef CBSSTAR_DEBUG
cbsstar_printf(" *av=%d", b->avail);
cbsstar_printf2(" *av=%d", b->avail);
#endif
} else {
 
/* The capacity is exausted; the deadline have to be postponed and
the task have to be reinserted in the master module */
JOB_TASK_MODEL job;
458,12 → 444,13
ADDUSEC2TIMESPEC(b->T, &b->dline);
b->avail += b->Q;
#ifdef CBSSTAR_DEBUG
cbsstar_printf("±%d±",b->avail);
cbsstar_printf3("±%d±",lev->tb[p]);
cbsstar_printblob(lev->tb[p]);
#endif
}
 
#ifdef CBSSTAR_DEBUG
kern_printf(" %ld.%ld av=%d",b->dline.tv_sec,b->dline.tv_nsec/1000, b->avail);
cbsstar_printf2(" %ld.%ld av=%d",b->dline.tv_sec,b->dline.tv_nsec/1000, b->avail);
#endif
/* and, finally, we reinsert the task in the master level */
475,7 → 462,6
#ifdef CBSSTAR_DEBUG
cbsstar_printf(")");
#endif
}
 
 
524,11 → 510,12
 
lev->n = n;
lev->freebudgets = 0;
 
for (i=0; i<MAX_PROC; i++)
lev->tb[i] = NIL;
 
lev->U = 0;
lev->cap_lev=NIL;
 
lev->scheduling_level = master;
 
return l;
/demos/trunk/first/edfstar.c
18,11 → 18,11
 
/**
------------
CVS : $Id: edfstar.c,v 1.5 2003-06-18 08:13:02 trimarchi Exp $
CVS : $Id: edfstar.c,v 1.4 2003-01-07 17:10:16 pj Exp $
 
File: $File$
Revision: $Revision: 1.5 $
Last update: $Date: 2003-06-18 08:13:02 $
Revision: $Revision: 1.4 $
Last update: $Date: 2003-01-07 17:10:16 $
------------
**/
 
264,7 → 264,7
return 0; /* OK, also if the task cannot be guaranteed... */
}
 
static int EDFSTAR_public_eligible(LEVEL l, PID p)
static int EDFSTAR_task_eligible(LEVEL l, PID p)
{
EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]);
 
586,7 → 586,6
lev->l.private_epilogue = EDFSTAR_private_epilogue;
 
lev->l.public_guarantee = NULL;
lev->l.public_eligible = EDFSTAR_public_eligible;
lev->l.public_create = EDFSTAR_public_create;
lev->l.public_end = EDFSTAR_public_end;
lev->l.public_dispatch = EDFSTAR_public_dispatch;