]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blob - frsh_shared_objects_types.h
const
[frescor/frsh-include.git] / frsh_shared_objects_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
59 //==============================================
60 //  ******** *******    ********  **      **
61 //  **///// /**////**  **//////  /**     /**
62 //  **      /**   /** /**        /**     /**
63 //  ******* /*******  /********* /**********
64 //  **////  /**///**  ////////** /**//////**
65 //  **      /**  //**        /** /**     /**
66 //  **      /**   //** ********  /**     /**
67 //  //       //     // ////////   //      // 
68 //
69 // FRSH(FRescor ScHeduler), pronounced "fresh"
70 //==============================================
71
72 #ifndef         FRSH_SHARED_OBJECTS_TYPES_H_
73 #define         FRSH_SHARED_OBJECTS_TYPES_H_
74
75 #include <time.h>
76 #include "frsh_core_types.h"
77 #include "frsh_configuration_parameters.h"
78
79 FRSH_CPP_BEGIN_DECLS
80
81 /**
82  * @file frsh_shared_objects_types.h
83  **/
84
85 /**
86  * @addtogroup sharedobj
87  *
88  * @{
89  **/
90
91 /** Mutex object.  Attributes are handled by FOSA **/
92 typedef fosa_mutex_t frsh_mutex_t;
93
94
95 /** 
96  *  Shared object handle:  It is an opaque type (i.e. the internal
97  *  structure of this data type is implementation dependent).
98  **/
99 typedef FRSH_SHAREDOBJ_HANDLE_T_OPAQUE  frsh_sharedobj_handle_t; 
100
101 /**
102  *  Shared object textual label
103  **/
104 typedef char frsh_sharedobj_label_t[FRSH_MAX_SIZE_SHARED_OBJ_LABEL + 1];
105
106 /**
107  * Kind of shared object: protected or unprotected
108  */
109 typedef enum 
110   {FRSH_SOK_UNPROTECTED, FRSH_SOK_PROTECTED}
111 frsh_sharedobj_kind_t;
112
113 /**
114  * Kind of protected operation: read, write or unchecked
115  **/
116 typedef enum 
117   {FRSH_CSOK_UNCHECKED, FRSH_CSOK_READ, FRSH_CSOK_WRITE} 
118 frsh_csect_op_kind_t;                           
119
120 /**
121  *  Pointer to protected operation, which takes a pointer to
122  *  the input parameters, and a pointer to the output 
123  *  parameters; the user is responsible for not exceeding the 
124  *  sizes of the respective input and output parameters data structures
125  */
126 typedef void (*frsh_csect_op_t)
127           (const void * input_arg, void * output_arg);
128
129 /**
130  *  A memory area
131  */
132 typedef struct {
133   size_t size;
134   void * area;
135 } frsh_memory_area_data_t;
136
137 /** 
138  * Memory areas container 
139  **/
140 typedef struct {
141     int size; // = 0
142     frsh_memory_area_data_t memory_areas[FRSH_MAX_N_MEMORY_AREAS];
143 } frsh_memory_areas_t;
144
145
146 /**
147  * Critical section data (opaque type)
148  **/
149 typedef FRSH_CSECT_T_OPAQUE frsh_csect_t;
150
151
152 /**
153  * Container of a group of critical sections, up to a maximum size
154  **/
155 typedef struct {
156   int size;     // size of the group; initially=0
157   frsh_csect_t csects[FRSH_MAX_N_CRITICAL_SECTIONS]; // array of csect 
158 } frsh_csects_group_t;
159
160 /*@}*/
161
162
163 FRSH_CPP_END_DECLS
164
165 #endif      /* !FRSH_SHARED_OBJECTS_TYPES_H_ */