Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1108 → Rev 1100

/demos/trunk/static/static.c
18,11 → 18,11
 
/**
------------
CVS : $Id: static.c,v 1.3 2002-11-11 07:55:13 pj Exp $
CVS : $Id: static.c,v 1.2 2002-10-28 08:15:23 pj Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2002-11-11 07:55:13 $
Revision: $Revision: 1.2 $
Last update: $Date: 2002-10-28 08:15:23 $
------------
**/
 
68,7 → 68,7
typedef struct {
level_des l; /*+ the standard level descriptor +*/
 
IQUEUE mytable;
QUEUE 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 = iq_query_first(&lev->mytable);
for (my_table_index = (PID)lev->mytable;
my_table_index != NIL;
my_table_index = iq_query_next(my_table_index, &lev->mytable)) {
ADDTIMESPEC(&lev->ref,iq_query_timespec(my_table_index, &lev->mytable),&x);
my_table_index = proc_table[my_table_index].next) {
ADDTIMESPEC(&lev->ref,&proc_table[my_table_index].timespec_priority,&x);
kern_event_post(&x, STATIC_offset_activate,(void *)my_table_index);
 
STATIC_printf("|p%d t%d ",
my_table_index,
(int)iq_query_timespec(my_table_index, &lev->mytable)->tv_sec);
(int)proc_table[my_table_index].timespec_priority.tv_sec);
}
 
STATIC_printf(")");
171,9 → 171,9
 
STATIC_TASK_MODEL *h = (STATIC_TASK_MODEL *)m;
 
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);
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);
 
return 0; /* OK, also if the task cannot be guaranteed... */
}
220,16 → 220,19
 
lev->currenttask = NIL;
 
iq_extract(p,&lev->mytable);
q_extract(p,&lev->mytable);
 
/* we finally put the task in the ready queue */
proc_table[p].status = FREE;
iq_insertfirst(p,&freedesc);
q_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. */
264,6 → 267,9
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:
311,6 → 317,7
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;
322,10 → 329,11
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 */
 
iq_init(&lev->mytable, &freedesc, 0);
lev->mytable = NIL;
lev->currenttask = NIL;
 
NULL_TIMESPEC(&lev->hp);
/demos/trunk/static/test1st.c
16,11 → 16,11
 
/**
------------
CVS : $Id: test1st.c,v 1.2 2002-11-11 07:55:13 pj Exp $
CVS : $Id: test1st.c,v 1.1.1.1 2002-09-02 09:37:48 pj Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2002-11-11 07:55:13 $
Revision: $Revision: 1.1.1.1 $
Last update: $Date: 2002-09-02 09:37:48 $
------------
 
 
78,7 → 78,7
 
STATIC_TASK_MODEL m;
 
struct timespec my_time, h, o;
struct timespec my_time, h, o, fineprg;
 
my_time.tv_nsec=0;