Main Page | Modules | Data Structures | File List | Data Fields | Globals

Contract Creation and Initialization.
[Core module]


Functions

int fsf_initialize_contract (fsf_contract_parameters_t *contract)
int fsf_set_contract_basic_parameters (fsf_contract_parameters_t *contract, const struct timespec *budget_min, const struct timespec *period_max, fsf_workload_t workload)
int fsf_get_contract_basic_parameters (const fsf_contract_parameters_t *contract, struct timespec *budget_min, struct timespec *period_max, fsf_workload_t *workload)
int fsf_set_contract_timing_requirements (fsf_contract_parameters_t *contract, bool d_equals_t, const struct timespec *deadline, int budget_overrun_sig_notify, union sigval budget_overrun_sig_value, int deadline_miss_sig_notify, union sigval deadline_miss_sig_value)
int fsf_get_contract_timing_requirements (const fsf_contract_parameters_t *contract, bool *d_equals_t, struct timespec *deadline, int *budget_overrun_sig_notify, union sigval *budget_overrun_sig_value, int *deadline_miss_sig_notify, union sigval *deadline_miss_sig_value)

Detailed Description

These functions are used to create and initialize a contract, and set its parameters.

Function Documentation

int fsf_get_contract_basic_parameters const fsf_contract_parameters_t contract,
struct timespec *  budget_min,
struct timespec *  period_max,
fsf_workload_t workload
 

This operation obtains from the specified contract parameters object its budget, period, and workload, and copies them to the places pointed to by the corresponding input parameters.

Parameters:
[in] contract the pointer to the contract object
out] budget_min pointer to the variable that will contain the minimum budget
out] period_max pointer to the variable that will contain the max_period
out] workload pointer to the variable that will contain the workload type
Return values:
FSF_ERR_BAD_ARGUMENT : if contract is NULL

int fsf_get_contract_timing_requirements const fsf_contract_parameters_t contract,
bool *  d_equals_t,
struct timespec *  deadline,
int *  budget_overrun_sig_notify,
union sigval *  budget_overrun_sig_value,
int *  deadline_miss_sig_notify,
union sigval *  deadline_miss_sig_value
 

The operation obtains the corresponding input parameters from the specified contract parameters object. If d_equals_t is true, the deadline will not be updated.

Return values:
FSF_ERR_BAD_ARGUMENT if contract is NULL
See also:
fsf_set_contract_timing_requirements

int fsf_initialize_contract fsf_contract_parameters_t contract  ) 
 

The operation receives a pointer to a contract parameters object and initializes it, setting it to the default values. The default values are:

  • budget min and max are set to 0;
  • period min and max are set to 0;
  • the workload is unbounded (FSF_INDETERMINATE);
  • the server deadline is equal to the period;
  • the budget and deadline overrun are not notified;
  • the granularity is set to "continuous" (FSF_CONTINUOUS);
  • the quality and importance are set to the default values;
  • the scheduling policy is FSF_NONE.

Parameters:
contract the pointer to the contract variable.
Return values:
FSF_ERR_BAD_ARGUMENT contract is NULL

int fsf_set_contract_basic_parameters fsf_contract_parameters_t contract,
const struct timespec *  budget_min,
const struct timespec *  period_max,
fsf_workload_t  workload
 

The operation updates the specified contract parameters object by setting its budget, period, and workload to the specified input parameters. (Note: the workload is a basic parameter because bounded tasks are triggered by the scheduler (see the fsf_schedule_timed_job() operation), while indeterminate tasks are not; therefore, their programming model is quite different).

Parameters:
contract the pointer to the contract object
[in] budget_min the minimum budget for the contract
[in] period_max the maximum period for the contract
[in] workload the kind of workload (can be FSF_BOUNDED or FSF_INDETERMINATE)
Return values:
0 if the operation is succesful
FSF_ERR_BAD_ARGUMENT if any of the pointers is NULL or if only one of the timespec values is 0, and also if the workload is not a proper value (FSF_INDETERMINATE, FSF_BOUNDED or FSF_OVERHEAD)

int fsf_set_contract_timing_requirements fsf_contract_parameters_t contract,
bool  d_equals_t,
const struct timespec *  deadline,
int  budget_overrun_sig_notify,
union sigval  budget_overrun_sig_value,
int  deadline_miss_sig_notify,
union sigval  deadline_miss_sig_value
 

The operation updates the specified contract parameters object, specifying the additional parameters requirements of a contract.

Parameters:
contract The pointer to the contract object
[in] d_equals_t It is a boolean value, set to true (1) if the we want to specify a deadline different from the period for the contract.
[in] deadline If the previous parameter is set to true, this parameter should be set to NULL_DEADLINE. Otherwise, it contains the desired deadline value.
[in] budget_overrun_sig_notify contains the number of posix signal that must be raised if the budget of the server is overrun. If the value of this parameter is NULL_SIGNAL, no signal will be raised.
[in] budget_overrun_sig_value contains the value that will be passed to the signal "catcher" when the signal is raised. This parameters is not used if the budget_overrun_sig_notify parameters is set to NULL_SIGNAL.
[in] deadline_miss_sig_notify contains the number of posix signal that must be raised if the deadline of the server is missed. If the value of this parameter is NULL_SIGNAL, no signal is raised.
[in] deadline_miss_sig_value contains the value that will be passed to the signal "catcher" when the signal is raised. This parameters is not used if the budget_overrun_sig_notify parameters is set to NULL_SIGNAL
Return values:
0 if the operation is succesful
FSF_BAD_ARGUMENT if contract is NULL or (d_equals_t is true and deadline is not FSF_NULL_DEADLINE) or (budget_overrun_sig_notify is not a valid signal) or (deadline_miss_sig_notify is not a valid signal) or (d_equals_t is false but (deadline is FSF_NULL_DEADLINE or its value is grater than the contracts maximum period))
See also:
sigexplanation


Generated on Tue Apr 5 17:01:26 2005 for FSF by doxygen 1.3.4