Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1033 → Rev 1046

/shark/trunk/modules/intdrive/intdrive.c
315,6 → 315,32
 
/* Registration functions */
 
PID intr_server = NIL;
extern TASK Interrupt_Server(void *arg);
extern TASK Interrupt_Server_Prot(void *arg);
 
static void intdrive_create(void *l)
{
INTERRUPT_TASK_MODEL ht;
int level;
int wcet = 10000; // TODO: should be a parameter
 
level = (LEVEL)l;
 
interrupt_task_default_model(ht);
interrupt_task_def_wcet(ht, wcet);
interrupt_task_def_system(ht);
interrupt_task_def_nokill(ht);
 
if (level > 0)
intr_server = task_create("Interrupt Server (Protected)",Interrupt_Server_Prot,&ht,NULL);
else
intr_server = task_create("Interrupt Server",Interrupt_Server,&ht,NULL);
if (intr_server == NIL)
printk("\nPanic!!! Can't create IntDrive task...\n");
}
 
/*+ Registration function: +*/
LEVEL INTDRIVE_register_level(TIME capacity, TIME q_theta, int U, int flags)
{
353,9 → 379,7
printk("INTDRIVE Init: %d %d %d\n", lev->capacity, lev->q_theta, lev->U);
#endif
 
//TODO !!! Fixing 10000 is not a clean way to work !!!
if (intdrive_taskinit(l, 10000) == -1)
printk("Error: INTDRIVE task not activated!\n");
sys_atrunlevel(intdrive_create, (void *) l, RUNLEVEL_INIT);
 
return l;
}
/shark/trunk/modules/intdrive/inttask.c
48,7 → 48,11
 
//#define DEBUG_SHARK_GLUE
 
PID intr_server = NIL;
/*
* Moved into intdrive.c
*/
extern PID intr_server;
 
void (*noint_handler)(int n);
 
#define MAX_INT_LIST 50
167,26 → 171,6
 
}
 
int intdrive_taskinit(int level, int wcet)
{
INTERRUPT_TASK_MODEL ht;
 
interrupt_task_default_model(ht);
interrupt_task_def_wcet(ht, wcet);
interrupt_task_def_system(ht);
interrupt_task_def_nokill(ht);
 
if (level > 0)
intr_server = task_create("Interrupt Server (Protected)",Interrupt_Server_Prot,&ht,NULL);
else
intr_server = task_create("Interrupt Server",Interrupt_Server,&ht,NULL);
 
if (intr_server == NIL)
return -1;
 
return 0;
}
 
void set_noint_handler(void * new_handler)
{
noint_handler = new_handler;