Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 807 → Rev 808

/shark/trunk/ports/first/include/grubstar.h
98,5 → 98,7
 
bandwidth_t GRUBSTAR_return_bandwidth(LEVEL l);
 
void GRUBSTAR_disable_server(LEVEL l, int budget);
 
#endif
 
/shark/trunk/ports/first/include/fsf_contract.h
56,11 → 56,52
fsf_preemption_level_t plevel; // Preemption_Level, range 1..2**32-1
} fsf_critical_section_data_t;
 
 
// Definition of basic types
 
typedef unsigned int fsf_shared_op_id_t;
typedef unsigned int fsf_shared_obj_id_t;
 
// Operations
// The first field contains the id of the related object
// the second field contains an identifier of the operation
// this identifier is unique for the object but needs not to be unique
// for the system. In other words, there can be two operations with the
// same identifier belonging to different shared objects: they are
// effectively two distinct operations; two different operations on the
// same object must have different identifiers
 
typedef struct {
fsf_shared_obj_id_t obj_id; // Object identification
fsf_shared_op_id_t op_id; // Operation Identification
struct timespec wcet; // Execution time
} fsf_shared_operation_t;
 
// Shared object
// the first field is the number of distinct operations on the
// shared object. It is initialized to 0.
// the second field is the id of the object, must be unique in the system.
// the third field is a list of shared operations.
 
 
 
 
typedef struct {
int size; // = 0
fsf_critical_section_data_t section[FSF_MAX_N_CRITICAL_SECTIONS];
} fsf_critical_sections_t;
 
typedef struct {
int size; // = 0
fsf_shared_obj_id_t obj_id; // object id
fsf_shared_operation_t shared_op[FSF_MAX_SHARED_OPERATION];
} fsf_shared_object_t;
 
typedef struct {
int size; // =0
fsf_shared_operation_t operation[FSF_MAX_SHARED_OPERATION];
} fsf_shared_operations_t;
 
typedef int fsf_scheduler_id_t;
 
#define FSF_SCHEDULER_POSIX 0
132,6 → 173,7
// preemption_level => 0; (range 1..2**32-1)
// critical_sections; => size = 0
 
int
fsf_set_contract_basic_parameters
(fsf_contract_parameters_t *contract,
218,6 → 260,8
//Only the utilization_values of the utilization_set that are in use, are
//copied (according to its size field).
 
 
/* OLD VERSION
int
fsf_set_contract_synchronization_parameters
(fsf_contract_parameters_t *contract,
228,6 → 272,8
//object by setting its preemption level and critical sections to the
//specified input parameters.
 
*/
 
int
fsf_get_contract_synchronization_parameters
(const fsf_contract_parameters_t *contract,
523,4 → 569,50
//on-line admission test enabled, or false otherwise.
 
 
// Mutex function
 
// Initialization
// here we initialize the second and third field of the structure
void fsf_init_shared_op(fsf_shared_operation_t *op,
fsf_shared_op_id_t op_id,
struct timespec wcet);
 
// initialization
// The shared object id is set equal to the second parameter.
void fsf_init_shared_object(fsf_shared_object_t *obj,
fsf_shared_obj_id_t id);
 
// Declare an operation
// This function is used to declare that a shared object has
// a synchronized operation on it.
// It checks if another operation with the same id has already been
// declared; if so, return false (-1).
// The obj_id field of the operation is set equal to the shared object id.
// the structure op is copied in the first free element in the array
// shared_op pof the structure obj. If there are no more free element,
// returns -1.
// Returns 0 if the operation has been completed, -1 otherwise.
 
int fsf_declare_shared_object_operation(fsf_shared_object_t *obj,
fsf_shared_operation_t *op);
 
 
int fsf_lock_object(fsf_shared_operation_t *op);
 
int fsf_unlock_object(fsf_shared_operation_t *op);
 
// set contract parameters
// specify a list of operations for each contract
// the list is specified as a pointer to an array.
// the size of the array is specified as third parameter
// returns 0 if all operations are correctly initialized
// returns -1 otherwise.
 
int fsf_set_contract_synchronization_parameters(
fsf_contract_parameters_t *contract,
const fsf_shared_operation_t *shared_ops,
size_t op_num);
 
 
 
#endif // _FSF_CONTRACT_H_
/shark/trunk/ports/first/include/fsf_opaque_types.h
41,6 → 41,7
\
fsf_preemption_level_t preemption_level; \
fsf_critical_sections_t critical_sections; \
fsf_shared_operations_t shared_operations; \
\
}
 
/shark/trunk/ports/first/include/fsf_server.h
4,7 → 4,12
#define FSF_GRUBSTAR
 
int fsf_get_server_level(void);
int fsf_get_remain_budget(fsf_server_id_t );
int fsf_settask_nopreemptive(fsf_server_id_t *server, pthread_t thread);
int fsf_settask_preemptive(fsf_server_id_t *server, pthread_t thread);
int FSF_get_shared_object_level(void);
 
 
#ifdef FSF_CBSSTAR
 
#include "cbsstar.h"
17,7 → 22,7
#define SERVER_get_local_scheduler_level_from_pid CBSSTAR_get_local_scheduler_level_from_pid
#define SERVER_getbudgetinfo CBSSTAR_getbudgetinfo
#define SERVER_get_last_reclaiming CBSSTAR_get_last_reclaiming
 
#define SERVER_disable_server CBSSTAR_disable_server
#endif
 
#ifdef FSF_GRUBSTAR
34,6 → 39,7
#define SERVER_get_last_reclaiming GRUBSTAR_get_last_reclaiming
#define SERVER_get_remain_capacity GRUBSTAR_get_remain_capacity
#define SERVER_return_bandwidth GRUBSTAR_return_bandwidth
#define SERVER_disable_server GRUBSTAR_disable_server
#endif
 
#endif
/shark/trunk/ports/first/include/fsf_configuration_parameters.h
44,4 → 44,7
 
#define FSF_MAX_N_BIND_THREAD 1
 
// Define Max Shared Operation for object
#define FSF_MAX_SHARED_OPERATION 20
 
#endif