/demos/trunk/static/static.c |
---|
18,11 → 18,11 |
/** |
------------ |
CVS : $Id: static.c,v 1.2 2002-10-28 08:15:23 pj Exp $ |
CVS : $Id: static.c,v 1.3 2002-11-11 07:55:13 pj Exp $ |
File: $File$ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2002-10-28 08:15:23 $ |
Revision: $Revision: 1.3 $ |
Last update: $Date: 2002-11-11 07:55:13 $ |
------------ |
**/ |
68,7 → 68,7 |
typedef struct { |
level_des l; /*+ the standard level descriptor +*/ |
QUEUE mytable; |
IQUEUE mytable; |
PID currenttask; |
87,7 → 87,7 |
lev->currenttask = p; |
event_need_reschedule(); |
STATIC_printf("(o p%d t%d)", p, (int)proc_table[p].timespec_priority.tv_sec); |
// STATIC_printf("(o p%d t%d)", p, (int)proc_table[p].timespec_priority.tv_sec); |
} |
static void STATIC_activateall(STATIC_level_des *lev) |
97,15 → 97,15 |
STATIC_printf("(A "); |
for (my_table_index = (PID)lev->mytable; |
for (my_table_index = iq_query_first(&lev->mytable); |
my_table_index != NIL; |
my_table_index = proc_table[my_table_index].next) { |
ADDTIMESPEC(&lev->ref,&proc_table[my_table_index].timespec_priority,&x); |
my_table_index = iq_query_next(my_table_index, &lev->mytable)) { |
ADDTIMESPEC(&lev->ref,iq_query_timespec(my_table_index, &lev->mytable),&x); |
kern_event_post(&x, STATIC_offset_activate,(void *)my_table_index); |
STATIC_printf("|p%d t%d ", |
my_table_index, |
(int)proc_table[my_table_index].timespec_priority.tv_sec); |
(int)iq_query_timespec(my_table_index, &lev->mytable)->tv_sec); |
} |
STATIC_printf(")"); |
171,9 → 171,9 |
STATIC_TASK_MODEL *h = (STATIC_TASK_MODEL *)m; |
proc_table[p].timespec_priority.tv_sec = h->offset.tv_sec; |
proc_table[p].timespec_priority.tv_nsec = h->offset.tv_nsec; |
q_timespec_insert(p,&lev->mytable); |
iq_query_timespec(p, &lev->mytable)->tv_sec = h->offset.tv_sec; |
iq_query_timespec(p, &lev->mytable)->tv_nsec = h->offset.tv_nsec; |
iq_timespec_insert(p,&lev->mytable); |
return 0; /* OK, also if the task cannot be guaranteed... */ |
} |
220,19 → 220,16 |
lev->currenttask = NIL; |
q_extract(p,&lev->mytable); |
iq_extract(p,&lev->mytable); |
/* we finally put the task in the ready queue */ |
proc_table[p].status = FREE; |
q_insertfirst(p,&freedesc); |
iq_insertfirst(p,&freedesc); |
} |
static void STATIC_task_sleep(LEVEL l, PID p) |
{ kern_raise(XINVALID_TASK,exec_shadow); } |
static void STATIC_task_delay(LEVEL l, PID p, TIME usdelay) |
{ kern_raise(XINVALID_TASK,exec_shadow); } |
/* Guest Functions |
These functions manages a JOB_TASK_MODEL, that is used to put |
a guest task in the STATIC ready queue. */ |
267,9 → 264,6 |
static void STATIC_guest_sleep(LEVEL l, PID p) |
{ kern_raise(XINVALID_GUEST,exec_shadow); } |
static void STATIC_guest_delay(LEVEL l, PID p, TIME usdelay) |
{ kern_raise(XINVALID_GUEST,exec_shadow); } |
/* Registration functions */ |
/*+ Registration function: |
317,7 → 311,6 |
lev->l.task_endcycle = STATIC_task_endcycle; |
lev->l.task_end = STATIC_task_end; |
lev->l.task_sleep = STATIC_task_sleep; |
lev->l.task_delay = STATIC_task_delay; |
lev->l.guest_create = STATIC_guest_create; |
lev->l.guest_detach = STATIC_guest_detach; |
329,11 → 322,10 |
lev->l.guest_endcycle = STATIC_guest_endcycle; |
lev->l.guest_end = STATIC_guest_end; |
lev->l.guest_sleep = STATIC_guest_sleep; |
lev->l.guest_delay = STATIC_guest_delay; |
/* fill the STATIC descriptor part */ |
lev->mytable = NIL; |
iq_init(&lev->mytable, &freedesc, 0); |
lev->currenttask = NIL; |
NULL_TIMESPEC(&lev->hp); |
/demos/trunk/static/test1st.c |
---|
16,11 → 16,11 |
/** |
------------ |
CVS : $Id: test1st.c,v 1.1.1.1 2002-09-02 09:37:48 pj Exp $ |
CVS : $Id: test1st.c,v 1.2 2002-11-11 07:55:13 pj Exp $ |
File: $File$ |
Revision: $Revision: 1.1.1.1 $ |
Last update: $Date: 2002-09-02 09:37:48 $ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2002-11-11 07:55:13 $ |
------------ |
78,7 → 78,7 |
STATIC_TASK_MODEL m; |
struct timespec my_time, h, o, fineprg; |
struct timespec my_time, h, o; |
my_time.tv_nsec=0; |
/demos/trunk/cash/cash.c |
---|
20,11 → 20,11 |
/** |
------------ |
CVS : $Id: cash.c,v 1.2 2002-10-28 08:14:39 pj Exp $ |
CVS : $Id: cash.c,v 1.3 2002-11-11 07:56:31 pj Exp $ |
File: $File$ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2002-10-28 08:14:39 $ |
Revision: $Revision: 1.3 $ |
Last update: $Date: 2002-11-11 07:56:31 $ |
------------ |
This file contains the aperiodic server CBS (Total Bandwidth Server) |
78,7 → 78,6 |
/*+ Status used in the level +*/ |
#define CBSGHD_IDLE APER_STATUS_BASE /*+ waiting the activation +*/ |
#define CBSGHD_ZOMBIE APER_STATUS_BASE+1 /*+ waiting the period end +*/ |
#define CBSGHD_DELAY APER_STATUS_BASE+2 /*+ waiting the delay end +*/ |
/* structure of an element of the capacity queue */ |
struct cap_queue { |
288,7 → 287,6 |
switch (status) { |
case CBSGHD_IDLE : return "CBSGHD_Idle"; |
case CBSGHD_ZOMBIE : return "CBSGHD_Zombie"; |
case CBSGHD_DELAY : return "CBSGHD_Delay"; |
default : return "CBSGHD_Unknown"; |
} |
} |
498,7 → 496,7 |
/* we finally put the task in the FREE status */ |
proc_table[p].status = FREE; |
q_insertfirst(p,&freedesc); |
iq_insertfirst(p,&freedesc); |
/* and free the allocated bandwidth */ |
lev->U -= (MAX_BANDWIDTH/lev->period[p]) * lev->cnormal[p]; |
655,14 → 653,6 |
return 0; /* if the task p is chosen, it is always eligible */ |
} |
#ifdef __TEST1__ |
extern int testactive; |
extern struct timespec s_stime[]; |
extern TIME s_curr[]; |
extern TIME s_PID[]; |
extern int useds; |
#endif |
static void CBSGHD_task_dispatch(LEVEL l, PID p, int nostop) |
{ |
CBSGHD_level_des *lev = (CBSGHD_level_des *)(level_table[l]); |
669,15 → 659,6 |
level_table[ lev->scheduling_level ]-> |
guest_dispatch(lev->scheduling_level,p,nostop); |
#ifdef __TEST1__ |
if (testactive) |
{ |
TIMESPEC_ASSIGN(&s_stime[useds], &schedule_time); |
s_curr[useds] = proc_table[p].avail_time; |
s_PID[useds] = p; |
useds++; |
} |
#endif |
} |
static void CBSGHD_task_epilogue(LEVEL l, PID p) |
835,13 → 816,6 |
kern_raise(XINVALID_TASK,p); |
} |
static void CBSGHD_task_delay(LEVEL l, PID p, TIME usdelay) |
{ |
printk("CBSGHD_task_delay\n"); |
kern_raise(XINVALID_TASK,p); |
} |
static int CBSGHD_guest_create(LEVEL l, PID p, TASK_MODEL *m) |
{ kern_raise(XINVALID_GUEST,exec_shadow); return 0; } |
872,12 → 846,7 |
static void CBSGHD_guest_sleep(LEVEL l, PID p) |
{ kern_raise(XINVALID_GUEST,exec_shadow); } |
static void CBSGHD_guest_delay(LEVEL l, PID p,DWORD tickdelay) |
{ kern_raise(XINVALID_GUEST,exec_shadow); } |
/* Registration functions */ |
/*+ Registration function: |
929,7 → 898,6 |
lev->l.task_endcycle = CBSGHD_task_endcycle; |
lev->l.task_end = CBSGHD_task_end; |
lev->l.task_sleep = CBSGHD_task_sleep; |
lev->l.task_delay = CBSGHD_task_delay; |
lev->l.guest_create = CBSGHD_guest_create; |
lev->l.guest_detach = CBSGHD_guest_detach; |
941,7 → 909,6 |
lev->l.guest_endcycle = CBSGHD_guest_endcycle; |
lev->l.guest_end = CBSGHD_guest_end; |
lev->l.guest_sleep = CBSGHD_guest_sleep; |
lev->l.guest_delay = CBSGHD_guest_delay; |
/* fill the CBSGHD descriptor part */ |
for (i=0; i<MAX_PROC; i++) { |