/shark/trunk/ports/first/first-contract.c |
---|
152,8 → 152,8 |
{ |
if (!contract) return FSF_ERR_BAD_ARGUMENT; |
if ((d_equals_t==true && deadline != FSF_NULL_DEADLINE) || |
(d_equals_t==false && deadline == FSF_NULL_DEADLINE)) |
if ((d_equals_t==TRUE && deadline != FSF_NULL_DEADLINE) || |
(d_equals_t==TRUE && deadline == FSF_NULL_DEADLINE)) |
return FSF_ERR_BAD_ARGUMENT; |
if (TIMESPEC_A_GT_B(deadline, &contract->period_max)) |
return FSF_ERR_BAD_ARGUMENT; |
/shark/trunk/ports/first/include/fsf_basic_types.h |
---|
33,7 → 33,7 |
// Constants for assigning default values |
#define FSF_DEFAULT_WORKLOAD FSF_INDETERMINATE |
#define FSF_DEFAULT_D_EQUALS_T false |
#define FSF_DEFAULT_D_EQUALS_T TRUE |
#define FSF_DEFAULT_DEADLINE {0,0} //struct timespec |
// Constants for omitting the assignment of values |
128,11 → 128,17 |
// EDF: struct timespec (deadline) |
// TABLE_DRIVEN : struct fsf_table_driven_params_t |
struct target_window { |
pthread_t task_id; |
struct timespec start; |
struct timespec end; |
struct timespec comp_time; |
}; |
//Scheduling parameters for the table-driven policy (t.b.d) |
typedef struct { |
// list of target windows (t.b.d.) |
// deadline (for the API): end of september |
int size; |
struct target_window * table; |
} fsf_table_driven_params_t; |
/shark/trunk/ports/first/server-task.c |
---|
34,7 → 34,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: server-task.c,v 1.7 2004-11-03 13:10:38 trimarchi Exp $ |
* CVS : $Id: server-task.c,v 1.8 2004-11-08 10:55:59 trimarchi Exp $ |
*/ |
#include "ll/i386/64bit.h" |
82,7 → 82,9 |
} |
} else { |
port_receive(rec,&msg,BLOCK); |
#ifdef FSF_DEBUG |
kern_printf("Message "); |
#endif |
switch (msg.type) { |
case NEGOTIATE_CONTRACT: |
/shark/trunk/ports/first/modules/edfstar.c |
---|
45,8 → 45,6 |
#include <tracer.h> |
#define EDFSTAR_CHANGE_LEVEL 1 |
/* for iqueues */ |
/* #include "iqueue.h" Now iqueues are the only queue type available |
into the kernel */ |
87,6 → 85,7 |
#define EDFSTAR_IDLE MODULE_STATUS_BASE+4 /* to wait the deadline */ |
/* flags */ |
#define EDFSTAR_CHANGE_LEVEL 8 |
#define EDFSTAR_FLAG_NOPREEMPT 4 |
#define EDFSTAR_FLAG_NORAISEEXC 2 |
#define EDFSTAR_FLAG_SPORADIC 1 |
236,9 → 235,14 |
/* Change task level */ |
if (lev->flag[p] & EDFSTAR_CHANGE_LEVEL) { |
#ifdef EDFSTAR_DEBUG |
edfstar_printf("(E:clev)"); |
#endif |
STD_command_message msg; |
proc_table[p].status = SLEEP; |
lev->flag[p] &= ~ EDFSTAR_CHANGE_LEVEL; |
level_table[lev->scheduling_level]->private_extract(lev->scheduling_level,p); |
iq_extract(p,&lev->ready); |
333,7 → 337,7 |
EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]); |
#ifdef EDFSTAR_DEBUG |
edfstar_printf2("(E:eli)"); |
edfstar_printf2("(E:eli:%d)",p); |
#endif |
return level_table[ lev->scheduling_level ]-> |
579,11 → 583,14 |
/* if the EDFSTAR_task_create is called, then the pclass must be a |
valid pclass. */ |
h=(HARD_TASK_MODEL *)(msg->param); |
/* now we know that m is a valid model */ |
lev->wcet[p] = h->wcet; |
lev->period[p] = h->mit; |
#ifdef EDFSTAR_DEBUG |
kern_printf("(EDF:NM p%d w%d m%d)", p, h->wcet, h->mit); |
#endif |
lev->flag[p] = 0; |
lev->deadline_timer[p] = -1; |
lev->dline_miss[p] = 0; |
600,7 → 607,9 |
break; |
case STD_ACTIVATE_TASK: |
#ifdef EDFSTAR_DEBUG |
kern_printf("(EDF:SA)"); |
#endif |
/* Enable wcet check */ |
proc_table[p].avail_time = lev->wcet[p]; |
proc_table[p].wcet = lev->wcet[p]; |
716,7 → 725,7 |
EDFSTAR_level_des *lev = (EDFSTAR_level_des *)(level_table[l]); |
#ifdef EDFSTAR_DEBUG |
//kern_printf("EDFSTAR_guest_end: dline timer %d\n",lev->deadline_timer[p]); |
kern_printf("EDFSTAR_guest_end: dline timer %d\n",lev->deadline_timer[p]); |
#endif |
iq_extract(p, &lev->ready); |
724,7 → 733,7 |
/* we remove the deadline timer, because the slice is finished */ |
if (lev->deadline_timer[p] != NIL) { |
#ifdef EDFSTAR_DEBUG |
// kern_printf("EDFSTAR_guest_end: dline timer %d\n",lev->deadline_timer[p]); |
kern_printf("EDFSTAR_guest_end: dline timer %d\n",lev->deadline_timer[p]); |
#endif |
kern_event_delete(lev->deadline_timer[p]); |
lev->deadline_timer[p] = NIL; |
/shark/trunk/ports/first/modules/grubstar.c |
---|
231,10 → 231,7 |
SUBTIMESPEC(&b->dline, acttime, &t2); |
if (/* 1 */ TIMESPEC_A_LT_B(&b->dline, acttime) || |
/* 2 */ TIMESPEC_A_GT_B(&t3, &t2) ) { |
TIMESPEC_ASSIGN(&b->replenish, acttime); |
ADDUSEC2TIMESPEC(b->T, &b->replenish); |
TIMESPEC_ASSIGN(&b->dline, acttime); |
ADDUSEC2TIMESPEC(b->D, &b->dline); |
if (b->negotiation) { |
lev->negotiation_in_progress--; |
b->negotiation=0; |
246,7 → 243,10 |
b->N_T=0; |
b->N_D=0; |
} |
TIMESPEC_ASSIGN(&b->replenish, acttime); |
ADDUSEC2TIMESPEC(b->T, &b->replenish); |
TIMESPEC_ASSIGN(&b->dline, acttime); |
ADDUSEC2TIMESPEC(b->D, &b->dline); |
b->avail = b->Q; |
b->last_reclaiming = 0; |
} |
336,9 → 336,9 |
JOB_TASK_MODEL job; |
if ( TIMESPEC_A_LT_B(&b->dline, &schedule_time)) { |
#ifdef GRUBSTAR_DEBUG |
// #ifdef GRUBSTAR_DEBUG |
kern_printf("(GS:Eli:%d)",p); |
#endif |
// #endif |
if (lev->cap_lev!=NIL) { |
kern_event_delete(lev->cap_lev); |
lev->cap_lev=NIL; |
348,12 → 348,6 |
level_table[ lev->scheduling_level ]-> |
private_extract(lev->scheduling_level, p); |
/* we modify the deadline ... */ |
kern_gettime(&b->replenish); |
TIMESPEC_ASSIGN(&b->dline, &b->replenish); |
ADDUSEC2TIMESPEC(b->D, &b->dline); |
ADDUSEC2TIMESPEC(b->T, &b->replenish); |
/* and the capacity */ |
if (b->negotiation) { |
lev->negotiation_in_progress--; |
366,6 → 360,13 |
b->N_T=0; |
b->N_D=0; |
} |
/* we modify the deadline ... */ |
kern_gettime(&b->replenish); |
TIMESPEC_ASSIGN(&b->dline, &b->replenish); |
ADDUSEC2TIMESPEC(b->D, &b->dline); |
ADDUSEC2TIMESPEC(b->T, &b->replenish); |
b->avail = b->Q; |
b->last_reclaiming = 0; |
/shark/trunk/ports/first/modules/nonestar.c |
---|
49,7 → 49,7 |
#include "tracer.h" |
#include <modules/comm_message.h> |
#define NONESTAR_DEBUG |
//#define NONESTAR_DEBUG |
#define NONESTAR_CHANGE_LEVEL 1 |
/shark/trunk/ports/first/modules/posixstar.c |
---|
282,6 → 282,7 |
STD_command_message msg; |
proc_table[p].status = SLEEP; |
lev->flag[p] &= ~POSIXSTAR_CHANGE_LEVEL; |
level_table[lev->scheduling_level]->private_extract(lev->scheduling_level,p); |
iq_extract(p,&lev->ready[lev->priority[p]]); |
/shark/trunk/ports/first/first-server.c |
---|
468,6 → 468,8 |
/* Send change level command to posix level */ |
} |
break; |
case FSF_EDF: |
{ |
TASK_MODEL *m=(TASK_MODEL*)sched_params; |
502,13 → 504,18 |
/* Set server on local scheduler */ |
POSIXSTAR_setbudget(local_scheduler_level,thread,(int)(server)); |
} |
break; |
default: |
default: |
return FSF_ERR_BAD_ARGUMENT; |
} |
msg = (STD_command_message *)malloc(sizeof(STD_command_message)); |
if (msg) { |
if (msg) { |
SYS_FLAGS f; |
f=kern_fsave(); |
msg->command = STD_SET_NEW_MODEL; |
msg->param = (void *)(sched_params); |
level_table[local_scheduler_level]->public_message(local_scheduler_level,thread,msg); |
516,7 → 523,7 |
msg->command = STD_SET_NEW_LEVEL; |
msg->param = (void *)(local_scheduler_level); |
task_message(msg,thread,0); |
kern_frestore(f); |
free(msg); |
} else return FSF_ERR_INTERNAL_ERROR; |