Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 927 → Rev 928

/shark/trunk/ports/first/fsf_include/fsf_shared_objects.h
55,20 → 55,26
// SHARED OBJECTS & OPERATIONS MANAGEMENT
/////////////////////////////////////////////////////
 
// fsf_init_shared_object: Initialization of shared objects. If the
// object identified by obj_id does not yet exist it is created, a
// handle to the object is returned in the variable pointed to by
// obj_handle, and the specified mutex is initialized with the
// appropriate attributes necessary for the current implementation.
// If the object already exists, the function fails.
/*
[ERR@RETURNED:
FSF_ERR_BAD_ARGUMENT : if obj_id, obj_handle, or mutex are NULL
FSF_ERR_SHARED_OBJ_ALREADY_INITIALIZED : if the object identified
/**
\ingroup shobjmodule
 
Initialization of shared objects. If the object identified by
obj_id does not yet exist it is created, a handle to the object is
returned in the variable pointed to by obj_handle, and the
specified mutex is initialized with the appropriate attributes
necessary for the current implementation. If the object already
exists, the function fails.
 
@param [in] obj_id shared object id
@param [out] obj_handle pointer to a shared object handle
@param [out] mutex pointer to a mutex variable
 
@retval 0 if the operation is succesful
@retval FSF_ERR_BAD_ARGUMENT if obj_id, obj_handle, or mutex are NULL
@retval FSF_ERR_SHARED_OBJ_ALREADY_INITIALIZED if the object identified
by obj_id already exists
It may also return any of the error codes that are returned by the
pthread_mutex_init() POSIX function call
]
@retval others It may also return any of the error codes that are
returned by the pthread_mutex_init() POSIX function call
*/
int fsf_init_shared_object
(fsf_shared_obj_id_t obj_id,
76,43 → 82,53
pthread_mutex_t *mutex);
 
 
// fsf_get_shared_object_handle: getting the handle of shared
// objects. If the object already exists a handle to the object is
// returned in the variable pointed to by obj_handle. Otherwise, an
// error code is returned by the function.
/*
[ERR@RETURNED:
FSF_ERR_BAD_ARGUMENT : if obj_id or obj_handle are NULL
FSF_ERR_SHARED_OBJ_NOT_INITIALIZED : if the shared object identified
/**
\ingroup shobjmodule
 
Getting the handle of shared
objects. If the object already exists a handle to the object is
returned in the variable pointed to by obj_handle. Otherwise, an
error code is returned by the function.
 
@param [in] obj_id shared object id
@param [out] obj_handle pointer to a shared object handle
 
@retval 0 if the operation is succesful
@retval FSF_ERR_BAD_ARGUMENT if obj_id or obj_handle are NULL
@retval FSF_ERR_SHARED_OBJ_NOT_INITIALIZED if the shared object identified
by obj_id does not exist
FSF_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
@retval FSF_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
scheduled under the FSF
FSF_ERR_INVALID_SCHEDULER_REPLY : the scheduler is wrong or not running
FSF_ERR_NOT_CONTRACTED_SERVER : if the server of the calling thread
has been cancelled or it is not valid
It may also return any of the error codes that are returned by the
pthread_mutex_init() POSIX function call
]
@retval FSF_ERR_INVALID_SCHEDULER_REPLY the scheduler is wrong or not
running
@retval FSF_ERR_NOT_CONTRACTED_SERVER : if the server of the calling
thread has been cancelled or it is not valid
*/
int fsf_get_shared_object_handle
(fsf_shared_obj_id_t obj_id,
fsf_shared_obj_handle_t *obj_handle);
 
// fsf_get_shared_object_mutex: getting the mutex of shared
// objects. If the object exists, a pointer to its associated mutex is
// returned in the variable pointed to by mutex. Otherwise, an error
// code is returned by the function.
/*
[ERR@RETURNED:
FSF_ERR_BAD_ARGUMENT : if obj_handle or mutex are NULL
FSF_ERR_SHARED_OBJ_NOT_INITIALIZED : if the shared object identified
/**
\ingroup shobjmodule
Getting the mutex of shared objects. If the object exists, a
pointer to its associated mutex is returned in the variable pointed
to by mutex. Otherwise, an error code is returned by the function.
 
@param [in] obj_handle shared object handle
@param [out] mutex pointer to a pointer to a mutex variable,
(remember that the function give back a pointer to a mutex!)
 
@retval 0 if the operation is succesful
@retval FSF_ERR_BAD_ARGUMENT if obj_handle or mutex are NULL
@retval FSF_ERR_SHARED_OBJ_NOT_INITIALIZED if the shared object identified
by obj_id does not exist
FSF_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
@retval FSF_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
scheduled under the FSF
FSF_ERR_INVALID_SCHEDULER_REPLY : the scheduler is wrong or not running
FSF_ERR_NOT_CONTRACTED_SERVER : if the server of the calling thread
@retval FSF_ERR_INVALID_SCHEDULER_REPLY the scheduler is wrong or not
running
@retval FSF_ERR_NOT_CONTRACTED_SERVER if the server of the calling thread
has been cancelled or it is not valid
]
*/
int fsf_get_shared_object_mutex
(fsf_shared_obj_handle_t obj_handle,
123,15 → 139,21
// CONTRACT PARAMETERS
/////////////////////////////////////////////////////
 
//fsf_set_contract_synchronization_parameters: The operation updates
//the specified contract parameters object by setting its critical
//sections to the specified input parameter.
/*
[ERR@RETURNED:
FSF_ERR_BAD_ARGUMENT : if any of the pointers is NULL or
/**
\ingroup shobjmodule
The operation updates the specified contract parameters object by
setting its critical sections to the specified input parameter.
 
 
@param[in] contract the service contract
@param[in] critical_sections list of critical sections accessed by tasks
belonging to the contract
 
@retval 0 if the operation is succesful
@retval FSF_ERR_BAD_ARGUMENT :if any of the pointers is NULL or
the size of the critical_sections structure is less than zero
or grater than FSF_MAX_N_CRITICAL_SECTIONS
]
*/
int
fsf_set_contract_synchronization_parameters
139,18 → 161,21
const fsf_critical_sections_t *critical_sections);
 
 
//fsf_get_contract_synchronization_parameters: The operation obtains
//from the specified contract parameters object its critical sections,
//and copies them to the places pointed to by the specified input
//parameter. Only those critical_section_data records that are in use
//in the critical_sections structure are copied (according to its size
//field).
/*
[ERR@RETURNED:
FSF_ERR_BAD_ARGUMENT : if any of the pointers is NULL
]
/**
\ingroup shobjmodule
 
The operation obtains from the specified contract parameters object
its critical sections, and copies them to the places pointed to by
the specified input parameter. Only those critical_section_data
records that are in use in the critical_sections structure are
copied (according to its size field).
 
@param[in] contract pointer to a contract
@param[out] critical_sections list of critical sections to be filled
 
@retval 0 if the operation is succesful
@retval FSF_ERR_BAD_ARGUMENT if any of the pointers is NULL
*/
 
int
fsf_get_contract_synchronization_parameters
(const fsf_contract_parameters_t *contract,