Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 984 → Rev 985

/shark/trunk/ports/first/fsf_include/fsf_core.h
91,13 → 91,6
set its parameters.
*/
/*@{*/
/**
Contract parameters type; it is an opaque type (i.e. the internal
structure of this data type is implementation dependent). The user
can access and modify the parameters of a contract only with the
proper functions, and should never access the data directly.
*/
typedef FSF_CONTRACT_PARAMETERS_T_OPAQUE fsf_contract_parameters_t;
 
/**
The operation receives a pointer to a contract parameters object
108,7 → 101,7
- 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";
- the granularity is set to "continuous" (FSF_CONTINUOUS);
- the quality and importance are set to the default values;
- the scheduling policy is FSF_NONE.
 
132,8 → 125,8
//
// granularity => DEFAULT_GRANULARITY;
// utilization_set; => size = 0
// quality => DEFAULT_QUALITY; (range 0..100)
// importance => DEFAULT_IMPORTANCE; (range 1..5)
// quality => DEFAULT_QUALITY; (0, range 0..2**32-1)
// importance => DEFAULT_IMPORTANCE; (1, range 1..5)
//
// preemption_level => 0; (range 1..2**32-1)
// critical_sections; => size = 0
140,8 → 133,11
 
// sched_policy => DEFAULT_SCHED_POLICY
// (FSF_NONE)
// network_id => FSF_NULL_NETWORK_ID;
// (0)
// granted_capacity_flag => false;
 
 
/**
The operation updates the specified contract parameters object by
setting its budget, period, and workload to the specified input
159,7 → 155,7
@retval 0 if the operation is succesful
@retval 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 or FSF_BOUNDED)
is not a proper value (FSF_INDETERMINATE, FSF_BOUNDED or FSF_OVERHEAD)
*/
int
fsf_set_contract_basic_parameters
273,6 → 269,13
 
\defgroup core_synch Synchronization objects
 
An abstract synchronization object is defined by the application.
This object can be used by an application to wait for an event to
arrive by invoking the fsf_schedule_triggered_job() operation. It
can also be used to signal the event either causing a waiting
server to wake up, or the event to be queued if no server is
waiting for it.
 
These objects are used to synchronize threads belonging to bounded
workload servers.
 
288,15 → 291,6
 
*/
/*@{*/
/**
An abstract synchronization object is defined by the application.
This object can be used by an application to wait for an event to
arrive by invoking the fsf_schedule_triggered_job() operation. It
can also be used to signal the event either causing a waiting
server to wake up, or the event to be queued if no server is
waiting for it.
*/
typedef FSF_SYNCH_OBJ_HANDLE_T_OPAQUE fsf_synch_obj_handle_t;
 
 
/**
440,11 → 434,13
main scheduler
@retval FSF_ERR_NOT_SCHEDULED_CALLING_THREAD if the calling thread is
not scheduled under the FSF
@retval FSF_ERR_UNBOUND if the calling thread does not have a valid
@retval FSF_ERR_NOT_BOUND if the calling thread does not have a valid
server bound to it
@retval FSF_ERR_BAD_ARGUMENT if the workload of the server is not
FSF_BOUNDED
@retval FSF_ERR_BAD_ARGUMENT if abs_time is NULL
@retval FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE if the kind of workload of
the server is not FSF_BOUNDED
 
 
@sa fsf_schedule_triggered_job, fsf_timed_schedule_triggered_job
*/
int
507,7 → 503,8
taken.
 
@retval 0 if the operation is succesful
@retval FSF_ERR_INVALID_SYNCH_OBJ_HANDLE if the handle is not valid
@retval FSF_ERR_INVALID_SYNCH_OBJ_HANDLE if the synch_handle is not valid
@retval FSF_ERR_BAD_ARGUMENT if synch_handle is 0
@retval FSF_ERR_INVALID_SCHEDULER_REPLY the scheduler is wrong or not
running
@retval FSF_ERR_INTERNAL_ERROR erroneous binding or malfunction of
514,10 → 511,10
the FSF main scheduler
@retval FSF_ERR_NOT_SCHEDULED_CALLING_THREAD if the calling thread
is not scheduled under the FSF
@retval FSF_ERR_UNBOUND if the calling thread does not have
@retval FSF_ERR_NOT_BOUND if the calling thread does not have
a valid server bound to it
@retval FSF_ERR_BAD_ARGUMENT if the workload of the server is not
FSF_BOUNDED or the synch_handle given is not valid
@retval FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE: if the kind of workload
of the server is not FSF_BOUNDED
 
@sa fsf_schedule_triggered_job, fsf_schedule_timed_job
 
536,6 → 533,7
absolute timeout. The timed_out argument, indicates whether the
function returned because of a timeout or not
 
