1 // -----------------------------------------------------------------------
2 // Copyright (C) 2005 Mälardalen University, SWEDEN
3 // Scuola Superiore S.Anna, ITALY
4 // Universidad de Cantabria, SPAIN
5 // University of York, UK
7 // FRSH API web pages: http://marte.unican.es/frsh/docs/
8 // http://shark.sssup.it/contrib/first/docs/
10 // This file is part of FRSH API
12 // FRSH API is free software; you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation; either version 2, or (at your option)
17 // FRSH API is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 // General Public License for more details.
22 // You should have received a copy of the GNU General Public License
23 // distributed with FRSH API; see file COPYING. If not, write to the
24 // Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
27 // As a special exception, if you include this header file into source
28 // files to be compiled, this header file does not by itself cause
29 // the resulting executable to be covered by the GNU General Public
30 // License. This exception does not however invalidate any other
31 // reasons why the executable file might be covered by the GNU General
33 // -----------------------------------------------------------------------
35 //==============================================
36 // ******** ******* ******** ** **
37 // **///// /**////** **////// /** /**
38 // ** /** /** /** /** /**
39 // ******* /******* /*********/**********
40 // **//// /**///** ////////**/**//////**
41 // ** /** //** /**/** /**
42 // ** /** //** ******** /** /**
43 // // // // //////// // //
45 // FRSH(FRescor ScHeduler), pronounced "fresh"
46 //==============================================
49 #ifndef FRSH_CORE_TYPES_H_
50 #define FRSH_CORE_TYPES_H_
52 #include "frsh_configuration_parameters.h"
53 #include "frsh_opaque_types.h"
54 #include "frsh_shared_objects_types.h"
55 #include "frsh_spare_capacity_types.h"
57 #include "frsh_implementation_specific_types.h"
58 #include "frsh_hierarchical_types.h"
59 #include "frsh_distributed_types.h"
60 #include "frsh_error.h"
70 * Bool as a byte value (char)
72 * We will revisit this if we have a problem with bool in C++
79 /** Kind of workload expected in servers **/
80 typedef enum {FRSH_BOUNDED, FRSH_INDETERMINATE, FRSH_OVERHEAD} frsh_workload_t;
82 #define FRSH_DEFAULT_WORKLOAD FRSH_INDETERMINATE
83 #define FRSH_DEFAULT_D_EQUALS_T false
84 #define FRSH_DEFAULT_DEADLINE {0,0} //struct timespec
87 #define FRSH_NULL_DEADLINE (struct timespec *)NULL
88 #define FRSH_NULL_SIGNAL 0
90 /** Possible values returned by frsh_get_renegotiation_status **/
91 typedef enum {FRSH_IN_PROGRESS,
94 FRSH_NOT_REQUESTED} frsh_renegotiation_status_t;
98 * Server Id type, that identifies a server created to manage a given
101 typedef int frsh_server_id_t; // => 0
105 * Contract parameters type; it is an opaque type (i.e. the internal
106 * structure of this data type is implementation dependent). The user
107 * can access and modify the parameters of a contract only with the
108 * proper functions, and should never access the data directly.
110 typedef FRSH_CONTRACT_PARAMETERS_T_OPAQUE frsh_contract_parameters_t;
116 struct timespec budget_min;
117 struct timespec period_max;
118 struct timespec budget_max;
119 struct timespec period_min;
120 frsh_workload_t workload;
123 struct timespec deadline;
124 int budget_overrun_sig_notify;
125 union sigval budget_overrun_sig_value;
126 int deadline_miss_sig_notify;
127 union sigval deadline_miss_sig_value;
129 frsh_granularity_t granularity;
130 frsh_utilization_set_t utilization_set;
134 frsh_preemption_level_t preemption_level;
135 frsh_critical_sections_t critical_sections;
137 frsh_sched_policy_t policy;
138 frsh_network_id_t network_id;
139 bool granted_capacity_flag;
143 /** List of contracts to negotiate **/
146 frsh_contract_parameters_t* contracts[FRSH_MAX_N_SERVERS];
147 } frsh_contracts_group_t;
149 /** List of servers to cancel **/
152 frsh_server_id_t servers[FRSH_MAX_N_SERVERS];
153 } frsh_servers_group_t;
157 * An abstract synchronization object is defined by the application.
158 * This object can be used by an application to wait for an event to
159 * arrive by invoking the frsh_schedule_triggered_job() operation. It
160 * can also be used to signal the event either causing a waiting
161 * server to wake up, or the event to be queued if no server is
164 typedef FRSH_SYNCH_OBJ_HANDLE_T_OPAQUE frsh_synch_obj_handle_t;
170 #endif /* !FRSH_CORE_TYPES_H_ */