]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blob - frsh_core_types.h
Splitting frsh_basic_types.h into individual files per module.
[frescor/frsh-include.git] / frsh_core_types.h
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
6 //
7 //   FRSH API web pages: http://marte.unican.es/frsh/docs/
8 //                      http://shark.sssup.it/contrib/first/docs/
9 //
10 //  This file is part of FRSH API
11 //
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)
15 //  any later version.
16 //
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.
21 //
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
25 //  02111-1307, USA.
26 //
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
32 //  Public License.
33 // -----------------------------------------------------------------------
34 //frsh_core_types.h
35 //==============================================
36 //  ******** *******    ******** **      **
37 //  **///// /**////**  **////// /**     /**
38 //  **      /**   /** /**       /**     /**
39 //  ******* /*******  /*********/**********
40 //  **////  /**///**  ////////**/**//////**
41 //  **      /**  //**        /**/**     /**
42 //  **      /**   //** ******** /**     /**
43 //  //       //     // ////////  //      // 
44 //
45 // FRSH(FRescor ScHeduler), pronounced "fresh"
46 //==============================================
47
48
49 #ifndef         FRSH_CORE_TYPES_H_
50 #define         FRSH_CORE_TYPES_H_
51
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"
56
57 #include "frsh_implementation_specific_types.h"
58 #include "frsh_hierarchical_types.h"
59 #include "frsh_distributed_types.h"
60 #include "frsh_error.h"
61
62
63 /**
64  * \addtogroup core
65  **/
66 /*@{*/
67
68
69 /**
70  * Bool as a byte value (char)
71  *
72  * We will revisit this if we have a problem with bool in C++
73  **/
74 typedef char bool;
75 #define true    1
76 #define false   0
77
78
79 /** Kind of workload expected in servers **/
80 typedef enum {FRSH_BOUNDED, FRSH_INDETERMINATE, FRSH_OVERHEAD} frsh_workload_t;                           
81
82 #define FRSH_DEFAULT_WORKLOAD       FRSH_INDETERMINATE
83 #define FRSH_DEFAULT_D_EQUALS_T     false
84 #define FRSH_DEFAULT_DEADLINE       {0,0} //struct timespec
85
86
87 #define FRSH_NULL_DEADLINE     (struct timespec *)NULL
88 #define FRSH_NULL_SIGNAL       0
89
90 /** Possible values returned by frsh_get_renegotiation_status **/
91 typedef enum {FRSH_IN_PROGRESS,
92               FRSH_REJECTED,
93               FRSH_ADMITTED,
94               FRSH_NOT_REQUESTED} frsh_renegotiation_status_t;
95
96
97 /** 
98  *  Server Id type, that identifies a server created to manage a given
99  *  contract
100  **/
101 typedef int      frsh_server_id_t;             // => 0
102
103
104 /** 
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.
109  **/
110 typedef FRSH_CONTRACT_PARAMETERS_T_OPAQUE  frsh_contract_parameters_t;
111
112
113
114 /*
115 struct {
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;
121     
122     bool                    d_equals_t;
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;
128     
129     frsh_granularity_t       granularity;
130     frsh_utilization_set_t   utilization_set;
131     int                     quality;
132     int                     importance;
133     
134     frsh_preemption_level_t  preemption_level;
135     frsh_critical_sections_t critical_sections;
136
137     frsh_sched_policy_t      policy;
138     frsh_network_id_t        network_id;
139     bool                    granted_capacity_flag;
140 }
141 */
142
143 /** List of contracts to negotiate **/
144 typedef struct {
145   int  size;
146   frsh_contract_parameters_t*  contracts[FRSH_MAX_N_SERVERS];
147 } frsh_contracts_group_t;
148
149 /** List of servers to cancel **/
150 typedef  struct {
151   int             size;
152   frsh_server_id_t servers[FRSH_MAX_N_SERVERS];
153 } frsh_servers_group_t;
154
155
156 /**
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
162  *  waiting for it.
163  **/
164 typedef FRSH_SYNCH_OBJ_HANDLE_T_OPAQUE frsh_synch_obj_handle_t;
165
166
167 /*@}*/
168
169
170 #endif      /* !FRSH_CORE_TYPES_H_ */