1 // -----------------------------------------------------------------------
2 // Copyright (C) 2006 - 2007 FRESCOR consortium partners:
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
11 // Thales Communication S.A. FRANCE
12 // Visual Tools S.A. SPAIN
13 // Rapita Systems Ltd UK
16 // See http://www.frescor.org for a link to partners' websites
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
24 // based on previous work (FSF) done in the FIRST project
26 // Copyright (C) 2005 Mälardalen University, SWEDEN
27 // Scuola Superiore S.Anna, ITALY
28 // Universidad de Cantabria, SPAIN
29 // University of York, UK
31 // FSF API web pages: http://marte.unican.es/fsf/docs
32 // http://shark.sssup.it/contrib/first/docs/
34 // This file is part of FRSH API
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)
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.
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
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
57 // -----------------------------------------------------------------------
59 //==============================================
60 // ******** ******* ******** ** **
61 // **///// /**////** **////// /** /**
62 // ** /** /** /** /** /**
63 // ******* /******* /********* /**********
64 // **//// /**///** ////////** /**//////**
65 // ** /** //** /** /** /**
66 // ** /** //** ******** /** /**
67 // // // // //////// // //
69 // FRSH(FRescor ScHeduler), pronounced "fresh"
70 //==============================================
73 #ifndef FRSH_CORE_TYPES_H_
74 #define FRSH_CORE_TYPES_H_
77 #include "frsh_time_types.h"
78 #include "frsh_configuration_parameters.h"
79 #include "frsh_opaque_types.h"
80 #include "frsh_shared_objects_types.h"
81 #include "frsh_spare_capacity_types.h"
83 #include "frsh_implementation_specific_types.h"
84 #include "frsh_hierarchical_types.h"
85 #include "frsh_distributed_types.h"
86 #include "frsh_error.h"
91 * @file frsh_core_types.h
101 /** identifier of a frsh thread **/
102 typedef fosa_thread_id_t frsh_thread_id_t;
105 /** thread attributes object **/
106 typedef fosa_thread_attr_t frsh_thread_attr_t;
109 * The type references a function that may become a thread's
112 typedef fosa_thread_code_t frsh_thread_code_t;
115 /** signal number; it is an integer type **/
116 typedef fosa_signal_t frsh_signal_t;
118 #define FRSH_NULL_SIGNAL FOSA_NULL_SIGNAL
121 #define FRSH_SIGNAL_MIN FOSA_SIGNAL_MIN
122 #define FRSH_SIGNAL_MAX FOSA_SIGNAL_MAX
125 typedef fosa_signal_info_t frsh_signal_info_t;
128 /** Kind of workload expected in vres: bounded or indeterminate **/
131 FRSH_WT_INDETERMINATE = 1,
132 FRSH_WT_SYNCHRONIZED = 2
135 * In the synchronized workload the virtual resource hosts one or more
136 * threads that synchronize the execution of their jobs with the start
137 * of the virtual resource's period. In this kind of workload, once
138 * the threads that were activated at the beginning of the period
139 * finish their current job, the virtual resource may return any
140 * unused capacity to the system. This kind of workload can be
141 * scheduled using a regular periodic server that has the properties
142 * of being simple, having less overhead, and being able to increase
143 * the schedulability of periodic synchronized threads
146 #define FRSH_NULL_DEADLINE (frsh_rel_time_t *)NULL
147 // #define FRSH_NULL_SIGNAL 0 /* Defined at frsh_adaption.h */
149 /** Negotiation status: In_progress, rejected, admitted, not_requested **/
150 typedef enum {FRSH_RS_IN_PROGRESS,
153 FRSH_RS_NOT_REQUESTED} frsh_renegotiation_status_t;
158 * Vres Id type, that identifies a vres created to manage a given
161 typedef unsigned int frsh_vres_id_t; // => 0
163 /** Contract ressource type: processor, network, memory **/
165 FRSH_RT_PROCESSOR = 0,
169 } frsh_resource_type_t;
171 /** Ressource Id: processor_id or network_id **/
172 /**********************************************/
173 typedef unsigned int frsh_resource_id_t;
175 /** Kind of contract: regular, background or dummy **/
178 FRSH_CT_BACKGROUND = 1,
180 } frsh_contract_type_t;
182 // The name of this constant has been updated to have the FRSH_ prefix
183 typedef char frsh_contract_label_t[FRSH_CONTRACT_LABEL_MAXLENGTH + 1];
186 * Contract parameters type; it is an opaque type (i.e. the internal
187 * structure of this data type is implementation dependent). The user
188 * can access and modify the parameters of a contract only with the
189 * proper functions, and should never access the data directly.
191 typedef FRSH_CONTRACT_T_OPAQUE frsh_contract_t;
197 frsh_vres_id_t vres[FRSH_MAX_N_VRES];
200 /** List of contracts to negotiate **/
203 frsh_contract_t* contracts[FRSH_MAX_N_VRES];
204 } frsh_contracts_group_t;
208 frsh_contract_label_t contract_labels[FRSH_MAX_N_VRES];
209 } frsh_contract_labels_group_t;
213 * An abstract synchronization object is defined by the application.
214 * This object can be used by an application to wait for an event to
215 * arrive by invoking the frsh_sychobj_wait() operation. It
216 * can also be used to signal the event either causing a waiting
217 * vres to wake up, or the event to be queued if no vres is
220 typedef FRSH_SYNCHOBJ_HANDLE_T_OPAQUE frsh_synchobj_handle_t;
227 #endif /* !FRSH_CORE_TYPES_H_ */