Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 689 → Rev 690

/shark/trunk/kernel/activate.c
18,11 → 18,11
 
/**
------------
CVS : $Id: activate.c,v 1.8 2004-05-17 15:03:51 anton Exp $
CVS : $Id: activate.c,v 1.9 2004-05-26 15:33:46 anton Exp $
 
File: $File$
Revision: $Revision: 1.8 $
Last update: $Date: 2004-05-17 15:03:51 $
Revision: $Revision: 1.9 $
Last update: $Date: 2004-05-26 15:33:46 $
------------
 
task_activate & group_activate
65,12 → 65,21
#include <tracer.h>
 
/*+
Activates a single task
Activates a single task now
+*/
int task_activate(PID p)
{
struct timespec t;
kern_gettime(&t);
return task_activate_at(p, &t);
}
 
/*+
Activates a single task at time t
+*/
int task_activate_at(PID p, struct timespec *t)
{
LEVEL l; /* the level of the task p */
struct timespec t;
 
/* some controls on the task p */
if (p<0 || p>=MAX_PROC) {
82,8 → 91,6
return -1;
}
 
kern_gettime(&t);
 
/*+ if we are calling the runlevel functions the system is
into the global_context... we only have to call
the task_activate of the level +*/
94,7 → 101,7
proc_table[p].frozen_activations++;
else {
l = proc_table[p].task_level;
level_table[l]->public_activate(l,p,&t);
level_table[l]->public_activate(l,p,t);
}
kern_frestore(f);
return 0;
109,7 → 116,7
proc_table[p].frozen_activations++;
else {
l = proc_table[p].task_level;
level_table[l]->public_activate(l,p,&t);
level_table[l]->public_activate(l,p,t);
event_need_reschedule();
}
kern_frestore(f);
123,7 → 130,7
/* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_activate,(unsigned short int)proc_table[p].context,0);
l = proc_table[p].task_level;
level_table[l]->public_activate(l,p,&t);
level_table[l]->public_activate(l,p,t);
/* Preempt if necessary */
scheduler();
136,14 → 143,24
 
 
/*+
Activate a group of tasks, identified by the group g
Activate a group of tasks identified by the group g now.
It returns -1 if the group is not valid
+*/
int group_activate(WORD g)
{
struct timespec t;
kern_gettime(&t);
return group_activate_at(g, &t);
}
 
/*+
Activate a group of tasks identified by the group g at time t.
It returns -1 if the group is not valid
+*/
int group_activate_at(WORD g, struct timespec *t)
{
PID i; /* a counter */
register LEVEL l; /* a level value */
struct timespec t;
 
if (g == 0) {
errno = EINVALID_GROUP;
150,8 → 167,6
return -1;
}
 
kern_gettime(&t);
 
/*+ if we are calling the runlevel functions the system is
into the global_context... we only have to call
the task_activate of the level +*/
168,7 → 183,7
/* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_activate,(unsigned short int)proc_table[i].context,0);
l = proc_table[i].task_level;
level_table[l]->public_activate(l,i,&t);
level_table[l]->public_activate(l,i,t);
}
 
kern_frestore(f);
187,7 → 202,7
/* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_activate,(unsigned short int)proc_table[i].context,0);
l = proc_table[i].task_level;
level_table[l]->public_activate(l,i,&t);
level_table[l]->public_activate(l,i,t);
event_need_reschedule();
}
kern_frestore(f);
202,7 → 217,7
continue;
}
l = proc_table[i].task_level;
level_table[l]->public_activate(l,i,&t);
level_table[l]->public_activate(l,i,t);
/* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_activate,(unsigned short int)proc_table[i].context,0);
}