@retval FSF_ERR_INVALID_SYNCH_OBJ_HANDLE if the synch_handle is not valid
@retval FSF_ERR_INVALID_SCHEDULER_REPLY the scheduler is wrong or
not running
@retval FSF_ERR_INTERNAL_ERROR erroneous binding or malfunction
542,11 → 540,12
of the FSF main scheduler
@retval FSF_ERR_NOT_SCHEDULED_CALLING_THREAD if the calling thread is
not scheduled under the FSF
@retval FSF_ERR_UNBOUND if the calling thread does not have a valid
@retval FSF_ERR_NOT_BOUND if the calling thread does not have a valid
server bound to it
@retval FSF_ERR_BAD_ARGUMENT if the workload of the server is not
FSF_BOUNDED, the synch_handle given is not valid or the abs_timeout
argument is NULL or its value is in the past
@retval FSF_ERR_BAD_ARGUMENT if synch_handle is 0, or the abs_timeout
argument is NULL, or its value is in the past
@retval FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE: if the kind of workload
of the server is not FSF_BOUNDED
 
@see fsf_schedule_triggered_job
*/
577,18 → 576,7
*/
/*@{*/
 
/**
Server Id type, that identifies a server created to manage a given
contract
*/
typedef int fsf_server_id_t; // => 0
 
/**
The type references a function that may become a thread's
code
*/
typedef void * (*fsf_thread_code_t) (void *);
 
/**
The operation negotiates a contract for a new server. If the
on-line admission test is enabled it determines whether the
620,6 → 608,10
under the FSF
@retval FSF_ERR_BAD_ARGUMENT if the contract or server arguments
are NULL
@retval FSF_ERR_TOO_MANY_SERVERS if there is no space for more servers
(the maximum number of them is already
reached)
@retval FSF_ERR_CONTRACT_REJECTED if the contract is rejected
*/
int
fsf_negotiate_contract
642,7 → 634,7
 
The server is created with the FSF_NONE scheduling policy, which
means no hierarchical scheduling, and only one thread per server,
except for the case of background tasks (see below)
except for the case of background tasks.
 
If the contract is rejected, the thread is not created and the
corresponding error is returned.
657,7 → 649,9
 
@retval FSF_ERR_BAD_ARGUMENT if the contract or server arguments are NULL
@retval FSF_ERR_CONTRACT_REJECTED if the contract is rejected
@retval FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE if the kind of workload
in the contract is FSF_OVERHEAD
@retval others it may also return all the errors that may be returned
by the pthread_create()POSIX function call
 
680,7 → 674,7
 
The server is created with the FSF_NONE scheduling policy, which
means no hierarchical scheduling, and only one thread per server,
except for the case of background tasks (see below)
except for the case of background tasks.
 
Implementation dependent issue: In order to allow the usage of
application defined schedulers, the calling thread must not have
699,6 → 693,8
@retval FSF_ERR_BAD_ARGUMENT if the contract or server arguments
are NULL
@retval FSF_ERR_CONTRACT_REJECTED if the contract is rejected.
@retval FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE if the kind of workload
in the contract is FSF_OVERHEAD
*/
int
fsf_negotiate_contract_for_myself
731,8 → 727,10
expected format or valid range or the given thread does not exist
@retval FSF_ERR_NOT_CONTRACTED_SERVER if the referenced server
is not valid
@retval FSF_ERR_ALREADY_BOUND if the thread is already bound to
another server.
@retval FSF_ERR_ALREADY_BOUND if the given server has a thread
already bound
@retval FSF_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE if the kind of workload
in the contract is FSF_OVERHEAD
 
*/
int
781,7 → 779,7
@retval 0 if the operation is succesful
@return FSF_ERR_NOT_SCHEDULED_THREAD if the given thread is not scheduled
under the FSF
@return FSF_ERR_UNBOUND if the given thread does not have a valid
@return FSF_ERR_NOT_BOUND if the given thread does not have a valid
server bound to it
@return FSF_ERR_BAD_ARGUMENT if the given thread does not exist or the
server argument is NULL
859,6 → 857,7
running
@retval FSF_ERR_NOT_CONTRACTED_SERVER if the server of the calling thread
has been cancelled or it is not valid
@retval FSF_ERR_REJECTED_CONTRACT if the renegotiation fails
*/
int
fsf_renegotiate_contract
913,14 → 912,6
union sigval sig_value);
 
/**
Possible values returned by fsf_get_renegotiation_status
*/
typedef enum {FSF_IN_PROGRESS,
FSF_REJECTED,
FSF_ADMITTED}
fsf_renegotiation_status_t;
 
/**
The operation reports on the status of the last renegotiation
operation enqueued for the specified server. It is callable even
after notification of the completion of such operation, if
945,21 → 936,11
fsf_renegotiation_status_t *renegotiation_status);
 
 
//Data types
////////////////////////////////////////////////////////////////////////
// CHANGE OF MODE: GROUPS OF CONTRACTS
////////////////////////////////////////////////////////////////////////
 
/// List of contracts to negotiate
typedef struct {
int size;
fsf_contract_parameters_t* contracts[FSF_MAX_N_SERVERS];
} fsf_contracts_group_t;
 
/// List of servers to cancel
typedef struct {
int size;
fsf_server_id_t servers[FSF_MAX_N_SERVERS];
} fsf_servers_group_t;
 
 
/**
This operation analizes the schedulability of the context that
results from negitiating the contracts specified in the