/shark/trunk/ports/first/include/grubstar.h |
---|
100,5 → 100,7 |
void GRUBSTAR_disable_server(LEVEL l, int budget); |
int GRUBSTAR_get_renegotiation_status(LEVEL l, int budget); |
#endif |
/shark/trunk/ports/first/include/pistar.h |
---|
21,11 → 21,11 |
/** |
------------ |
CVS : $Id: pistar.h,v 1.3 2004-09-03 12:43:02 trimarchi Exp $ |
CVS : $Id: pistar.h,v 1.4 2004-10-25 14:38:30 trimarchi Exp $ |
File: $File$ |
Revision: $Revision: 1.3 $ |
Last update: $Date: 2004-09-03 12:43:02 $ |
Revision: $Revision: 1.4 $ |
Last update: $Date: 2004-10-25 14:38:30 $ |
------------ |
This file contains the Priority Inheritance (PI) Protocol |
96,7 → 96,7 |
RLEVEL PISTAR_register_module(void); |
int PISTAR_lock(RLEVEL l, mutex_t *m, TIME wcet); |
//int PISTAR_lock(RLEVEL l, mutex_t *m, TIME wcet); |
__END_DECLS |
/shark/trunk/ports/first/include/fsf_server.h |
---|
9,8 → 9,9 |
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); |
void FSF_start_service_task(void); |
int FSF_register_module(int posix_level, int server_level, bandwidth_t max_bw); |
#ifdef FSF_CBSSTAR |
#include "cbsstar.h" |
25,6 → 26,7 |
#define SERVER_get_last_reclaiming CBSSTAR_get_last_reclaiming |
#define SERVER_disable_server CBSSTAR_disable_server |
#define SERVER_get_remain_capacity CBSSTAR_get_remain_capacity |
#define SERVER_get_renegotiation_status CBSSTAR_get_renegotiation_status |
#endif |
#ifdef FSF_GRUBSTAR |
42,6 → 44,7 |
#define SERVER_get_remain_capacity GRUBSTAR_get_remain_capacity |
#define SERVER_return_bandwidth GRUBSTAR_return_bandwidth |
#define SERVER_disable_server GRUBSTAR_disable_server |
#define SERVER_get_renegotiation_status GRUBSTAR_get_renegotiation_status |
#endif |
#endif |
/shark/trunk/ports/first/include/fsf_opaque_types.h |
---|
1,76 → 1,85 |
//fsf_opaque_types.h |
//======================================================================= |
// FFFFFFIII RRRRR SSTTTTTTT |
// FF IIR RR SS |
// FF IR SS |
// FFFFFF RRRR SSSSST |
// FFFFFF RRRR SSSSST |
// FF FI RRR SS |
// FF II RRR SS |
// FF IIIIIR RS |
// |
// Basic FSF(FIRST Scheduling Framework) contract management opaque types |
// S.Ha.R.K. Implementation |
//======================================================================= |
// Implementation dependent definitions |
#include <signal.h> |
#ifndef _FSF_OPAQUE_TYPES_H_ |
#define _FSF_OPAQUE_TYPES_H_ |
#include <kernel/iqueue.h> |
#define FSF_CONTRACT_PARAMETERS_T_OPAQUE struct { \ |
\ |
struct timespec budget_min; \ |
struct timespec period_max; \ |
struct timespec budget_max; \ |
struct timespec period_min; \ |
fsf_workload_t workload; \ |
\ |
fsf_scheduler_id_t local_scheduler_id; \ |
\ |
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; \ |
\ |
fsf_granularity_t granularity; \ |
fsf_utilization_set_t utilization_set; \ |
int quality; \ |
int importance; \ |
\ |
fsf_preemption_level_t preemption_level; \ |
fsf_critical_sections_t critical_sections; \ |
fsf_shared_operations_t shared_operations; \ |
\ |
} |
#define FSF_CONTRACT_PARAMETERS_T_OPAQUE struct { \ |
\ |
struct timespec budget_min; \ |
struct timespec period_max; \ |
struct timespec budget_max; \ |
struct timespec period_min; \ |
fsf_workload_t workload; \ |
\ |
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; \ |
\ |
fsf_granularity_t granularity; \ |
fsf_utilization_set_t utilization_set; \ |
int quality; \ |
int importance; \ |
\ |
fsf_preemption_level_t preemption_level; \ |
fsf_critical_sections_t critical_sections; \ |
\ |
fsf_sched_policy_t policy; \ |
\ |
} |
//Default values for fsf_contract_parameters_t: |
// budget_min => {0,0}; |
// period_max => {0,0}; |
// budget_max => {0,0}; |
// period_min => {0,0}; |
// workload => DEFAULT_WORKLOAD; |
// d_equals_t => DEFAULT_D_EQUALS_T; (false or true) |
// deadline => DEFAULT_DEADLINE; |
// budget_overrun_sig_notify => 0; (signal number) |
// budget_overrun_sig_value => {0, NULL}; |
// deadline_miss_sig_notify => 0; (signal number) |
// deadline_miss_sig_value => {0, NULL}; |
// |
// granularity => DEFAULT_GRANULARITY; |
// utilization_set; => size = 0 |
// quality => DEFAULT_QUALITY; (range 0..100) |
// importance => DEFAULT_IMPORTANCE; (range 1..5) |
// |
// preemption_level => 0; (range 1..2**32-1) |
// critical_sections; => size = 0 |
// budget_min => {0,0}; |
// period_max => {0,0}; |
// budget_max => {0,0}; |
// period_min => {0,0}; |
// workload => DEFAULT_WORKLOAD; |
// d_equals_t => DEFAULT_D_EQUALS_T; |
// (false or true) |
// deadline => DEFAULT_DEADLINE; |
// budget_overrun_sig_notify => 0; (signal number) |
// budget_overrun_sig_value => {0, NULL}; |
// deadline_miss_sig_notify => 0; (signal number) |
// deadline_miss_sig_value => {0, NULL}; |
// |
// granularity => DEFAULT_GRANULARITY; |
#define FSF_SYNCH_OBJECT_HANDLE_T_OPAQUE struct { \ |
IQUEUE threads; \ |
int events; \ |
} |
// utilization_set; => size = 0 |
// quality => DEFAULT_QUALITY; |
// (range 0..100) |
// importance => DEFAULT_IMPORTANCE; |
// (range 1..5) |
// |
// preemption_level => 0; |
// (range 1..2**32-1) |
// critical_sections => size = 0 |
// |
// policy => DEFAULT_SCHED_POLICY; |
// (FSF_NONE) |
#define FSF_SYNCH_OBJ_HANDLE_T_OPAQUE int |
#define FSF_SHARED_OBJ_HANDLE_T_OPAQUE int |
#endif // _FSF_OPAQUE_TYPES_H_ |
/shark/trunk/ports/first/include/fsf_service_task.h |
---|
40,11 → 40,29 |
#ifndef __FSF_SERVICE_TASK_H__ |
#define __FSF_SERVICE_TASK_H__ |
typedef struct { |
fsf_server_id_t server; |
TIME actual_period; |
TIME actual_budget; |
int Qs; // quality of service |
int Is; // importance of service |
bandwidth_t U; // actual bandwidth |
bandwidth_t Umin; // min bandwidth |
bandwidth_t Umax; // max bandwidth |
TIME Cmin; |
TIME Tmin; |
TIME Tmax; |
TIME deadline; |
bool d_equals_t; |
} server_elem; |
extern server_elem server_list[FSF_MAX_N_SERVERS]; |
extern int current_server; |
extern bandwidth_t fsf_max_bw; |
TASK service_task(void); |
TASK service_task(void); |
int negotiate_contract |
(const fsf_contract_parameters_t *contract, |
/shark/trunk/ports/first/include/message.h |
---|
44,11 → 44,13 |
NO_TYPE=-1, |
NEGOTIATE_CONTRACT, |
RENEGOTIATE_CONTRACT, |
REQUEST_RENEGOTIATE_CONTRACT, |
CHANGE_PARAMETER, |
WAIT_NEGOTIATE, |
NUM_MESSAGE, |
} message_type; |
typedef struct mess { |
typedef struct mess { |
message_type type; |
fsf_contract_parameters_t contract; |
fsf_server_id_t server; |
/shark/trunk/ports/first/include/fsf_configuration_parameters.h |
---|
1,18 → 1,19 |
//======================================================================= |
//fsf_configuration_parameters.h |
//=============================================================== |
// FFFFFFIII RRRRR SSTTTTTTT |
// FF IIR RR SS |
// FF IR SS |
// FFFFFF RRRR SSSSST |
// FFFFFF RRRR SSSSST |
// FF FI RRR SS |
// FF II RRR SS |
// FF IIIIIR RS |
// |
// Basic FSF(FIRST Scheduling Framework) configuration parameters |
// S.Ha.R.K. Implementation |
//======================================================================= |
//============================================================== |
/////////////////////////////////////////////////////////////////// |
// Definitions required to configure the fsf scheduling algorithms. |
////////////////////////////////////////////////////// |
// Definitions required to configure the fsf |
// scheduling algorithms. |
#include <sys/boolean.h> |
19,32 → 20,163 |
#ifndef _FSF_CONFIGURATION_PARAMETERS_H_ |
#define _FSF_CONFIGURATION_PARAMETERS_H_ |
// This symbol specifies whether the scheduler will make a |
// schedulability of the requested contract or not |
#define FSF_ADMISSION_TEST_IS_ENABLED false |
// schedulability test of the requested contract or not |
#define FSF_ADMISSION_TEST_IS_ENABLED true |
// Tune these values for optimizing the amount of memory used by |
// the implementation |
// Tune these values for optimizing the amount of memory used by the |
// implementation |
// Maximum number of accepted contracts (servers) |
#define FSF_MAX_N_SERVERS 20 |
#define FSF_MAX_N_SERVERS 10 |
// Maximum number of threads that may be scheduled by the framework |
#define FSF_MAX_N_THREADS 20 |
// Maximum number of critical sections that can be stored in a |
#define FSF_MAX_N_THREADS 11 |
// Maximum number of critical sections that can be stored in a |
// contract parameters object |
#define FSF_MAX_N_CRITICAL_SECTIONS 20 |
// Maximum number of utilization values (pairs of budget and period) |
#define FSF_MAX_N_CRITICAL_SECTIONS 10 |
// Maximum number of utilization values (pairs of budget and period) |
// that can be stored in a contract parameters object |
#define FSF_MAX_N_UTILIZATION_VALUES 20 |
#define FSF_MAX_N_BIND_THREAD 1 |
#define FSF_MAX_N_UTILIZATION_VALUES 5 |
// Define Max Shared Operation for object |
#define FSF_MAX_SHARED_OPERATION 20 |
#endif |
// Maximum number of synchronization objects |
#define FSF_MAX_N_SYNCH_OBJECTS 5 |
// Maximum number of shared objects |
#define FSF_MAX_N_SHARED_OBJECTS 100 |
//////////////////////////////////////////// |
// Other implementation dependent parameters |
// The current implementation in MaRTE OS uses the Application-Defined |
// Scheduling Interface (proposed to the POSIX standardization |
// committee), to create a fixed-priority-based scheduler that |
// operates under the rules of the FIRST scheduling framework. |
// In this implementation there are two special threads: |
// - The application scheduler thread, that |
// implements the scheduler |
// - The service thread, that is in charge of |
// negotiating and renegotiating contracts |
// concurrently with the application |
// The following symbols are necessary to adapt the application to the |
// underlying fixed priority scheduler |
// Priority assigned to the application scheduler; it should be above |
// the priorities of the application threads and of the service |
// thread, and it should be at least 1 level below the maximum of the |
// system |
#define FSF_SCHEDULER_PRIORITY 30 |
// Real-time signal number reserved for the application scheduler to |
// manage its timers. |
#define FSF_SCHEDULER_SIGNAL SIGRTMIN |
// The highest priority that can be assigned to an application thread, |
// it should be defined as one level less than the |
// FSF_SCHEDULER_PRIORITY |
#define FSF_HIGHEST_THREAD_PRIORITY FSF_SCHEDULER_PRIORITY-1 |
// The lowest priority that can be assigned to an application thread, |
// it should be at least 1 level above the minimum of the system |
#define FSF_LOWEST_THREAD_PRIORITY 2 |
// Each call to the functions that negotiate or renegotiate a contract |
// or that change the quality and importance generates a request for |
// the service thread that we call a service job. This job will be |
// pending in a queue until executed by the service thread. The |
// following symbol represents the maximum number of requests that can |
// be simultaneously queued. |
#define FSF_MAX_N_SERVICE_JOBS FSF_MAX_N_SERVERS * 2 |
// In order to bound the background activity of the scheduler (i.e., |
// the admission tests necessary for the negotiation and |
// re-negotiation of contracts), a service thread has been defined. It |
// runs at a given priority level and has a budget and period |
// assigned. |
// Initial period of the service thread (timespec) |
#define FSF_SERVICE_THREAD_PERIOD {0,100000000} //0.1 seg |
// Initial budget of the service thread (timespec) |
#define FSF_SERVICE_THREAD_BUDGET {0,10000000} //0.01 seg |
// Initial priority of the service thread, it has to be lower than the |
// FSF_SCHEDULER_PRIORITY, and is set according to its period and the |
// expected response times for reconfiguration or tunning of the |
// system. |
#define FSF_SERVICE_THREAD_PRIORITY 1 |
// Numeric identifier of the service thread, used for tracing |
#define FSF_SERVICE_THREAD_IDNAME 0x55555555 |
//Maximum number of servers that can be simultaneusly waiting for |
//being signaled in a synchronization object |
#define FSF_MAX_N_SERVERS_IN_SYNCH_OBJECT 4 |
//Maximum number of events that can be pending to be signaled in a |
//synchronization object |
#define FSF_MAX_N_EVENTS_IN_SYNCH_OBJECT 100 |
//Maximum number of pending replenishments in each sporadic server |
#define FSF_MAX_N_PENDING_REPLENISHMENTS 25 |
// This function must be supplied by the user to map the preemption |
// level values given in the contracts for the servers, to priority |
// values in the range that is allowed by the present implementation |
// for application threads. The value returned by the function must |
// fit in the interval defined by the constants: |
// [FSF_LOWEST_THREAD_PRIORITY, FSF_HIGHEST_THREAD_PRIORITY] |
int |
fsf_priority_map (unsigned long plevel); |
// This symbol specifies whether the scheduling system will make |
// traces of the servers, the scheduler and the service thread |
// operation and make them available through the fsf_print_traces |
// function |
#define FSF_TRACING_SERVICE_IS_ENABLED true |
#endif /* _FSF_CONFIGURATION_PARAMETERS_H_ */ |