Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics: "st" was for "storage". Remove it from acronym.
[simgrid.git] / src / simix / smx_smurf_private.h
1  /* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef _SIMIX_SMURF_PRIVATE_H
8 #define _SIMIX_SMURF_PRIVATE_H
9
10 /********************************* Simcalls *********************************/
11
12 /* we want to build the e_smx_simcall_t enumeration, the table of the
13  * corresponding simcalls string names, and the simcall handlers table
14  * automatically, using macros.
15  * To add a new simcall follow the following syntax:
16  *
17  * SIMCALL_ENUM_ELEMENT(<simcall_enumeration_id>, <simcall_handler_function>)
18  *
19  * */
20
21 /****************************
22  * SIMCALL GENERATING MACRO *
23  ****************************
24  *
25  * action(ENUM_NAME, func_name, result_type, params…) 
26  *
27  **/
28
29 /*
30  * Some macro machinery to get a MAP over the arguments of a variadic macro.
31  * It uses a FOLD to apply a macro to every argument, and because there is
32  * no recursion in the C preprocessor we must create a new macro for every
33  * depth of FOLD's recursion.
34  */
35
36 /* FOLD macro */
37 #define FE_0(WHAT, X, ...)
38 #define FE_1(I, WHAT, X) WHAT(I, X)
39 #define FE_2(I, WHAT, X, ...) WHAT(I, X), FE_1(I+1, WHAT, __VA_ARGS__)
40 #define FE_3(I, WHAT, X, ...) WHAT(I, X), FE_2(I+1, WHAT, __VA_ARGS__)
41 #define FE_4(I, WHAT, X, ...) WHAT(I, X), FE_3(I+1, WHAT, __VA_ARGS__)
42 #define FE_5(I, WHAT, X, ...) WHAT(I, X), FE_4(I+1, WHAT, __VA_ARGS__)
43 #define FE_6(I, WHAT, X, ...) WHAT(I, X), FE_5(I+1, WHAT, __VA_ARGS__)
44 #define FE_7(I, WHAT, X, ...) WHAT(I, X), FE_6(I+1, WHAT, __VA_ARGS__)
45 #define FE_8(I, WHAT, X, ...) WHAT(I, X), FE_7(I+1, WHAT, __VA_ARGS__)
46 #define FE_9(I, WHAT, X, ...) WHAT(I, X), FE_8(I+1, WHAT, __VA_ARGS__)
47 #define FE_10(I, WHAT, X, ...) WHAT(I, X), FE_9(I+1, WHAT, __VA_ARGS__)
48
49 /* NOTE: add as many FE_n as needed (maximum number of simcall arguments )*/
50
51 /* Make a MAP macro usgin FOLD (will apply 'action' to the arguments.
52  * GET_MACRO is a smart hack that counts the number of arguments passed to
53  * the variadic macro, and it is used to invoke the right FOLD depth.
54  */
55 #define GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,NAME,...) NAME
56 #define MAP(action, ...) \
57   GET_MACRO(, ##__VA_ARGS__, FE_10,FE_9,FE_8,FE_7,FE_6,FE_5,FE_4,FE_3,FE_2,FE_1, FE_0) (0, action, __VA_ARGS__)
58
59 /* MAP with default arguments */
60 #define APPLY_MAP(WHAT, I, X, ...) WHAT(I, __VA_ARGS__, X)
61 #define FE_DA_0(I, WHAT, args, X, ...)
62 #define FE_DA_1(I, WHAT, args, X, ...) APPLY_MAP(WHAT, I, X, args)
63 #define FE_DA_2(I, WHAT, args, X, ...) APPLY_MAP(WHAT, I, X, args) FE_DA_1(I+1, WHAT, args, __VA_ARGS__)
64 #define FE_DA_3(I, WHAT, args, X, ...) APPLY_MAP(WHAT, I, X, args) FE_DA_2(I+1, WHAT, args, __VA_ARGS__)
65 #define FE_DA_4(I, WHAT, args, X, ...) APPLY_MAP(WHAT, I, X, args) FE_DA_3(I+1, WHAT, args, __VA_ARGS__)
66 #define FE_DA_5(I, WHAT, args, X, ...) APPLY_MAP(WHAT, I, X, args) FE_DA_4(I+1, WHAT, args, __VA_ARGS__)
67 #define FE_DA_6(I, WHAT, args, X, ...) APPLY_MAP(WHAT, I, X, args) FE_DA_5(I+1, WHAT, args, __VA_ARGS__)
68 #define FE_DA_7(I, WHAT, args, X, ...) APPLY_MAP(WHAT, I, X, args) FE_DA_6(I+1, WHAT, args, __VA_ARGS__)
69 #define FE_DA_8(I, WHAT, args, X, ...) APPLY_MAP(WHAT, I, X, args) FE_DA_7(I+1, WHAT, args, __VA_ARGS__)
70 #define FE_DA_9(I, WHAT, args, X, ...) APPLY_MAP(WHAT, I, X, args) FE_DA_8(I+1, WHAT, args, __VA_ARGS__)
71 #define FE_DA_10(I, WHAT, args, X, ...) APPLY_MAP(WHAT, I, X, args) FE_DA_9(I+1, WHAT, args, __VA_ARGS__)
72
73 #define MAP_WITH_DEFAULT_ARGS(action, args, ...) \
74   GET_MACRO(, ##__VA_ARGS__, FE_DA_10,FE_DA_9,FE_DA_8,FE_DA_7,FE_DA_6,FE_DA_5,FE_DA_4,FE_DA_3,FE_DA_2,FE_DA_1, FE_DA_0) (0, action, args, __VA_ARGS__)
75
76 /*
77  * Define scalar type wrappers to ease the use of simcalls.
78  * These are used to wrap the arguments in SIMIX_simcall macro.
79  */
80 #define TCHAR(n) (n, char, c)
81 #define TSTRING(n) (n, const char*, cc)
82 #define TSHORT(n) (n, short, s)
83 #define TINT(n) (n, int, i)
84 #define TLONG(n) (n, long, l)
85 #define TUCHAR(n) (n, unsigned char, uc)
86 #define TUSHORT(n) (n, unsigned short, us)
87 #define TUINT(n) (n, unsigned int, ui)
88 #define TULONG(n) (n, unsigned long, ul)
89 #define TFLOAT(n) (n, float, f)
90 #define TDOUBLE(n) (n, double, d)
91 #define TDPTR(n) (n, void*, dp, void*)
92 #define TFPTR(n) (n, FPtr, fp, FPtr)
93 #define TCPTR(n) (n, const void*, cp)
94 #define TSIZE(n) (n, size_t, sz)
95 #define TSGSIZE(n) (n, sg_size_t, sgsz)
96 #define TVOID(n) (n, void)
97 #define TDSPEC(n,t) (n, t, dp, void*)
98 #define TFSPEC(n,t) (n, t, fp, FPtr)
99
100 /* use comma or nothing to separate elements*/
101 #define SIMCALL_SEP_COMMA ,
102 #define SIMCALL_SEP_NOTHING
103
104 /* get the name of the parameter */
105 #define SIMCALL_NAME_(name, type, field, ...) name
106 #define SIMCALL_NAME(i, v) SIMCALL_NAME_ v
107
108 /* get the cast of the parameter */
109 #define SIMCALL_CASTTYPE_(name, type, field, cast) (cast)
110 #define SIMCALL_NOCASTTYPE_(name, type, field) 
111 #define SIMCALL_CASTTYPE(...) MAYBE5(,##__VA_ARGS__, SIMCALL_CASTTYPE_, SIMCALL_NOCASTTYPE_) (__VA_ARGS__)
112
113 /* get the uncast of the parameter */
114 #define SIMCALL_UNCASTTYPE_(name, type, field, cast) (type)
115 #define SIMCALL_NOUNCASTTYPE_(name, type, field) 
116 #define SIMCALL_UNCASTTYPE(...) MAYBE5(,##__VA_ARGS__, SIMCALL_UNCASTTYPE_, SIMCALL_NOUNCASTTYPE_) (__VA_ARGS__)
117
118 /* get the %s format code of the parameter */
119 #define SIMCALL_FORMAT_(name, type, field, ...) %field
120 #define SIMCALL_FORMAT(i, v) SIMCALL_FORMAT_ v
121
122 /* get the field of the parameter */
123 #define SIMCALL_FIELD_(name, type, field, ...) field
124 #define SIMCALL_FIELD(i, v) SIMCALL_FIELD_ v
125
126 /* get the parameter declaration */
127 #define SIMCALL_ARG_(name, type, field, ...) type name
128 #define SIMCALL_ARG(i, v) SIMCALL_ARG_ v
129
130 /* get the parameter initialisation field */
131 #define SIMCALL_INIT_FIELD_(name, type, field, ...) .field = SIMCALL_CASTTYPE(name, type, field,##__VA_ARGS__) name
132 #define SIMCALL_INIT_FIELD(i, d, v) self->simcall.args[i]SIMCALL_INIT_FIELD_ v;
133
134 /* get the case of the parameter */
135 #define SIMCALL_CASE_PARAM_(name, type, field, ...) field
136 #define SIMCALL_CASE_PARAM(i, v) SIMCALL_UNCASTTYPE v simcall->args[i].SIMCALL_CASE_PARAM_ v
137
138 /* generate some code for SIMCALL_CASE if the simcall has an answer */
139 #define MAYBE5(_0, _1, _2, _3, _4, func, ...) func
140 #define MAYBE3(_0, _1, _2, func, ...) func
141 #define MAYBE2(_0, _1, func, ...) func
142
143 #define SIMCALL_WITH_RESULT_BEGIN(name, type, field, ...) simcall->result.field =
144 #define SIMCALL_WITHOUT_RESULT_BEGIN(name, type, field)
145 #define SIMCALL_RESULT_BEGIN_(name, type, ...)\
146         MAYBE3(,##__VA_ARGS__, SIMCALL_WITH_RESULT_BEGIN, SIMCALL_WITH_RESULT_BEGIN, SIMCALL_WITHOUT_RESULT_BEGIN)\
147         (name, type, __VA_ARGS__)
148 #define SIMCALL_RESULT_BEGIN(answer, res) answer(SIMCALL_RESULT_BEGIN_ res)
149
150 #define SIMCALL_RESULT_END_(name, type, ...)\
151         SIMIX_simcall_answer(simcall);
152 #define SIMCALL_RESULT_END(answer, res) answer(SIMCALL_RESULT_END_ res)
153
154 /* generate some code for BODY function */
155 #define SIMCALL_FUNC_RETURN_TYPE_(name, type, ...) type
156 #define SIMCALL_FUNC_RETURN_TYPE(res) SIMCALL_FUNC_RETURN_TYPE_ res
157
158 #define SIMCALL_WITH_FUNC_SIMCALL(name, type, field) smx_simcall_t simcall = 
159 #define SIMCALL_WITHOUT_FUNC_SIMCALL(name, type, field)
160 #define SIMCALL_FUNC_SIMCALL_(name, type, ...)\
161         MAYBE3(,##__VA_ARGS__, SIMCALL_WITH_FUNC_SIMCALL, SIMCALL_WITH_FUNC_SIMCALL, SIMCALL_WITHOUT_FUNC_SIMCALL)\
162         (name, type, __VA_ARGS__)
163 #define SIMCALL_FUNC_SIMCALL(res) SIMCALL_FUNC_SIMCALL_ res
164
165 #define SIMCALL_WITH_FUNC_RETURN(name, type, field, ...) return self->simcall.result.field;
166 #define SIMCALL_WITHOUT_FUNC_RETURN(name, type, field)
167 #define SIMCALL_FUNC_RETURN_(name, type, ...)\
168         MAYBE3(,##__VA_ARGS__, SIMCALL_WITH_FUNC_RETURN, SIMCALL_WITH_FUNC_RETURN, SIMCALL_WITHOUT_FUNC_RETURN)\
169         (name, type, __VA_ARGS__)
170 #define SIMCALL_FUNC_RETURN(res) SIMCALL_FUNC_RETURN_ res
171
172
173 /* generate the simcall enumeration */
174 #define SIMCALL_ENUM(type, ...)\
175         type
176
177 /* generate the strings name from the enumeration values */
178 #define SIMCALL_STRING_TYPE(type, name, answer, res, ...)\
179         [type] = STRINGIFY(type)
180
181 /* generate strings from the enumeration values */
182 #define SIMCALL_TYPE(type, name, answer, res, ...)\
183         [type] = STRINGIFY(MAP(SIMCALL_FORMAT, __VA_ARGS__))
184
185 /* generate the simcalls BODY functions */
186 #define SIMCALL_FUNC(TYPE, NAME, ANSWER, RES, ...)\
187   inline static SIMCALL_FUNC_RETURN_TYPE(RES) simcall_BODY_##NAME(MAP(SIMCALL_ARG, ##__VA_ARGS__)) { \
188     smx_process_t self = SIMIX_process_self(); \
189     self->simcall.call = TYPE; \
190     memset(&self->simcall.result, 0, sizeof(self->simcall.result)); \
191     memset(self->simcall.args, 0, sizeof(self->simcall.args)); \
192     MAP_WITH_DEFAULT_ARGS(SIMCALL_INIT_FIELD, (), ##__VA_ARGS__) \
193     if (self != simix_global->maestro_process) { \
194       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, \
195                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); \
196       SIMIX_process_yield(self); \
197     } else { \
198       SIMIX_simcall_pre(&self->simcall, 0); \
199     } \
200     SIMCALL_FUNC_RETURN(RES) \
201   }
202
203 /* generate a comma if there is an argument*/
204 #define WITHOUT_COMMA 
205 #define WITH_COMMA ,
206 #define GET_CLEAN(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10, NAME,...) NAME
207 #define MAYBE_COMMA(...) GET_CLEAN(,##__VA_ARGS__,WITH_COMMA,WITH_COMMA,WITH_COMMA,WITH_COMMA,WITH_COMMA,WITH_COMMA,WITH_COMMA,WITH_COMMA,WITH_COMMA,WITH_COMMA,WITHOUT_COMMA)
208
209 /* generate the simcalls cases for the SIMIX_simcall_pre function */
210 #define WITH_ANSWER(...) __VA_ARGS__
211 #define WITHOUT_ANSWER(...) 
212 #define SIMCALL_CASE(type, name, answer, res, ...)\
213     case type:\
214       SIMCALL_RESULT_BEGIN(answer, res) SIMIX_pre_ ## name(simcall MAYBE_COMMA(__VA_ARGS__) MAP(SIMCALL_CASE_PARAM, ##__VA_ARGS__));\
215       SIMCALL_RESULT_END(answer, res)\
216       break;
217
218
219 /*
220  * Generate simcall args and result getter/setter
221  */
222 #define SIMCALL_GS_SC_NAME_(n) n
223 #define SIMCALL_GS_SC_NAME(n) SIMCALL_GS_SC_NAME_ n
224 #define SIMCALL_GS_ARG_NAME(n) SIMCALL_NAME_ n
225 #define JOIN2(_0, _1) _0 ##__## _1
226 #define JOIN3(_0, _1, _2) JOIN2(_0 ##__## _1, _2)
227 #define JOIN4(_0, _1, _2, _3) JOIN3(_0 ##_## _1, _2, _3)
228 #define SIMCALL_GS_FUNC(scname, setget, vname) \
229    JOIN4(simcall, scname, setget, vname)
230
231 /* generate the simcalls args getter/setter */
232 #define SIMCALL_ARG_GETSET_(i, name, v) \
233   static inline SIMCALL_FUNC_RETURN_TYPE(v) SIMCALL_GS_FUNC(SIMCALL_GS_SC_NAME(name), get, SIMCALL_GS_ARG_NAME(v))(smx_simcall_t simcall){\
234     return (SIMCALL_FUNC_RETURN_TYPE(v)) simcall->args[i].SIMCALL_FIELD_ v ;\
235   }\
236   static inline void SIMCALL_GS_FUNC(SIMCALL_GS_SC_NAME(name), set, SIMCALL_GS_ARG_NAME(v))(smx_simcall_t simcall, SIMCALL_ARG_ v){\
237     simcall->args[i].SIMCALL_FIELD_ v = SIMCALL_CASTTYPE v SIMCALL_NAME_ v ;\
238   }
239
240 #define SIMCALL_ARG_GETSET(type, name, answer, res, ...)\
241     MAP_WITH_DEFAULT_ARGS(SIMCALL_ARG_GETSET_, (name), ##__VA_ARGS__)
242
243 /* generate the simcalls result getter/setter */
244 #define SIMCALL_WITH_RES_GETSET(name, v) \
245   static inline SIMCALL_FUNC_RETURN_TYPE(v) SIMCALL_GS_FUNC(SIMCALL_GS_SC_NAME((name)), get, SIMCALL_GS_ARG_NAME(v))(smx_simcall_t simcall){\
246     return (SIMCALL_FUNC_RETURN_TYPE(v)) simcall->result.SIMCALL_FIELD_ v ;\
247   }\
248   static inline void SIMCALL_GS_FUNC(SIMCALL_GS_SC_NAME((name)), set, SIMCALL_GS_ARG_NAME(v))(smx_simcall_t simcall, SIMCALL_ARG_ v){\
249     simcall->result.SIMCALL_FIELD_ v = SIMCALL_NAME_ v ;\
250   }
251 #define SIMCALL_WITHOUT_RES_GETSET(name, v)
252 #define SIMCALL_RES_GETSET__(name, type, ...)\
253         MAYBE3(,##__VA_ARGS__, SIMCALL_WITH_RES_GETSET, SIMCALL_WITH_RES_GETSET, SIMCALL_WITHOUT_RES_GETSET)
254 #define SIMCALL_RES_GETSET_(scname, v)\
255         SIMCALL_RES_GETSET__ v (scname, v)
256 #define SIMCALL_RES_GETSET(type, name, answer, res, ...)\
257   SIMCALL_RES_GETSET_(name, res)
258
259 /* generate the simcalls result getter/setter protos*/
260 #define SIMCALL_WITH_RES_GETSET_PROTO(name, v) \
261   inline SIMCALL_FUNC_RETURN_TYPE(v) SIMCALL_GS_FUNC(SIMCALL_GS_SC_NAME((name)), get, SIMCALL_GS_ARG_NAME(v))(smx_simcall_t simcall);\
262   inline void SIMCALL_GS_FUNC(SIMCALL_GS_SC_NAME((name)), set, SIMCALL_GS_ARG_NAME(v))(smx_simcall_t simcall, SIMCALL_ARG_ v);
263 #define SIMCALL_WITHOUT_RES_GETSET_PROTO(name, v)
264 #define SIMCALL_RES_GETSET_PROTO__(name, type, ...)\
265         MAYBE3(,##__VA_ARGS__, SIMCALL_WITH_RES_GETSET_PROTO, SIMCALL_WITHOUT_RES_GETSET_PROTO, SIMCALL_WITHOUT_RES_GETSET_PROTO)
266 #define SIMCALL_RES_GETSET_PROTO_(scname, v)\
267         SIMCALL_RES_GETSET_PROTO__ v (scname, v)
268 #define SIMCALL_RES_GETSET_PROTO(type, name, answer, res, ...)\
269   SIMCALL_RES_GETSET_PROTO_(name, res)
270
271 /* stringify arguments */
272 #define STRINGIFY_(...) #__VA_ARGS__
273 #define STRINGIFY(...) STRINGIFY_(__VA_ARGS__)
274
275 /* the list of simcalls definitions */
276 #define SIMCALL_LIST1(ACTION, sep) \
277 ACTION(SIMCALL_HOST_GET_BY_NAME, host_get_by_name, WITH_ANSWER, TDSPEC(result, smx_host_t), TSTRING(name)) sep \
278 ACTION(SIMCALL_HOST_GET_NAME, host_get_name, WITH_ANSWER, TSTRING(result), TDSPEC(host, smx_host_t)) sep \
279 ACTION(SIMCALL_HOST_ON, host_on, WITH_ANSWER, TVOID(result), TDSPEC(host, smx_host_t)) sep \
280 ACTION(SIMCALL_HOST_OFF, host_off, WITH_ANSWER, TVOID(result), TDSPEC(host, smx_host_t)) sep \
281 ACTION(SIMCALL_HOST_GET_PROPERTIES, host_get_properties, WITH_ANSWER, TDSPEC(result, xbt_dict_t), TDSPEC(host, smx_host_t)) sep \
282 ACTION(SIMCALL_HOST_GET_CORE, host_get_core, WITH_ANSWER, TINT(result), TDSPEC(host, smx_host_t)) sep \
283 ACTION(SIMCALL_HOST_GET_PROCESS_LIST, host_get_process_list, WITH_ANSWER, TDSPEC(result, xbt_swag_t), TDSPEC(host, smx_host_t)) sep \
284 ACTION(SIMCALL_HOST_GET_SPEED, host_get_speed, WITH_ANSWER, TDOUBLE(result), TDSPEC(host, smx_host_t)) sep \
285 ACTION(SIMCALL_HOST_GET_AVAILABLE_SPEED, host_get_available_speed, WITH_ANSWER, TDOUBLE(result), TDSPEC(host, smx_host_t)) sep \
286 ACTION(SIMCALL_HOST_GET_STATE, host_get_state, WITH_ANSWER, TINT(result), TDSPEC(host, smx_host_t)) sep \
287 ACTION(SIMCALL_HOST_GET_DATA, host_get_data, WITH_ANSWER, TDPTR(result), TDSPEC(host, smx_host_t)) sep \
288 ACTION(SIMCALL_HOST_SET_DATA, host_set_data, WITH_ANSWER, TVOID(result), TDSPEC(host, smx_host_t), TDPTR(data)) sep \
289 ACTION(SIMCALL_HOST_GET_CURRENT_POWER_PEAK, host_get_current_power_peak, WITH_ANSWER, TDOUBLE(result), TDSPEC(host, smx_host_t)) sep \
290 ACTION(SIMCALL_HOST_GET_POWER_PEAK_AT, host_get_power_peak_at, WITH_ANSWER, TDOUBLE(result), TDSPEC(host, smx_host_t), TINT(pstate_index)) sep \
291 ACTION(SIMCALL_HOST_GET_NB_PSTATES, host_get_nb_pstates, WITH_ANSWER, TINT(result), TDSPEC(host, smx_host_t)) sep \
292 ACTION(SIMCALL_HOST_SET_POWER_PEAK_AT, host_set_power_peak_at, WITH_ANSWER, TVOID(result), TDSPEC(host, smx_host_t), TINT(pstate_index)) sep \
293 ACTION(SIMCALL_HOST_GET_CONSUMED_ENERGY, host_get_consumed_energy, WITH_ANSWER, TDOUBLE(result), TDSPEC(host, smx_host_t)) sep \
294 ACTION(SIMCALL_HOST_EXECUTE, host_execute, WITH_ANSWER, TDSPEC(result, smx_action_t), TSTRING(name), TDSPEC(host, smx_host_t), TDOUBLE(computation_amount), TDOUBLE(priority), TDOUBLE(bound), TULONG(affinity_mask)) sep \
295 ACTION(SIMCALL_HOST_PARALLEL_EXECUTE, host_parallel_execute, WITH_ANSWER, TDSPEC(result, smx_action_t), TSTRING(name), TINT(host_nb), TDSPEC(host_list, smx_host_t*), TDSPEC(computation_amount, double*), TDSPEC(communication_amount, double*), TDOUBLE(amount), TDOUBLE(rate)) sep \
296 ACTION(SIMCALL_HOST_EXECUTION_DESTROY, host_execution_destroy, WITH_ANSWER, TVOID(result), TDSPEC(execution, smx_action_t)) sep \
297 ACTION(SIMCALL_HOST_EXECUTION_CANCEL, host_execution_cancel, WITH_ANSWER, TVOID(result), TDSPEC(execution, smx_action_t)) sep \
298 ACTION(SIMCALL_HOST_EXECUTION_GET_REMAINS, host_execution_get_remains, WITH_ANSWER, TDOUBLE(result), TDSPEC(execution, smx_action_t)) sep \
299 ACTION(SIMCALL_HOST_EXECUTION_GET_STATE, host_execution_get_state, WITH_ANSWER, TINT(result), TDSPEC(execution, smx_action_t)) sep \
300 ACTION(SIMCALL_HOST_EXECUTION_SET_PRIORITY, host_execution_set_priority, WITH_ANSWER, TVOID(result), TDSPEC(execution, smx_action_t), TDOUBLE(priority)) sep \
301 ACTION(SIMCALL_HOST_EXECUTION_SET_BOUND, host_execution_set_bound, WITH_ANSWER, TVOID(result), TDSPEC(execution, smx_action_t), TDOUBLE(bound)) sep \
302 ACTION(SIMCALL_HOST_EXECUTION_SET_AFFINITY, host_execution_set_affinity, WITH_ANSWER, TVOID(result), TDSPEC(execution, smx_action_t), TDSPEC(ws, smx_host_t), TULONG(mask)) sep \
303 ACTION(SIMCALL_HOST_EXECUTION_WAIT, host_execution_wait, WITHOUT_ANSWER, TINT(result), TDSPEC(execution, smx_action_t)) sep \
304 ACTION(SIMCALL_HOST_GET_STORAGE_LIST, host_get_storage_list, WITH_ANSWER, TDSPEC(result, xbt_dict_t), TDSPEC(host, smx_host_t)) sep \
305 ACTION(SIMCALL_HOST_GET_PARAMS, host_get_params, WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t), TDSPEC(params, ws_params_t)) sep \
306 ACTION(SIMCALL_HOST_SET_PARAMS, host_set_params, WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t), TDSPEC(params, ws_params_t)) sep \
307 ACTION(SIMCALL_VM_CREATE, vm_create, WITH_ANSWER, TDPTR(result), TSTRING(name), TDSPEC(ind_pm, smx_host_t)) sep \
308 ACTION(SIMCALL_VM_START, vm_start, WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t)) sep \
309 ACTION(SIMCALL_VM_SET_STATE, vm_set_state, WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t), TINT(state)) sep \
310 ACTION(SIMCALL_VM_GET_STATE, vm_get_state, WITH_ANSWER, TINT(result), TDSPEC(ind_vm, smx_host_t)) sep \
311 ACTION(SIMCALL_VM_MIGRATE, vm_migrate, WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t), TDSPEC(ind_dst_pm, smx_host_t)) sep \
312 ACTION(SIMCALL_VM_GET_PM, vm_get_pm, WITH_ANSWER,    TDPTR(result),  TDSPEC(ind_vm, smx_host_t)) sep \
313 ACTION(SIMCALL_VM_SET_BOUND,    vm_set_bound,    WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t), TDOUBLE(bound)) sep \
314 ACTION(SIMCALL_VM_SET_AFFINITY, vm_set_affinity, WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t), TDSPEC(ind_pm, smx_host_t), TULONG(mask)) sep \
315 ACTION(SIMCALL_VM_DESTROY,   vm_destroy,   WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t)) sep \
316 ACTION(SIMCALL_VM_SUSPEND,   vm_suspend,   WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t)) sep \
317 ACTION(SIMCALL_VM_RESUME,    vm_resume,    WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t)) sep \
318 ACTION(SIMCALL_VM_SHUTDOWN,  vm_shutdown,  WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t)) sep \
319 ACTION(SIMCALL_VM_SAVE,      vm_save,      WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t)) sep \
320 ACTION(SIMCALL_VM_RESTORE,   vm_restore,   WITH_ANSWER, TVOID(result), TDSPEC(ind_vm, smx_host_t)) sep \
321 ACTION(SIMCALL_PROCESS_CREATE, process_create, WITH_ANSWER, TVOID(result), TDSPEC(process, smx_process_t*), TSTRING(name), TFSPEC(code, xbt_main_func_t), TDPTR(data), TSTRING(hostname), TDOUBLE(kill_time), TINT(argc), TDSPEC(argv, char**), TDSPEC(properties, xbt_dict_t), TINT(auto_restart)) sep \
322 ACTION(SIMCALL_PROCESS_KILL, process_kill, WITH_ANSWER, TVOID(result), TDSPEC(process, smx_process_t)) sep \
323 ACTION(SIMCALL_PROCESS_KILLALL, process_killall, WITH_ANSWER, TVOID(result), TINT(reset_pid)) sep \
324 ACTION(SIMCALL_PROCESS_CLEANUP, process_cleanup, WITH_ANSWER, TVOID(result), TDSPEC(process, smx_process_t)) sep \
325 ACTION(SIMCALL_PROCESS_CHANGE_HOST, process_change_host, WITH_ANSWER, TVOID(result), TDSPEC(process, smx_process_t), TDSPEC(dest, smx_host_t)) sep \
326 ACTION(SIMCALL_PROCESS_SUSPEND, process_suspend, WITHOUT_ANSWER, TVOID(result), TDSPEC(process, smx_process_t)) sep \
327 ACTION(SIMCALL_PROCESS_RESUME, process_resume, WITH_ANSWER, TVOID(result), TDSPEC(process, smx_process_t)) sep \
328 ACTION(SIMCALL_PROCESS_COUNT, process_count, WITH_ANSWER, TINT(result)) sep \
329 ACTION(SIMCALL_PROCESS_GET_PID, process_get_PID, WITH_ANSWER, TINT(result), TDSPEC(process, smx_process_t)) sep  \
330 ACTION(SIMCALL_PROCESS_GET_PPID, process_get_PPID, WITH_ANSWER, TINT(result), TDSPEC(process, smx_process_t)) sep  \
331 ACTION(SIMCALL_PROCESS_GET_DATA, process_get_data, WITH_ANSWER, TDPTR(result), TDSPEC(process, smx_process_t)) sep \
332 ACTION(SIMCALL_PROCESS_SET_DATA, process_set_data, WITH_ANSWER, TVOID(result), TDSPEC(process, smx_process_t), TDPTR(data)) sep \
333 ACTION(SIMCALL_PROCESS_GET_HOST, process_get_host, WITH_ANSWER, TDSPEC(result, smx_host_t), TDSPEC(process, smx_process_t)) sep \
334 ACTION(SIMCALL_PROCESS_GET_NAME, process_get_name, WITH_ANSWER, TSTRING(result), TDSPEC(process, smx_process_t)) sep \
335 ACTION(SIMCALL_PROCESS_IS_SUSPENDED, process_is_suspended, WITH_ANSWER, TINT(result), TDSPEC(process, smx_process_t)) sep \
336 ACTION(SIMCALL_PROCESS_GET_PROPERTIES, process_get_properties, WITH_ANSWER, TDSPEC(result, xbt_dict_t), TDSPEC(process, smx_process_t)) sep \
337 ACTION(SIMCALL_PROCESS_SLEEP, process_sleep, WITHOUT_ANSWER, TINT(result), TDOUBLE(duration)) sep \
338 ACTION(SIMCALL_PROCESS_ON_EXIT, process_on_exit, WITH_ANSWER, TVOID(result), TDSPEC(process, smx_process_t), TFSPEC(fun, int_f_pvoid_t), TDPTR(data)) sep \
339 ACTION(SIMCALL_PROCESS_AUTO_RESTART_SET, process_auto_restart_set, WITH_ANSWER, TVOID(result), TDSPEC(process, smx_process_t), TINT(auto_restart)) sep \
340 ACTION(SIMCALL_PROCESS_RESTART, process_restart, WITH_ANSWER, TDSPEC(result, smx_process_t), TDSPEC(process, smx_process_t)) sep \
341 ACTION(SIMCALL_RDV_CREATE, rdv_create, WITH_ANSWER, TDSPEC(result, smx_rdv_t), TSTRING(name)) sep \
342 ACTION(SIMCALL_RDV_DESTROY, rdv_destroy, WITH_ANSWER, TVOID(result), TDSPEC(rdv, smx_rdv_t)) sep \
343 ACTION(SIMCALL_RDV_GET_BY_NAME, rdv_get_by_name, WITH_ANSWER, TDSPEC(result, smx_host_t), TSTRING(name)) sep \
344 ACTION(SIMCALL_RDV_COMM_COUNT_BY_HOST, rdv_comm_count_by_host, WITH_ANSWER, TUINT(result), TDSPEC(rdv, smx_rdv_t), TDSPEC(host, smx_host_t)) sep \
345 ACTION(SIMCALL_RDV_GET_HEAD, rdv_get_head, WITH_ANSWER, TDSPEC(result, smx_action_t), TDSPEC(rdv, smx_rdv_t)) sep \
346 ACTION(SIMCALL_RDV_SET_RECV, rdv_set_receiver, WITH_ANSWER, TVOID(result), TDSPEC(rdv, smx_rdv_t), TDSPEC(receiver, smx_process_t)) sep \
347 ACTION(SIMCALL_RDV_GET_RECV, rdv_get_receiver, WITH_ANSWER, TDSPEC(result, smx_process_t), TDSPEC(rdv, smx_rdv_t)) sep \
348 ACTION(SIMCALL_COMM_IPROBE, comm_iprobe, WITH_ANSWER, TDSPEC(result, smx_action_t), TDSPEC(rdv, smx_rdv_t), TINT(src), TINT(tag), TFSPEC(match_fun, simix_match_func_t), TDPTR(data)) sep \
349 ACTION(SIMCALL_COMM_SEND, comm_send, WITHOUT_ANSWER, TVOID(result), TDSPEC(rdv, smx_rdv_t), TDOUBLE(task_size), TDOUBLE(rate), TDPTR(src_buff), TSIZE(src_buff_size), TFSPEC(match_fun, simix_match_func_t), TDPTR(data), TDOUBLE(timeout)) sep \
350 ACTION(SIMCALL_COMM_ISEND, comm_isend, WITH_ANSWER, TDSPEC(result, smx_action_t), TDSPEC(rdv, smx_rdv_t), TDOUBLE(task_size), TDOUBLE(rate), TDPTR(src_buff), TSIZE(src_buff_size), TFSPEC(match_fun, simix_match_func_t), TFSPEC(clean_fun, simix_clean_func_t), TDPTR(data), TINT(detached)) sep \
351 ACTION(SIMCALL_COMM_RECV, comm_recv, WITHOUT_ANSWER, TVOID(result), TDSPEC(rdv, smx_rdv_t), TDPTR(dst_buff), TDSPEC(dst_buff_size, size_t*), TFSPEC(match_fun, simix_match_func_t), TDPTR(data), TDOUBLE(timeout)) sep \
352 ACTION(SIMCALL_COMM_IRECV, comm_irecv, WITH_ANSWER, TDSPEC(result, smx_action_t), TDSPEC(rdv, smx_rdv_t), TDPTR(dst_buff), TDSPEC(dst_buff_size, size_t*), TFSPEC(match_fun, simix_match_func_t), TDPTR(data)) sep \
353 ACTION(SIMCALL_COMM_RECV_BOUNDED, comm_recv_bounded, WITHOUT_ANSWER, TVOID(result), TDSPEC(rdv, smx_rdv_t), TDPTR(dst_buff), TDSPEC(dst_buff_size, size_t*), TFSPEC(match_fun, simix_match_func_t), TDPTR(data), TDOUBLE(timeout), TDOUBLE(rate)) sep \
354 ACTION(SIMCALL_COMM_IRECV_BOUNDED, comm_irecv_bounded, WITH_ANSWER, TDSPEC(result, smx_action_t), TDSPEC(rdv, smx_rdv_t), TDPTR(dst_buff), TDSPEC(dst_buff_size, size_t*), TFSPEC(match_fun, simix_match_func_t), TDPTR(data), TDOUBLE(rate)) sep \
355 ACTION(SIMCALL_COMM_DESTROY, comm_destroy, WITH_ANSWER, TVOID(result), TDSPEC(comm, smx_action_t)) sep \
356 ACTION(SIMCALL_COMM_CANCEL, comm_cancel, WITH_ANSWER, TVOID(result), TDSPEC(comm, smx_action_t)) sep \
357 ACTION(SIMCALL_COMM_WAITANY, comm_waitany, WITHOUT_ANSWER, TINT(result), TDSPEC(comms, xbt_dynar_t)) sep \
358 ACTION(SIMCALL_COMM_WAIT, comm_wait, WITHOUT_ANSWER, TVOID(result), TDSPEC(comm, smx_action_t), TDOUBLE(timeout)) sep \
359 ACTION(SIMCALL_COMM_TEST, comm_test, WITHOUT_ANSWER, TINT(result), TDSPEC(comm, smx_action_t)) sep \
360 ACTION(SIMCALL_COMM_TESTANY, comm_testany, WITHOUT_ANSWER, TINT(result), TDSPEC(comms, xbt_dynar_t)) sep \
361 ACTION(SIMCALL_COMM_GET_REMAINS, comm_get_remains, WITH_ANSWER, TDOUBLE(result), TDSPEC(comm, smx_action_t)) sep \
362 ACTION(SIMCALL_COMM_GET_STATE, comm_get_state, WITH_ANSWER, TINT(result), TDSPEC(comm, smx_action_t)) sep \
363 ACTION(SIMCALL_COMM_GET_SRC_DATA, comm_get_src_data, WITH_ANSWER, TDPTR(result), TDSPEC(comm, smx_action_t)) sep \
364 ACTION(SIMCALL_COMM_GET_DST_DATA, comm_get_dst_data, WITH_ANSWER, TDPTR(result), TDSPEC(comm, smx_action_t)) sep \
365 ACTION(SIMCALL_COMM_GET_SRC_PROC, comm_get_src_proc, WITH_ANSWER, TDSPEC(result, smx_process_t), TDSPEC(comm, smx_action_t)) sep \
366 ACTION(SIMCALL_COMM_GET_DST_PROC, comm_get_dst_proc, WITH_ANSWER, TDSPEC(result, smx_process_t), TDSPEC(comm, smx_action_t)) sep \
367 ACTION(SIMCALL_MUTEX_INIT, mutex_init, WITH_ANSWER, TDSPEC(result, smx_mutex_t)) sep \
368 ACTION(SIMCALL_MUTEX_DESTROY, mutex_destroy, WITH_ANSWER, TVOID(result), TDSPEC(mutex, smx_mutex_t)) sep \
369 ACTION(SIMCALL_MUTEX_LOCK, mutex_lock, WITHOUT_ANSWER, TVOID(result), TDSPEC(mutex, smx_mutex_t)) sep \
370 ACTION(SIMCALL_MUTEX_TRYLOCK, mutex_trylock, WITH_ANSWER, TINT(result), TDSPEC(mutex, smx_mutex_t)) sep \
371 ACTION(SIMCALL_MUTEX_UNLOCK, mutex_unlock, WITH_ANSWER, TVOID(result), TDSPEC(mutex, smx_mutex_t)) sep \
372 ACTION(SIMCALL_COND_INIT, cond_init, WITH_ANSWER, TDSPEC(result, smx_cond_t)) sep \
373 ACTION(SIMCALL_COND_DESTROY, cond_destroy, WITH_ANSWER, TVOID(result), TDSPEC(cond, smx_cond_t)) sep \
374 ACTION(SIMCALL_COND_SIGNAL, cond_signal, WITH_ANSWER, TVOID(result), TDSPEC(cond, smx_cond_t)) sep \
375 ACTION(SIMCALL_COND_WAIT, cond_wait, WITHOUT_ANSWER, TVOID(result), TDSPEC(cond, smx_cond_t), TDSPEC(mutex, smx_mutex_t)) sep \
376 ACTION(SIMCALL_COND_WAIT_TIMEOUT, cond_wait_timeout, WITHOUT_ANSWER, TVOID(result), TDSPEC(cond, smx_cond_t), TDSPEC(mutex, smx_mutex_t), TDOUBLE(timeout)) sep \
377 ACTION(SIMCALL_COND_BROADCAST, cond_broadcast, WITH_ANSWER, TVOID(result), TDSPEC(cond, smx_cond_t)) sep \
378 ACTION(SIMCALL_SEM_INIT, sem_init, WITH_ANSWER, TDSPEC(result, smx_sem_t), TINT(capacity)) sep \
379 ACTION(SIMCALL_SEM_DESTROY, sem_destroy, WITH_ANSWER, TVOID(result), TDSPEC(sem, smx_sem_t)) sep \
380 ACTION(SIMCALL_SEM_RELEASE, sem_release, WITH_ANSWER, TVOID(result), TDSPEC(sem, smx_sem_t)) sep \
381 ACTION(SIMCALL_SEM_WOULD_BLOCK, sem_would_block, WITH_ANSWER, TINT(result), TDSPEC(sem, smx_sem_t)) sep \
382 ACTION(SIMCALL_SEM_ACQUIRE, sem_acquire, WITHOUT_ANSWER, TVOID(result), TDSPEC(sem, smx_sem_t)) sep \
383 ACTION(SIMCALL_SEM_ACQUIRE_TIMEOUT, sem_acquire_timeout, WITHOUT_ANSWER, TVOID(result), TDSPEC(sem, smx_sem_t), TDOUBLE(timeout)) sep \
384 ACTION(SIMCALL_SEM_GET_CAPACITY, sem_get_capacity, WITH_ANSWER, TINT(result), TDSPEC(sem, smx_sem_t)) sep \
385 ACTION(SIMCALL_FILE_GET_DATA, file_get_data, WITH_ANSWER, TDPTR(result), TDSPEC(fd, smx_file_t)) sep \
386 ACTION(SIMCALL_FILE_SET_DATA, file_set_data, WITH_ANSWER, TVOID(result), TDSPEC(fd, smx_file_t), TDPTR(data)) sep \
387 ACTION(SIMCALL_FILE_READ, file_read, WITHOUT_ANSWER, TSIZE(result), TDSPEC(fd, smx_file_t),  TSIZE(size)) sep \
388 ACTION(SIMCALL_FILE_WRITE, file_write, WITHOUT_ANSWER, TSIZE(result), TDSPEC(fd, smx_file_t), TSIZE(size)) sep \
389 ACTION(SIMCALL_FILE_OPEN, file_open, WITHOUT_ANSWER, TDSPEC(result, smx_file_t), TSTRING(mount), TSTRING(path)) sep \
390 ACTION(SIMCALL_FILE_CLOSE, file_close, WITHOUT_ANSWER, TINT(result), TDSPEC(fd, smx_file_t)) sep \
391 ACTION(SIMCALL_FILE_UNLINK, file_unlink, WITH_ANSWER, TINT(result), TDSPEC(fd, smx_file_t)) sep \
392 ACTION(SIMCALL_FILE_LS, file_ls, WITHOUT_ANSWER, TDSPEC(result, xbt_dict_t), TSTRING(mount), TSTRING(path)) sep \
393 ACTION(SIMCALL_FILE_GET_SIZE, file_get_size, WITH_ANSWER, TSIZE(result), TDSPEC(fd, smx_file_t)) sep \
394 ACTION(SIMCALL_FILE_GET_INFO, file_get_info, WITH_ANSWER, TDSPEC(result, xbt_dynar_t), TDSPEC(fd, smx_file_t)) sep \
395 ACTION(SIMCALL_STORAGE_FILE_RENAME, storage_file_rename, WITH_ANSWER, TVOID(result), TDSPEC(storage, smx_storage_t), TSTRING(src), TSTRING(dest)) sep \
396 ACTION(SIMCALL_STORAGE_GET_FREE_SIZE, storage_get_free_size, WITH_ANSWER, TSIZE(result), TSTRING(name)) sep \
397 ACTION(SIMCALL_STORAGE_GET_USED_SIZE, storage_get_used_size, WITH_ANSWER, TSIZE(result), TSTRING(name)) sep \
398 ACTION(SIMCALL_STORAGE_GET_PROPERTIES, storage_get_properties, WITH_ANSWER, TDSPEC(result, xbt_dict_t), TDSPEC(storage, smx_storage_t)) sep \
399 ACTION(SIMCALL_STORAGE_GET_CONTENT, storage_get_content, WITH_ANSWER, TDSPEC(result, xbt_dict_t), TDSPEC(storage, smx_storage_t)) sep \
400 ACTION(SIMCALL_ASR_GET_PROPERTIES, asr_get_properties, WITH_ANSWER, TDSPEC(result, xbt_dict_t), TSTRING(name)) sep 
401
402 /* SIMCALL_COMM_IS_LATENCY_BOUNDED and SIMCALL_SET_CATEGORY make things complicated
403  * because they are not always present */
404 #ifdef HAVE_LATENCY_BOUND_TRACKING
405 #define SIMCALL_LIST2(ACTION, sep) \
406 ACTION(SIMCALL_COMM_IS_LATENCY_BOUNDED, comm_is_latency_bounded, WITH_ANSWER, TINT(result), TDSPEC(comm, smx_action_t)) sep
407 #else
408 #define SIMCALL_LIST2(ACTION, sep)
409 #endif
410
411 #ifdef HAVE_TRACING
412 #define SIMCALL_LIST3(ACTION, sep) \
413 ACTION(SIMCALL_SET_CATEGORY, set_category, WITH_ANSWER, TVOID(result), TDSPEC(action, smx_action_t), TSTRING(category)) sep
414 #else
415 #define SIMCALL_LIST3(ACTION, sep)
416 #endif
417
418 #ifdef HAVE_MC
419 #define SIMCALL_LIST4(ACTION, sep) \
420 ACTION(SIMCALL_MC_SNAPSHOT, mc_snapshot, WITH_ANSWER, TDPTR(result)) sep \
421 ACTION(SIMCALL_MC_COMPARE_SNAPSHOTS, mc_compare_snapshots, WITH_ANSWER, TINT(result), TDPTR(s1), TDPTR(s2)) sep \
422 ACTION(SIMCALL_MC_RANDOM, mc_random, WITH_ANSWER, TINT(result), TINT(min), TINT(max)) sep
423 #else
424 #define SIMCALL_LIST4(ACTION, sep)
425 #endif
426
427 /* SIMCALL_LIST is the final macro to use */
428 #define SIMCALL_LIST(ACTION, ...) \
429   SIMCALL_LIST1(ACTION, ##__VA_ARGS__)\
430   SIMCALL_LIST2(ACTION, ##__VA_ARGS__)\
431   SIMCALL_LIST3(ACTION, ##__VA_ARGS__)\
432   SIMCALL_LIST4(ACTION, ##__VA_ARGS__)
433
434
435 /* you can redefine the following macro differently to generate something else
436  * with the list of enumeration values (e.g. a table of strings or a table of function pointers) */
437 #define SIMCALL_ENUM_ELEMENT(x, y) x
438
439 /**
440  * \brief All possible simcalls.
441  */
442 typedef enum {
443 SIMCALL_NONE,
444 SIMCALL_LIST(SIMCALL_ENUM, SIMCALL_SEP_COMMA)
445 SIMCALL_NEW_API_INIT,
446 NUM_SIMCALLS
447 } e_smx_simcall_t;
448
449 typedef int (*simix_match_func_t)(void *, void *, smx_action_t);
450 typedef void (*simix_clean_func_t)(void *);
451 typedef void (*FPtr)(void); // Hide the ugliness
452
453 /* Pack all possible scalar types in an union */
454 union u_smx_scalar {
455   char            c;
456   const char*     cc;
457   short           s;
458   int             i;
459   long            l;
460   unsigned char   uc;
461   unsigned short  us;
462   unsigned int    ui;
463   unsigned long   ul;
464   float           f;
465   double          d;
466   size_t          sz;
467   sg_size_t       sgsz;
468   void*           dp;
469   FPtr            fp;
470   const void*     cp;
471 };
472
473 /**
474  * \brief Represents a simcall to the kernel.
475  */
476 typedef struct s_smx_simcall {
477   e_smx_simcall_t call;
478   smx_process_t issuer;
479   int mc_value;
480   union u_smx_scalar args[10];
481   union u_smx_scalar result;
482   //FIXME: union u_smx_scalar retval;
483   union {
484     struct {
485       const char* param1;
486       double param2;
487       int result;
488     } new_api;
489
490   };
491 } s_smx_simcall_t, *smx_simcall_t;
492
493 #ifdef __cplusplus
494 extern "C" {
495 #endif
496 SIMCALL_LIST(SIMCALL_RES_GETSET, SIMCALL_SEP_NOTHING)
497 SIMCALL_LIST(SIMCALL_ARG_GETSET, SIMCALL_SEP_NOTHING)
498 #ifdef __cplusplus
499 }
500 #endif
501
502 /******************************** General *************************************/
503
504 void SIMIX_simcall_push(smx_process_t self);
505 void SIMIX_simcall_answer(smx_simcall_t);
506 void SIMIX_simcall_pre(smx_simcall_t, int);
507 void SIMIX_simcall_post(smx_action_t);
508 smx_simcall_t SIMIX_simcall_mine(void);
509 const char *SIMIX_simcall_name(e_smx_simcall_t kind);
510 //TOFIX put it in a better place
511 xbt_dict_t SIMIX_pre_asr_get_properties(smx_simcall_t simcall, const char *name);
512
513 /*************************** New simcall interface ****************************/
514
515 typedef smx_action_t (*simcall_handler_t)(u_smx_scalar_t *);
516
517 extern const char *simcall_types[];
518 extern simcall_handler_t simcall_table[];
519
520 #endif
521