Subversion Repositories shark

Rev

Rev 1442 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#include "kernel/kern.h"
#include "fsf_server.h"
#include "fsf_contract.h"
#include "func.h"

extern struct loader_contract loader_contract_list[];
extern int total_loader_contract;

void fsfinit()
{

  struct loader_contract *c;
  fsf_contract_parameters_t contract;
  fsf_server_id_t server;
  union sigval no_sigval = {0};
  int i;
  SOFT_TASK_MODEL m;

  soft_task_default_model(m);
  soft_task_def_period(m,50000);
  soft_task_def_met(m,1000);

  FSF_start_service_task(&m);

  for (i=0;i<total_loader_contract;i++) {

    c = &loader_contract_list[i];

    fsf_initialize_contract(&contract);

    fsf_set_contract_basic_parameters(&contract,&c->cmin,&c->tmax,&c->cmax,&c->tmin,c->workload);

    if (TIMESPEC2USEC(&c->deadline) != 0)
      fsf_set_contract_timing_requirements(&contract,FALSE,&c->deadline,0,no_sigval,0,no_sigval);

    if (c->local_scheduler != PAR_POSIX) {
 
      switch (c->local_scheduler) {
         case PAR_EDF:
           fsf_set_local_scheduler_parameter(&contract,FSF_SCHEDULER_EDF);
           break;
         case PAR_RM:
           fsf_set_local_scheduler_parameter(&contract,FSF_SCHEDULER_RM);
           break;
      }

    }
 
    fsf_negotiate_contract(&contract,&server);
    c->server = server;
 
  }

  print_server_list();

}