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 // -----------------------------------------------------------------------
58 //frsh_implementation_specific.h
59 //==============================================
60 // ******** ******* ******** ** **
61 // **///// /**////** **////// /** /**
62 // ** /** /** /** /** /**
63 // ******* /******* /********* /**********
64 // **//// /**///** ////////** /**//////**
65 // ** /** //** /** /** /**
66 // ** /** //** ******** /** /**
67 // // // // //////// // //
69 // FRSH(FRescor ScHeduler), pronounced "fresh"
70 //==============================================
71 #ifndef _FRSH_IMPLEMENTATION_SPECIFIC_H_
72 #define _FRSH_IMPLEMENTATION_SPECIFIC_H_
74 #include "frsh_implementation_specific_types.h"
75 #include "frsh_core.h"
77 #define FRSH_IMPLEMENTATION_SPECIFIC_MODULE_SUPPORTED 1
80 * @file frsh_implementation_specific.h
85 * @defgroup implementationspec Implementation Specific module
87 * The operations defined in this module are of optional use. The
88 * intention is to provide better tunning options taking advantage of
89 * specific characteristics of the underlaying OS.
92 * e.g. being able to manually assign priorities assuming that the OS
93 * uses a fixed priority paradigm).
99 * frsh_contract_set_preemption_level()
101 * The operation updates the specified contract parameters object by
102 * setting its preemption level to the specified input parameter.
104 * OBSERVATION: if this value is changed being any contract that
105 * uses the resource already accepted, the system's behavior and
106 * particularly the acceptance tests correctness are not garantee
107 * and probably wrong.
110 int frsh_contract_set_preemption_level
111 (frsh_contract_t *contract,
112 frsh_preemption_level_t preemption_level);
116 * frsh_contract_get_preemption_level()
118 * The operation obtains from the specified contract parameters object
119 * its preemption level and copies it to the place pointed to by the
120 * specified input parameter.
122 int frsh_contract_get_preemption_level
123 (const frsh_contract_t *contract,
124 frsh_preemption_level_t *preemption_level);
127 * frsh_service_thread_set_preemption_level()
129 * This function sets the preemption level of the service thread to
130 * the specified value. The initial preemption level is a configurable
131 * parameter. This value is stored in a temporary variable and it is
132 * used the next time the service thread data is updated with the
133 * frsh_set_service_thread_data() function.
135 int frsh_service_thread_set_preemption_level
136 (frsh_preemption_level_t preemption_level);
139 * frsh_service_thread_get_preemption_level()
141 * This function stores the current preemption level of the service
142 * thread in the variable pointed to by preemption_level
144 int frsh_service_thread_get_preemption_level
145 (frsh_preemption_level_t *preemption_level);
151 * This operation shall terminate the calling thread, make the value
152 * value_ptr available to any successful join with the terminating
153 * thread, and unbind the thread from its associated vres. After
154 * cleaning up the thread management data, it is unbound and the
155 * scheduling policy is changed to fixed priority before the posix
156 * pthread_exit() function is called.
158 * There is a limitation in the current version of the
159 * MaRTE implementation that causes the information of a terminated
160 * thread to continue to be stored in the frsh scheduler, and the thread
161 * to continue to be counted in the number of threads. The
162 * frsh_thread_exit operation allows the implementation to delete the
163 * thread's information, and then terminate the thread. Therefore, it
164 * is recommended to use this function to terminate a thread under frsh.
166 * Implementation dependent issue: in the implementation with an
167 * application scheduler, after cleaning up the thread management
168 * data, it is unbound and the scheduling policy changed to fixed
169 * priority before calling the posix pthread_exit() function.
171 void frsh_thread_exit (void *value_ptr);
175 * frsh_sharedobj_set_preemption_level()
177 * The operation updates the specified shared object by setting its
178 * preemption level to the specified input parameter.
180 * OBSERVATION: if this value is changed being any contract that
181 * uses the resource already accepted, the system's behavior and
182 * particularly the acceptance tests correctness are not garantee
183 * and probably wrong.
185 int frsh_sharedobj_set_preemption_level(frsh_sharedobj_handle_t obj_handle,
186 frsh_preemption_level_t preemption_level);
189 * frsh_sharedobj_get_preemption_level()
191 * The operation obtains from the specified shared object its
192 * preemption level and copies it to the place pointed to by the
193 * specified input parameter.
195 int frsh_sharedobj_get_preemption_level(frsh_sharedobj_handle_t obj_handle,
196 frsh_preemption_level_t *preemption_level);
201 #endif // _FRSH_IMPLEMENTATION_SPECIFIC_H_