/shark/trunk/ports/first/include/fsf_configuration_parameters.h |
---|
31,7 → 31,7 |
// Maximum number of accepted contracts (servers) |
#define FSF_MAX_N_SERVERS 10 |
#define FSF_MAX_N_SERVERS 200 |
// Maximum number of threads that may be scheduled by the framework |
/shark/trunk/ports/first/server-task.c |
---|
34,13 → 34,12 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: server-task.c,v 1.8 2004-11-08 10:55:59 trimarchi Exp $ |
* CVS : $Id: server-task.c,v 1.9 2004-11-16 09:24:45 trimarchi Exp $ |
*/ |
#include "ll/i386/64bit.h" |
#include "fsf_configuration_parameters.h" |
#include "fsf_core.h" |
#include "fsf_server.h" |
#include "fsf.h" |
#include "fsf_service_task.h" |
#include "message.h" |
#include <kernel/kern.h> |
49,6 → 48,7 |
#include <modules/cabs.h> |
//#define FSF_DEBUG |
extern fsf_server_id_t service_server; |
TASK service_task(void) { |
55,6 → 55,9 |
struct mess msg; |
fsf_renegotiation_status_t status; |
int wait_renegotiation=0; |
struct timespec next_act; |
struct timespec period; |
struct timespec act_time; |
PORT rec,tra; |
rec = port_connect("CHANW",sizeof(struct mess),STREAM,READ); |
72,7 → 75,10 |
#endif |
wait_renegotiation=0; |
port_send(tra,&msg,BLOCK); |
//task_endcycle(); |
//kern_gettime(&act_time); |
//fsf_get_budget_and_period(service_server,NULL,&period); |
//ADDTIMESPEC(&act_time, &period, &next_act); |
//fsf_schedule_next_timed_job(&next_act,NULL,NULL,NULL,NULL); |
continue; |
} else |
#ifdef FSF_DEBUG |
90,7 → 96,12 |
case NEGOTIATE_CONTRACT: |
if (negotiate_contract(&msg.contract, &msg.server)==FSF_ERR_CONTRACT_REJECTED) |
msg.server=-1; |
break; |
else { |
wait_renegotiation=1; |
//task_endcycle(); |
continue; |
} |
break; |
case REQUEST_RENEGOTIATE_CONTRACT: |
if (renegotiate_contract(&msg.contract, msg.server)==FSF_ERR_CONTRACT_REJECTED) |
113,8 → 124,12 |
} |
// send response server is -1 if the operation fail |
port_send(tra,&msg,BLOCK); |
//kern_gettime(&act_time); |
//fsf_get_budget_and_period(service_server,NULL,&period); |
//ADDTIMESPEC(&act_time, &period, &next_act); |
//fsf_schedule_next_timed_job(&next_act,NULL,NULL,NULL,NULL); |
//task_endcycle(); |
//kern_printf("(ES)"); |
} |
} |
} |
218,7 → 233,7 |
else { |
return FSF_ERR_CONTRACT_REJECTED; |
} |
//kern_printf("(ENCR)"); |
return 0; |
} |
/shark/trunk/ports/first/modules/edfstar.c |
---|
789,6 → 789,7 |
lev->wcet_miss[i] = 0; |
lev->nact[i] = 0; |
lev->budget[i] = NIL; |
lev->new_level[i] = -1; |
} |
iq_init(&lev->ready, NULL, IQUEUE_NO_PRIORITY); |
/shark/trunk/ports/first/modules/grubstar.c |
---|
785,7 → 785,7 |
lev->b[budget].N_T = T; |
lev->b[budget].N_D = D; |
if (lev->b[budget].current!=NIL) { |
if (lev->b[budget].current!=NIL && !(lev->b[budget].Q==Q && lev->b[budget].T==T)) { |
lev->b[budget].N_Q = Q; |
lev->b[budget].N_T = T; |
lev->b[budget].N_D = D; |
/shark/trunk/ports/first/modules/nonestar.c |
---|
305,6 → 305,7 |
/* Enable wcet check */ |
proc_table[p].avail_time = lev->server_Q; |
proc_table[p].wcet = lev->server_Q; |
//kern_printf("(NN:ActEcy:%d:%d)", p, lev->server_Q); |
proc_table[p].control = (proc_table[p].control & ~CONTROL_CAP); |
NONESTAR_public_activate(l, p, NULL); |
344,6 → 345,7 |
{ |
LEVEL l; /* the level that we register */ |
NONESTAR_level_des *lev; /* for readableness only */ |
int i=0; |
l = level_alloc_descriptor(sizeof(NONESTAR_level_des)); |
369,6 → 371,9 |
lev->scheduling_level = master; |
for(i=0; i<MAX_PROC; i++) |
lev->new_level[i] = -1; |
return l; |
} |
/shark/trunk/ports/first/first-server.c |
---|
312,20 → 312,20 |
(const fsf_contract_parameters_t *contract, |
fsf_server_id_t *server) |
{ |
struct mess message; |
struct mess m; |
// send response server is -1 if the operation fail |
message.type=NEGOTIATE_CONTRACT; |
memmove(&message.contract,contract, sizeof(fsf_contract_parameters_t)); |
port_send(channel[1],&message,BLOCK); |
port_receive(channel[0], &message, BLOCK); |
if (message.server==-1) |
m.type=NEGOTIATE_CONTRACT; |
memmove(&m.contract,contract, sizeof(fsf_contract_parameters_t)); |
//kern_printf("(SN:%d)",*server); |
port_send(channel[1],&m,BLOCK); |
//kern_printf("BR:%d)", *server); |
port_receive(channel[0], &m, BLOCK); |
//kern_printf("(EN:%d)", *server); |
if (m.server==-1) |
return FSF_ERR_CONTRACT_REJECTED; |
*server=message.server; |
*server=m.server; |
return 0; |
360,8 → 360,10 |
int err=0; |
err = fsf_negotiate_contract(contract,server); |
//kern_printf("ENMyS:%d", *server); |
if (!err) { |
err = fsf_bind_thread_to_server(*server,exec_shadow); |
//kern_printf("EMMyE:%d:%d",*server,err); |
} else return err; |
return err; |
543,7 → 545,7 |
/* Move thread from the posix module to local scheduler */ |
#ifdef FSF_DEBUG |
kern_printf("(Bind thread = %d to Server = %d)",thread,server); |
kern_printf("(Bthr=%d to Sr=%d)",thread,server); |
#endif |
/* Check if server and thread exsist */ |
576,7 → 578,6 |
msg->command = STD_SET_NEW_LEVEL; |
msg->param = (void *)(local_scheduler_level); |
task_message(msg,thread,0); |
free(msg); |
} else return FSF_ERR_BAD_ARGUMENT; |
899,7 → 900,7 |
#ifdef FSF_DEBUG |
kern_printf("(nserver %d)", current_server); |
#endif |
//kern_printf("(CS:%d)", current_server); |
do { |
current_bandwidth=0; |
Qt=0; |
938,8 → 939,8 |
} |
} |
target_importance++; |
} while (!isok && target_importance<=MAX_IMPORTANCE); |
} while (!isok || target_importance<=MAX_IMPORTANCE); |
//kern_printf("(RNDNL)"); |
return 0; |
} |