]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blob - frsh_core_types.h
Moving bool definition from frsh_core_types.h to frsh_fosa.h so that FOSA
[frescor/frsh-include.git] / frsh_core_types.h
1 // -----------------------------------------------------------------------
2 //  Copyright (C) 2006 - 2007 FRESCOR consortium partners:
3 //
4 //    Universidad de Cantabria,              SPAIN
5 //    University of York,                    UK
6 //    Scuola Superiore Sant'Anna,            ITALY
7 //    Kaiserslautern University,             GERMANY
8 //    Univ. Politécnica  Valencia,           SPAIN
9 //    Czech Technical University in Prague,  CZECH REPUBLIC
10 //    ENEA                                   SWEDEN
11 //    Thales Communication S.A.              FRANCE
12 //    Visual Tools S.A.                      SPAIN
13 //    Rapita Systems Ltd                     UK
14 //    Evidence                               ITALY
15 //    
16 //    See http://www.frescor.org for a link to partners' websites
17 //
18 //           FRESCOR project (FP6/2005/IST/5-034026) is funded
19 //        in part by the European Union Sixth Framework Programme
20 //        The European Union is not liable of any use that may be
21 //        made of this code.
22 //
23 //
24 //  based on previous work (FSF) done in the FIRST project
25 //                       
26 //   Copyright (C) 2005  Mälardalen University, SWEDEN
27 //                       Scuola Superiore S.Anna, ITALY
28 //                       Universidad de Cantabria, SPAIN
29 //                       University of York, UK
30 //
31 //   FSF API web pages: http://marte.unican.es/fsf/docs
32 //                      http://shark.sssup.it/contrib/first/docs/
33 //
34 //  This file is part of FRSH API
35 //
36 //  FRSH API is free software; you can  redistribute it and/or  modify
37 //  it under the terms of  the GNU General Public License as published by
38 //  the Free Software Foundation;  either  version 2, or (at  your option)
39 //  any later version.
40 //
41 //  FRSH API  is distributed  in  the hope  that  it  will  be useful,  but
42 //  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
43 //  MERCHANTABILITY  or  FITNESS FOR  A  PARTICULAR PURPOSE. See  the  GNU
44 //  General Public License for more details.
45 //
46 //  You should have  received a  copy of  the  GNU  General Public License
47 //  distributed  with  FRSH API;  see file COPYING.   If not,  write to the
48 //  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
49 //  02111-1307, USA.
50 //
51 //  As a special exception, if you include this header file into source
52 //  files to be compiled, this header file does not by itself cause
53 //  the resulting executable to be covered by the GNU General Public
54 //  License.  This exception does not however invalidate any other
55 //  reasons why the executable file might be covered by the GNU General
56 //  Public License.
57 // -----------------------------------------------------------------------
58 //frsh_core_types.h
59 //==============================================
60 //  ******** *******    ********  **      **
61 //  **///// /**////**  **//////  /**     /**
62 //  **      /**   /** /**        /**     /**
63 //  ******* /*******  /********* /**********
64 //  **////  /**///**  ////////** /**//////**
65 //  **      /**  //**        /** /**     /**
66 //  **      /**   //** ********  /**     /**
67 //  //       //     // ////////   //      // 
68 //
69 // FRSH(FRescor ScHeduler), pronounced "fresh"
70 //==============================================
71
72
73 #ifndef         FRSH_CORE_TYPES_H_
74 #define         FRSH_CORE_TYPES_H_
75
76 #include "frsh_configuration_parameters.h"
77 #include "frsh_opaque_types.h"
78 #include "frsh_shared_objects_types.h"
79 #include "frsh_spare_capacity_types.h"
80
81 #include "frsh_implementation_specific_types.h"
82 #include "frsh_hierarchical_types.h"
83 #include "frsh_distributed_types.h"
84 #include "frsh_error.h"
85 #include "frsh_fosa.h"
86
87 /**
88  * @file frsh_core_types.h
89  **/
90
91
92 /**
93  * \addtogroup core
94  **/
95 /*@{*/
96
97
98 /** Kind of workload expected in vres: bounded or indeterminate **/
99 typedef enum {
100     FRSH_WT_BOUNDED, 
101     FRSH_WT_INDETERMINATE
102 } frsh_workload_t;                           
103
104 #define FRSH_DEFAULT_WORKLOAD       FRSH_WT_INDETERMINATE
105 #define FRSH_DEFAULT_D_EQUALS_T     false
106 #define FRSH_DEFAULT_DEADLINE       {0,0} //struct timespec
107
108
109 #define FRSH_NULL_DEADLINE     (struct timespec *)NULL
110 // #define FRSH_NULL_SIGNAL       0 /* Defined at frsh_adaption.h */
111
112 /** Negotiation status: In_progress, rejected, admitted, not_requested **/
113 typedef enum {FRSH_RS_IN_PROGRESS,
114               FRSH_RS_REJECTED,
115               FRSH_RS_ADMITTED,
116               FRSH_RS_NOT_REQUESTED} frsh_renegotiation_status_t;
117
118
119
120 /** 
121  *  Vres Id type, that identifies a vres created to manage a given
122  *  contract
123  **/
124 typedef int      frsh_vres_id_t;             // => 0
125
126 /** Contract ressource type:  processor, network, memory **/
127 typedef enum {
128     FRSH_RT_PROCESSOR,
129     FRSH_RT_NETWORK,
130     FRSH_RT_MEMORY
131 } frsh_resource_type_t;
132
133 /** Ressource Id: processor_id or network_id **/
134 /**********************************************/
135 typedef int frsh_resource_id_t;
136
137 /** This defines 1 resource_id value for systems that have only one
138     resource of a kind. **/
139 #define FRSH_RESOURCE_ID_DEFAULT 0
140
141 /** Kind of contract: regular, background or dummy **/
142 typedef enum {FRSH_CT_REGULAR, FRSH_CT_BACKGROUND, FRSH_CT_DUMMY} frsh_contract_type_t;
143
144 #define CONTRACT_LABEL_MAXLENGTH 15
145 typedef char frsh_contract_label_t[CONTRACT_LABEL_MAXLENGTH + 1];
146
147 /** 
148  *  Contract parameters type; it is an opaque type (i.e. the internal
149  *  structure of this data type is implementation dependent). The user
150  *  can access and modify the parameters of a contract only with the
151  *  proper functions, and should never access the data directly.
152  **/
153 typedef FRSH_CONTRACT_T_OPAQUE  frsh_contract_t;
154
155
156 /** List of vres **/
157 typedef  struct {
158   int             size;
159   frsh_vres_id_t  vres[FRSH_MAX_N_VRES];
160 } frsh_vres_group_t;
161
162 /** List of contracts to negotiate **/
163 typedef struct {
164     int  size;
165     frsh_contract_t*  contracts[FRSH_MAX_N_VRES];
166 } frsh_contracts_group_t;
167
168 typedef struct {
169     int size;
170     frsh_contract_label_t contract_labels[FRSH_MAX_N_VRES];
171 } frsh_contract_labels_group_t;
172
173
174 /**
175  * An abstract synchronization object is defined by the application.
176  * This object can be used by an application to wait for an event to
177  * arrive by invoking the frsh_sychobj_wait() operation.  It
178  * can also be used to signal the event either causing a waiting
179  * vres to wake up, or the event to be queued if no vres is
180  * waiting for it.
181  **/
182 typedef FRSH_SYNCHOBJ_HANDLE_T_OPAQUE frsh_synchobj_handle_t;
183
184
185 /*@}*/
186
187
188 #endif      /* !FRSH_CORE_TYPES_H_ */