Subversion Repositories shark

Compare Revisions

Regard whitespace Rev 1017 → Rev 1018

/shark/trunk/kernel/signal.c
18,11 → 18,11
 
/**
------------
CVS : $Id: signal.c,v 1.13 2005-05-10 17:14:51 mauro Exp $
CVS : $Id: signal.c,v 1.14 2006-03-03 17:14:47 mauro Exp $
 
File: $File$
Revision: $Revision: 1.13 $
Last update: $Date: 2005-05-10 17:14:51 $
Revision: $Revision: 1.14 $
Last update: $Date: 2006-03-03 17:14:47 $
------------
 
This file contains:
1396,12 → 1396,14
/* The fast handler is a standard piece of code which runs with */
/* interrupts enabled to allow interrupt nesting */
 
extern int add_interrupt_job(int no);
 
void irq_fasthandler(void *n)
{
int no = *(int *)n;
PID p;
 
//kern_printf("(irq_fasthandler: no %d)",no);
kern_printf("(irq_fasthandler: no %d)",no);
/* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_interrupt_start,(unsigned short int)no,0);
1414,7 → 1416,7
}
 
if (int_table[no].intdrv != NULL) {
add_interrupt_job(no, int_table[no].intdrv);
add_interrupt_job(no);
}
 
TRACER_LOGEVENT(FTrace_EVT_interrupt_end,(unsigned short int)no,0);
1440,7 → 1442,7
}
 
f = kern_fsave();
//kern_printf("(handler_set: no %d pid %d)",no, pi);
kern_printf("(handler_set: no %d pid %d)",no, pi);
if (int_table[no].isUsed == TRUE) {
kern_frestore(f);
errno = EUSED_INT_NO;
1469,7 → 1471,7
}
 
f = kern_fsave();
//kern_printf("(handler_remove: no %d )",no);
kern_printf("(handler_remove: no %d )",no);
if (int_table[no].isUsed == FALSE) {
kern_frestore(f);
errno = EUNUSED_INT_NO;
/shark/trunk/modules/intdrive/intdrive/inttask.h
42,7 → 42,7
__BEGIN_DECLS
 
int add_interrupt_job(int no);
int intdrive_taskinit(int wcet);
int intdrive_taskinit(int level, int wcet);
void set_noint_handler(void * new_handler);
 
__END_DECLS
/shark/trunk/modules/intdrive/intdrive.c
38,6 → 38,7
/* Interrupt Driver Module */
 
#include <intdrive/intdrive/intdrive.h>
#include <intdrive/intdrive/inttask.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
371,7 → 372,7
mul32div32to32(MAX_BANDWIDTH,U,10000,lev->U);
//!!!calcolare parametro
intdrive_taskinit(10000);
intdrive_taskinit(l, 10000);
 
return l;
}
/shark/trunk/modules/intdrive/inttask.c
46,7 → 46,7
 
#include <intdrive/intdrive/inttask.h>
 
//#define DEBUG_SHARK_GLUE
#define DEBUG_SHARK_GLUE
 
PID intr_server = NIL;
void (*noint_handler)(int n);
105,12 → 105,11
/* The Interrupt TASK is an aperiodic task designed for
the INTDRIVE module. */
 
TASK Interrupt_Server(void *arg)
void interrupt_job()
{
void (*tmp_fast)(int n);
int no;
 
while(1) {
n_intact++;
 
no = get_interrupt_job();
124,16 → 123,35
if (no != -1 && no >= 16) {
(noint_handler)(no);
}
}
 
TASK Interrupt_Server(void *arg)
{
while(1) {
interrupt_job();
 
task_endcycle();
}
 
}
 
int intdrive_taskinit(int wcet)
TASK Interrupt_Server_Prot(void *arg)
{
while(1) {
task_nopreempt();
interrupt_job();
task_preempt();
 
task_endcycle();
}
 
}
 
int intdrive_taskinit(int level, int wcet)
{
HARD_TASK_MODEL ht;
 
 
hard_task_default_model(ht);
hard_task_def_wcet(ht, wcet);
hard_task_def_interrupt(ht);
140,12 → 158,18
hard_task_def_system(ht);
hard_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;
}
}
/shark/trunk/drivers/linuxc26/shark_glue.c
12,7 → 12,7
 
extern int intr_count;
 
//#define DEBUG_SHARK_GLUE
#define DEBUG_SHARK_GLUE
 
/* 1-15 for IRQ and 16-63 for timers */
void *timer_arg_table[MAX_TIMER_TABLE];
102,10 → 102,6
 
f = kern_fsave();
 
#ifdef DEBUG_SHARK_GLUE
cprintf("(Timer Set %d)", no);
#endif
 
i = get_free_timer_slot();
 
if (i == -1) {
140,7 → 136,7
}
 
#ifdef DEBUG_SHARK_GLUE
cprintf("(Timer Del %d)", no);
cprintf("(Timer Del %d)", index);
#endif
 
if (timer_table[index] != -1 && timer_table[index] != -2) {