Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename all SIMIX_pre_* to simcall_HANDLER_*
[simgrid.git] / src / simix / popping_generated.c
1 /**********************************************************************/
2 /* File generated by src/simix/simcalls.py from src/simix/simcalls.in */
3 /*                                                                    */
4 /*                    DO NOT EVER CHANGE THIS FILE                    */
5 /*                                                                    */
6 /* change simcalls specification in src/simix/simcalls.in             */
7 /**********************************************************************/
8
9 /*
10  * Note that the name comes from http://en.wikipedia.org/wiki/Popping
11  * Indeed, the control flow is doing a strange dance in there.
12  *
13  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
14  */
15
16 #include "smx_private.h"
17 #ifdef HAVE_MC
18 #include "mc/mc_private.h"
19 #endif
20
21 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);
22
23 /** @brief Simcalls' names (generated from src/simix/simcalls.in) */
24 const char* simcall_names[] = {
25 [SIMCALL_HOST_GET_BY_NAME] = "SIMCALL_HOST_GET_BY_NAME",
26 [SIMCALL_HOST_GET_NAME] = "SIMCALL_HOST_GET_NAME",
27 [SIMCALL_HOST_ON] = "SIMCALL_HOST_ON",
28 [SIMCALL_HOST_OFF] = "SIMCALL_HOST_OFF",
29 [SIMCALL_HOST_GET_PROPERTIES] = "SIMCALL_HOST_GET_PROPERTIES",
30 [SIMCALL_HOST_GET_CORE] = "SIMCALL_HOST_GET_CORE",
31 [SIMCALL_HOST_GET_PROCESS_LIST] = "SIMCALL_HOST_GET_PROCESS_LIST",
32 [SIMCALL_HOST_GET_SPEED] = "SIMCALL_HOST_GET_SPEED",
33 [SIMCALL_HOST_GET_AVAILABLE_SPEED] = "SIMCALL_HOST_GET_AVAILABLE_SPEED",
34 [SIMCALL_HOST_GET_STATE] = "SIMCALL_HOST_GET_STATE",
35 [SIMCALL_HOST_GET_CURRENT_POWER_PEAK] = "SIMCALL_HOST_GET_CURRENT_POWER_PEAK",
36 [SIMCALL_HOST_GET_POWER_PEAK_AT] = "SIMCALL_HOST_GET_POWER_PEAK_AT",
37 [SIMCALL_HOST_GET_NB_PSTATES] = "SIMCALL_HOST_GET_NB_PSTATES",
38 [SIMCALL_HOST_SET_POWER_PEAK_AT] = "SIMCALL_HOST_SET_POWER_PEAK_AT",
39 [SIMCALL_HOST_GET_CONSUMED_ENERGY] = "SIMCALL_HOST_GET_CONSUMED_ENERGY",
40 [SIMCALL_HOST_EXECUTE] = "SIMCALL_HOST_EXECUTE",
41 [SIMCALL_HOST_PARALLEL_EXECUTE] = "SIMCALL_HOST_PARALLEL_EXECUTE",
42 [SIMCALL_HOST_EXECUTION_DESTROY] = "SIMCALL_HOST_EXECUTION_DESTROY",
43 [SIMCALL_HOST_EXECUTION_CANCEL] = "SIMCALL_HOST_EXECUTION_CANCEL",
44 [SIMCALL_HOST_EXECUTION_GET_REMAINS] = "SIMCALL_HOST_EXECUTION_GET_REMAINS",
45 [SIMCALL_HOST_EXECUTION_GET_STATE] = "SIMCALL_HOST_EXECUTION_GET_STATE",
46 [SIMCALL_HOST_EXECUTION_SET_PRIORITY] = "SIMCALL_HOST_EXECUTION_SET_PRIORITY",
47 [SIMCALL_HOST_EXECUTION_SET_BOUND] = "SIMCALL_HOST_EXECUTION_SET_BOUND",
48 [SIMCALL_HOST_EXECUTION_SET_AFFINITY] = "SIMCALL_HOST_EXECUTION_SET_AFFINITY",
49 [SIMCALL_HOST_EXECUTION_WAIT] = "SIMCALL_HOST_EXECUTION_WAIT",
50 [SIMCALL_HOST_GET_MOUNTED_STORAGE_LIST] = "SIMCALL_HOST_GET_MOUNTED_STORAGE_LIST",
51 [SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST] = "SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST",
52 [SIMCALL_HOST_GET_PARAMS] = "SIMCALL_HOST_GET_PARAMS",
53 [SIMCALL_HOST_SET_PARAMS] = "SIMCALL_HOST_SET_PARAMS",
54 [SIMCALL_VM_CREATE] = "SIMCALL_VM_CREATE",
55 [SIMCALL_VM_START] = "SIMCALL_VM_START",
56 [SIMCALL_VM_GET_STATE] = "SIMCALL_VM_GET_STATE",
57 [SIMCALL_VM_MIGRATE] = "SIMCALL_VM_MIGRATE",
58 [SIMCALL_VM_GET_PM] = "SIMCALL_VM_GET_PM",
59 [SIMCALL_VM_SET_BOUND] = "SIMCALL_VM_SET_BOUND",
60 [SIMCALL_VM_SET_AFFINITY] = "SIMCALL_VM_SET_AFFINITY",
61 [SIMCALL_VM_DESTROY] = "SIMCALL_VM_DESTROY",
62 [SIMCALL_VM_SUSPEND] = "SIMCALL_VM_SUSPEND",
63 [SIMCALL_VM_RESUME] = "SIMCALL_VM_RESUME",
64 [SIMCALL_VM_SHUTDOWN] = "SIMCALL_VM_SHUTDOWN",
65 [SIMCALL_VM_SAVE] = "SIMCALL_VM_SAVE",
66 [SIMCALL_VM_RESTORE] = "SIMCALL_VM_RESTORE",
67 [SIMCALL_PROCESS_CREATE] = "SIMCALL_PROCESS_CREATE",
68 [SIMCALL_PROCESS_KILL] = "SIMCALL_PROCESS_KILL",
69 [SIMCALL_PROCESS_KILLALL] = "SIMCALL_PROCESS_KILLALL",
70 [SIMCALL_PROCESS_CLEANUP] = "SIMCALL_PROCESS_CLEANUP",
71 [SIMCALL_PROCESS_CHANGE_HOST] = "SIMCALL_PROCESS_CHANGE_HOST",
72 [SIMCALL_PROCESS_SUSPEND] = "SIMCALL_PROCESS_SUSPEND",
73 [SIMCALL_PROCESS_RESUME] = "SIMCALL_PROCESS_RESUME",
74 [SIMCALL_PROCESS_COUNT] = "SIMCALL_PROCESS_COUNT",
75 [SIMCALL_PROCESS_GET_PID] = "SIMCALL_PROCESS_GET_PID",
76 [SIMCALL_PROCESS_GET_PPID] = "SIMCALL_PROCESS_GET_PPID",
77 [SIMCALL_PROCESS_GET_DATA] = "SIMCALL_PROCESS_GET_DATA",
78 [SIMCALL_PROCESS_SET_DATA] = "SIMCALL_PROCESS_SET_DATA",
79 [SIMCALL_PROCESS_GET_HOST] = "SIMCALL_PROCESS_GET_HOST",
80 [SIMCALL_PROCESS_GET_NAME] = "SIMCALL_PROCESS_GET_NAME",
81 [SIMCALL_PROCESS_IS_SUSPENDED] = "SIMCALL_PROCESS_IS_SUSPENDED",
82 [SIMCALL_PROCESS_GET_PROPERTIES] = "SIMCALL_PROCESS_GET_PROPERTIES",
83 [SIMCALL_PROCESS_JOIN] = "SIMCALL_PROCESS_JOIN",
84 [SIMCALL_PROCESS_SLEEP] = "SIMCALL_PROCESS_SLEEP",
85 [SIMCALL_PROCESS_ON_EXIT] = "SIMCALL_PROCESS_ON_EXIT",
86 [SIMCALL_PROCESS_AUTO_RESTART_SET] = "SIMCALL_PROCESS_AUTO_RESTART_SET",
87 [SIMCALL_PROCESS_RESTART] = "SIMCALL_PROCESS_RESTART",
88 [SIMCALL_RDV_CREATE] = "SIMCALL_RDV_CREATE",
89 [SIMCALL_RDV_DESTROY] = "SIMCALL_RDV_DESTROY",
90 [SIMCALL_RDV_COMM_COUNT_BY_HOST] = "SIMCALL_RDV_COMM_COUNT_BY_HOST",
91 [SIMCALL_RDV_GET_HEAD] = "SIMCALL_RDV_GET_HEAD",
92 [SIMCALL_RDV_SET_RECEIVER] = "SIMCALL_RDV_SET_RECEIVER",
93 [SIMCALL_RDV_GET_RECEIVER] = "SIMCALL_RDV_GET_RECEIVER",
94 [SIMCALL_COMM_IPROBE] = "SIMCALL_COMM_IPROBE",
95 [SIMCALL_COMM_SEND] = "SIMCALL_COMM_SEND",
96 [SIMCALL_COMM_ISEND] = "SIMCALL_COMM_ISEND",
97 [SIMCALL_COMM_RECV] = "SIMCALL_COMM_RECV",
98 [SIMCALL_COMM_IRECV] = "SIMCALL_COMM_IRECV",
99 [SIMCALL_COMM_CANCEL] = "SIMCALL_COMM_CANCEL",
100 [SIMCALL_COMM_WAITANY] = "SIMCALL_COMM_WAITANY",
101 [SIMCALL_COMM_WAIT] = "SIMCALL_COMM_WAIT",
102 [SIMCALL_COMM_TEST] = "SIMCALL_COMM_TEST",
103 [SIMCALL_COMM_TESTANY] = "SIMCALL_COMM_TESTANY",
104 [SIMCALL_COMM_GET_REMAINS] = "SIMCALL_COMM_GET_REMAINS",
105 [SIMCALL_COMM_GET_STATE] = "SIMCALL_COMM_GET_STATE",
106 [SIMCALL_COMM_GET_SRC_DATA] = "SIMCALL_COMM_GET_SRC_DATA",
107 [SIMCALL_COMM_GET_DST_DATA] = "SIMCALL_COMM_GET_DST_DATA",
108 [SIMCALL_COMM_GET_SRC_PROC] = "SIMCALL_COMM_GET_SRC_PROC",
109 [SIMCALL_COMM_GET_DST_PROC] = "SIMCALL_COMM_GET_DST_PROC",
110 [SIMCALL_MUTEX_INIT] = "SIMCALL_MUTEX_INIT",
111 [SIMCALL_MUTEX_DESTROY] = "SIMCALL_MUTEX_DESTROY",
112 [SIMCALL_MUTEX_LOCK] = "SIMCALL_MUTEX_LOCK",
113 [SIMCALL_MUTEX_TRYLOCK] = "SIMCALL_MUTEX_TRYLOCK",
114 [SIMCALL_MUTEX_UNLOCK] = "SIMCALL_MUTEX_UNLOCK",
115 [SIMCALL_COND_INIT] = "SIMCALL_COND_INIT",
116 [SIMCALL_COND_DESTROY] = "SIMCALL_COND_DESTROY",
117 [SIMCALL_COND_SIGNAL] = "SIMCALL_COND_SIGNAL",
118 [SIMCALL_COND_WAIT] = "SIMCALL_COND_WAIT",
119 [SIMCALL_COND_WAIT_TIMEOUT] = "SIMCALL_COND_WAIT_TIMEOUT",
120 [SIMCALL_COND_BROADCAST] = "SIMCALL_COND_BROADCAST",
121 [SIMCALL_SEM_INIT] = "SIMCALL_SEM_INIT",
122 [SIMCALL_SEM_DESTROY] = "SIMCALL_SEM_DESTROY",
123 [SIMCALL_SEM_RELEASE] = "SIMCALL_SEM_RELEASE",
124 [SIMCALL_SEM_WOULD_BLOCK] = "SIMCALL_SEM_WOULD_BLOCK",
125 [SIMCALL_SEM_ACQUIRE] = "SIMCALL_SEM_ACQUIRE",
126 [SIMCALL_SEM_ACQUIRE_TIMEOUT] = "SIMCALL_SEM_ACQUIRE_TIMEOUT",
127 [SIMCALL_SEM_GET_CAPACITY] = "SIMCALL_SEM_GET_CAPACITY",
128 [SIMCALL_FILE_READ] = "SIMCALL_FILE_READ",
129 [SIMCALL_FILE_WRITE] = "SIMCALL_FILE_WRITE",
130 [SIMCALL_FILE_OPEN] = "SIMCALL_FILE_OPEN",
131 [SIMCALL_FILE_CLOSE] = "SIMCALL_FILE_CLOSE",
132 [SIMCALL_FILE_UNLINK] = "SIMCALL_FILE_UNLINK",
133 [SIMCALL_FILE_GET_SIZE] = "SIMCALL_FILE_GET_SIZE",
134 [SIMCALL_FILE_TELL] = "SIMCALL_FILE_TELL",
135 [SIMCALL_FILE_SEEK] = "SIMCALL_FILE_SEEK",
136 [SIMCALL_FILE_GET_INFO] = "SIMCALL_FILE_GET_INFO",
137 [SIMCALL_FILE_MOVE] = "SIMCALL_FILE_MOVE",
138 [SIMCALL_STORAGE_GET_FREE_SIZE] = "SIMCALL_STORAGE_GET_FREE_SIZE",
139 [SIMCALL_STORAGE_GET_USED_SIZE] = "SIMCALL_STORAGE_GET_USED_SIZE",
140 [SIMCALL_STORAGE_GET_PROPERTIES] = "SIMCALL_STORAGE_GET_PROPERTIES",
141 [SIMCALL_STORAGE_GET_CONTENT] = "SIMCALL_STORAGE_GET_CONTENT",
142 [SIMCALL_ASR_GET_PROPERTIES] = "SIMCALL_ASR_GET_PROPERTIES",
143 #ifdef HAVE_LATENCY_BOUND_TRACKING
144 [SIMCALL_COMM_IS_LATENCY_BOUNDED] = "SIMCALL_COMM_IS_LATENCY_BOUNDED",
145 #endif
146
147 #ifdef HAVE_TRACING
148 [SIMCALL_SET_CATEGORY] = "SIMCALL_SET_CATEGORY",
149 #endif
150
151 #ifdef HAVE_MC
152 [SIMCALL_MC_SNAPSHOT] = "SIMCALL_MC_SNAPSHOT",
153 [SIMCALL_MC_COMPARE_SNAPSHOTS] = "SIMCALL_MC_COMPARE_SNAPSHOTS",
154 [SIMCALL_MC_RANDOM] = "SIMCALL_MC_RANDOM",
155 #endif
156 [SIMCALL_NONE] = "NONE"
157 };
158
159 /**
160  * @brief (in kernel mode) unpack the simcall and activate the handler
161  * 
162  * This function is generated from src/simix/simcalls.in
163  */
164 void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {
165   XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call));
166   SIMCALL_SET_MC_VALUE(simcall, value);
167   if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP)
168     return;
169   switch (simcall->call) {
170 case SIMCALL_HOST_GET_BY_NAME:
171       simcall->result.dp = simcall_HANDLER_host_get_by_name(simcall ,  simcall->args[0].cc);
172       SIMIX_simcall_answer(simcall);
173       break;  
174
175 case SIMCALL_HOST_GET_NAME:
176       simcall->result.cc = simcall_HANDLER_host_get_name(simcall , (smx_host_t) simcall->args[0].dp);
177       SIMIX_simcall_answer(simcall);
178       break;  
179
180 case SIMCALL_HOST_ON:
181        simcall_HANDLER_host_on(simcall , (smx_host_t) simcall->args[0].dp);
182       SIMIX_simcall_answer(simcall);
183       break;  
184
185 case SIMCALL_HOST_OFF:
186        simcall_HANDLER_host_off(simcall , (smx_host_t) simcall->args[0].dp);
187       SIMIX_simcall_answer(simcall);
188       break;  
189
190 case SIMCALL_HOST_GET_PROPERTIES:
191       simcall->result.dp = simcall_HANDLER_host_get_properties(simcall , (smx_host_t) simcall->args[0].dp);
192       SIMIX_simcall_answer(simcall);
193       break;  
194
195 case SIMCALL_HOST_GET_CORE:
196       simcall->result.i = simcall_HANDLER_host_get_core(simcall , (smx_host_t) simcall->args[0].dp);
197       SIMIX_simcall_answer(simcall);
198       break;  
199
200 case SIMCALL_HOST_GET_PROCESS_LIST:
201       simcall->result.dp = simcall_HANDLER_host_get_process_list(simcall , (smx_host_t) simcall->args[0].dp);
202       SIMIX_simcall_answer(simcall);
203       break;  
204
205 case SIMCALL_HOST_GET_SPEED:
206       simcall->result.d = simcall_HANDLER_host_get_speed(simcall , (smx_host_t) simcall->args[0].dp);
207       SIMIX_simcall_answer(simcall);
208       break;  
209
210 case SIMCALL_HOST_GET_AVAILABLE_SPEED:
211       simcall->result.d = simcall_HANDLER_host_get_available_speed(simcall , (smx_host_t) simcall->args[0].dp);
212       SIMIX_simcall_answer(simcall);
213       break;  
214
215 case SIMCALL_HOST_GET_STATE:
216       simcall->result.i = simcall_HANDLER_host_get_state(simcall , (smx_host_t) simcall->args[0].dp);
217       SIMIX_simcall_answer(simcall);
218       break;  
219
220 case SIMCALL_HOST_GET_CURRENT_POWER_PEAK:
221       simcall->result.d = simcall_HANDLER_host_get_current_power_peak(simcall , (smx_host_t) simcall->args[0].dp);
222       SIMIX_simcall_answer(simcall);
223       break;  
224
225 case SIMCALL_HOST_GET_POWER_PEAK_AT:
226       simcall->result.d = simcall_HANDLER_host_get_power_peak_at(simcall , (smx_host_t) simcall->args[0].dp,  simcall->args[1].i);
227       SIMIX_simcall_answer(simcall);
228       break;  
229
230 case SIMCALL_HOST_GET_NB_PSTATES:
231       simcall->result.i = simcall_HANDLER_host_get_nb_pstates(simcall , (smx_host_t) simcall->args[0].dp);
232       SIMIX_simcall_answer(simcall);
233       break;  
234
235 case SIMCALL_HOST_SET_POWER_PEAK_AT:
236        simcall_HANDLER_host_set_power_peak_at(simcall , (smx_host_t) simcall->args[0].dp,  simcall->args[1].i);
237       SIMIX_simcall_answer(simcall);
238       break;  
239
240 case SIMCALL_HOST_GET_CONSUMED_ENERGY:
241       simcall->result.d = simcall_HANDLER_host_get_consumed_energy(simcall , (smx_host_t) simcall->args[0].dp);
242       SIMIX_simcall_answer(simcall);
243       break;  
244
245 case SIMCALL_HOST_EXECUTE:
246       simcall->result.dp = simcall_HANDLER_host_execute(simcall ,  simcall->args[0].cc, (smx_host_t) simcall->args[1].dp,  simcall->args[2].d,  simcall->args[3].d,  simcall->args[4].d,  simcall->args[5].ul);
247       SIMIX_simcall_answer(simcall);
248       break;  
249
250 case SIMCALL_HOST_PARALLEL_EXECUTE:
251       simcall->result.dp = simcall_HANDLER_host_parallel_execute(simcall ,  simcall->args[0].cc,  simcall->args[1].i, (smx_host_t*) simcall->args[2].dp, (double*) simcall->args[3].dp, (double*) simcall->args[4].dp,  simcall->args[5].d,  simcall->args[6].d);
252       SIMIX_simcall_answer(simcall);
253       break;  
254
255 case SIMCALL_HOST_EXECUTION_DESTROY:
256        simcall_HANDLER_host_execution_destroy(simcall , (smx_action_t) simcall->args[0].dp);
257       SIMIX_simcall_answer(simcall);
258       break;  
259
260 case SIMCALL_HOST_EXECUTION_CANCEL:
261        simcall_HANDLER_host_execution_cancel(simcall , (smx_action_t) simcall->args[0].dp);
262       SIMIX_simcall_answer(simcall);
263       break;  
264
265 case SIMCALL_HOST_EXECUTION_GET_REMAINS:
266       simcall->result.d = simcall_HANDLER_host_execution_get_remains(simcall , (smx_action_t) simcall->args[0].dp);
267       SIMIX_simcall_answer(simcall);
268       break;  
269
270 case SIMCALL_HOST_EXECUTION_GET_STATE:
271       simcall->result.i = simcall_HANDLER_host_execution_get_state(simcall , (smx_action_t) simcall->args[0].dp);
272       SIMIX_simcall_answer(simcall);
273       break;  
274
275 case SIMCALL_HOST_EXECUTION_SET_PRIORITY:
276        simcall_HANDLER_host_execution_set_priority(simcall , (smx_action_t) simcall->args[0].dp,  simcall->args[1].d);
277       SIMIX_simcall_answer(simcall);
278       break;  
279
280 case SIMCALL_HOST_EXECUTION_SET_BOUND:
281        simcall_HANDLER_host_execution_set_bound(simcall , (smx_action_t) simcall->args[0].dp,  simcall->args[1].d);
282       SIMIX_simcall_answer(simcall);
283       break;  
284
285 case SIMCALL_HOST_EXECUTION_SET_AFFINITY:
286        simcall_HANDLER_host_execution_set_affinity(simcall , (smx_action_t) simcall->args[0].dp, (smx_host_t) simcall->args[1].dp,  simcall->args[2].ul);
287       SIMIX_simcall_answer(simcall);
288       break;  
289
290 case SIMCALL_HOST_EXECUTION_WAIT:
291        simcall_HANDLER_host_execution_wait(simcall , (smx_action_t) simcall->args[0].dp);
292        break;  
293
294 case SIMCALL_HOST_GET_MOUNTED_STORAGE_LIST:
295       simcall->result.dp = simcall_HANDLER_host_get_mounted_storage_list(simcall , (smx_host_t) simcall->args[0].dp);
296       SIMIX_simcall_answer(simcall);
297       break;  
298
299 case SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST:
300       simcall->result.dp = simcall_HANDLER_host_get_attached_storage_list(simcall , (smx_host_t) simcall->args[0].dp);
301       SIMIX_simcall_answer(simcall);
302       break;  
303
304 case SIMCALL_HOST_GET_PARAMS:
305        simcall_HANDLER_host_get_params(simcall , (smx_host_t) simcall->args[0].dp, (ws_params_t) simcall->args[1].dp);
306       SIMIX_simcall_answer(simcall);
307       break;  
308
309 case SIMCALL_HOST_SET_PARAMS:
310        simcall_HANDLER_host_set_params(simcall , (smx_host_t) simcall->args[0].dp, (ws_params_t) simcall->args[1].dp);
311       SIMIX_simcall_answer(simcall);
312       break;  
313
314 case SIMCALL_VM_CREATE:
315       simcall->result.dp = simcall_HANDLER_vm_create(simcall ,  simcall->args[0].cc, (smx_host_t) simcall->args[1].dp);
316       SIMIX_simcall_answer(simcall);
317       break;  
318
319 case SIMCALL_VM_START:
320        simcall_HANDLER_vm_start(simcall , (smx_host_t) simcall->args[0].dp);
321       SIMIX_simcall_answer(simcall);
322       break;  
323
324 case SIMCALL_VM_GET_STATE:
325       simcall->result.i = simcall_HANDLER_vm_get_state(simcall , (smx_host_t) simcall->args[0].dp);
326       SIMIX_simcall_answer(simcall);
327       break;  
328
329 case SIMCALL_VM_MIGRATE:
330        simcall_HANDLER_vm_migrate(simcall , (smx_host_t) simcall->args[0].dp, (smx_host_t) simcall->args[1].dp);
331       SIMIX_simcall_answer(simcall);
332       break;  
333
334 case SIMCALL_VM_GET_PM:
335       simcall->result.dp = simcall_HANDLER_vm_get_pm(simcall , (smx_host_t) simcall->args[0].dp);
336       SIMIX_simcall_answer(simcall);
337       break;  
338
339 case SIMCALL_VM_SET_BOUND:
340        simcall_HANDLER_vm_set_bound(simcall , (smx_host_t) simcall->args[0].dp,  simcall->args[1].d);
341       SIMIX_simcall_answer(simcall);
342       break;  
343
344 case SIMCALL_VM_SET_AFFINITY:
345        simcall_HANDLER_vm_set_affinity(simcall , (smx_host_t) simcall->args[0].dp, (smx_host_t) simcall->args[1].dp,  simcall->args[2].ul);
346       SIMIX_simcall_answer(simcall);
347       break;  
348
349 case SIMCALL_VM_DESTROY:
350        simcall_HANDLER_vm_destroy(simcall , (smx_host_t) simcall->args[0].dp);
351       SIMIX_simcall_answer(simcall);
352       break;  
353
354 case SIMCALL_VM_SUSPEND:
355        simcall_HANDLER_vm_suspend(simcall , (smx_host_t) simcall->args[0].dp);
356       SIMIX_simcall_answer(simcall);
357       break;  
358
359 case SIMCALL_VM_RESUME:
360        simcall_HANDLER_vm_resume(simcall , (smx_host_t) simcall->args[0].dp);
361       SIMIX_simcall_answer(simcall);
362       break;  
363
364 case SIMCALL_VM_SHUTDOWN:
365        simcall_HANDLER_vm_shutdown(simcall , (smx_host_t) simcall->args[0].dp);
366       SIMIX_simcall_answer(simcall);
367       break;  
368
369 case SIMCALL_VM_SAVE:
370        simcall_HANDLER_vm_save(simcall , (smx_host_t) simcall->args[0].dp);
371       SIMIX_simcall_answer(simcall);
372       break;  
373
374 case SIMCALL_VM_RESTORE:
375        simcall_HANDLER_vm_restore(simcall , (smx_host_t) simcall->args[0].dp);
376       SIMIX_simcall_answer(simcall);
377       break;  
378
379 case SIMCALL_PROCESS_CREATE:
380        simcall_HANDLER_process_create(simcall , (smx_process_t*) simcall->args[0].dp,  simcall->args[1].cc, (xbt_main_func_t) simcall->args[2].fp,  simcall->args[3].dp,  simcall->args[4].cc,  simcall->args[5].d,  simcall->args[6].i, (char**) simcall->args[7].dp, (xbt_dict_t) simcall->args[8].dp,  simcall->args[9].i);
381       SIMIX_simcall_answer(simcall);
382       break;  
383
384 case SIMCALL_PROCESS_KILL:
385        simcall_HANDLER_process_kill(simcall , (smx_process_t) simcall->args[0].dp);
386       SIMIX_simcall_answer(simcall);
387       break;  
388
389 case SIMCALL_PROCESS_KILLALL:
390        simcall_HANDLER_process_killall(simcall ,  simcall->args[0].i);
391       SIMIX_simcall_answer(simcall);
392       break;  
393
394 case SIMCALL_PROCESS_CLEANUP:
395        simcall_HANDLER_process_cleanup(simcall , (smx_process_t) simcall->args[0].dp);
396       SIMIX_simcall_answer(simcall);
397       break;  
398
399 case SIMCALL_PROCESS_CHANGE_HOST:
400        simcall_HANDLER_process_change_host(simcall , (smx_process_t) simcall->args[0].dp, (smx_host_t) simcall->args[1].dp);
401       SIMIX_simcall_answer(simcall);
402       break;  
403
404 case SIMCALL_PROCESS_SUSPEND:
405        simcall_HANDLER_process_suspend(simcall , (smx_process_t) simcall->args[0].dp);
406        break;  
407
408 case SIMCALL_PROCESS_RESUME:
409        simcall_HANDLER_process_resume(simcall , (smx_process_t) simcall->args[0].dp);
410       SIMIX_simcall_answer(simcall);
411       break;  
412
413 case SIMCALL_PROCESS_COUNT:
414       simcall->result.i = simcall_HANDLER_process_count(simcall );
415       SIMIX_simcall_answer(simcall);
416       break;  
417
418 case SIMCALL_PROCESS_GET_PID:
419       simcall->result.i = simcall_HANDLER_process_get_PID(simcall , (smx_process_t) simcall->args[0].dp);
420       SIMIX_simcall_answer(simcall);
421       break;  
422
423 case SIMCALL_PROCESS_GET_PPID:
424       simcall->result.i = simcall_HANDLER_process_get_PPID(simcall , (smx_process_t) simcall->args[0].dp);
425       SIMIX_simcall_answer(simcall);
426       break;  
427
428 case SIMCALL_PROCESS_GET_DATA:
429       simcall->result.dp = simcall_HANDLER_process_get_data(simcall , (smx_process_t) simcall->args[0].dp);
430       SIMIX_simcall_answer(simcall);
431       break;  
432
433 case SIMCALL_PROCESS_SET_DATA:
434        simcall_HANDLER_process_set_data(simcall , (smx_process_t) simcall->args[0].dp,  simcall->args[1].dp);
435       SIMIX_simcall_answer(simcall);
436       break;  
437
438 case SIMCALL_PROCESS_GET_HOST:
439       simcall->result.dp = simcall_HANDLER_process_get_host(simcall , (smx_process_t) simcall->args[0].dp);
440       SIMIX_simcall_answer(simcall);
441       break;  
442
443 case SIMCALL_PROCESS_GET_NAME:
444       simcall->result.cc = simcall_HANDLER_process_get_name(simcall , (smx_process_t) simcall->args[0].dp);
445       SIMIX_simcall_answer(simcall);
446       break;  
447
448 case SIMCALL_PROCESS_IS_SUSPENDED:
449       simcall->result.i = simcall_HANDLER_process_is_suspended(simcall , (smx_process_t) simcall->args[0].dp);
450       SIMIX_simcall_answer(simcall);
451       break;  
452
453 case SIMCALL_PROCESS_GET_PROPERTIES:
454       simcall->result.dp = simcall_HANDLER_process_get_properties(simcall , (smx_process_t) simcall->args[0].dp);
455       SIMIX_simcall_answer(simcall);
456       break;  
457
458 case SIMCALL_PROCESS_JOIN:
459        simcall_HANDLER_process_join(simcall , (smx_process_t) simcall->args[0].dp,  simcall->args[1].d);
460        break;  
461
462 case SIMCALL_PROCESS_SLEEP:
463        simcall_HANDLER_process_sleep(simcall ,  simcall->args[0].d);
464        break;  
465
466 case SIMCALL_PROCESS_ON_EXIT:
467        simcall_HANDLER_process_on_exit(simcall , (smx_process_t) simcall->args[0].dp, (int_f_pvoid_pvoid_t) simcall->args[1].fp,  simcall->args[2].dp);
468       SIMIX_simcall_answer(simcall);
469       break;  
470
471 case SIMCALL_PROCESS_AUTO_RESTART_SET:
472        simcall_HANDLER_process_auto_restart_set(simcall , (smx_process_t) simcall->args[0].dp,  simcall->args[1].i);
473       SIMIX_simcall_answer(simcall);
474       break;  
475
476 case SIMCALL_PROCESS_RESTART:
477       simcall->result.dp = simcall_HANDLER_process_restart(simcall , (smx_process_t) simcall->args[0].dp);
478       SIMIX_simcall_answer(simcall);
479       break;  
480
481 case SIMCALL_RDV_CREATE:
482       simcall->result.dp = simcall_HANDLER_rdv_create(simcall ,  simcall->args[0].cc);
483       SIMIX_simcall_answer(simcall);
484       break;  
485
486 case SIMCALL_RDV_DESTROY:
487        simcall_HANDLER_rdv_destroy(simcall , (smx_rdv_t) simcall->args[0].dp);
488       SIMIX_simcall_answer(simcall);
489       break;  
490
491 case SIMCALL_RDV_COMM_COUNT_BY_HOST:
492       simcall->result.ui = simcall_HANDLER_rdv_comm_count_by_host(simcall , (smx_rdv_t) simcall->args[0].dp, (smx_host_t) simcall->args[1].dp);
493       SIMIX_simcall_answer(simcall);
494       break;  
495
496 case SIMCALL_RDV_GET_HEAD:
497       simcall->result.dp = simcall_HANDLER_rdv_get_head(simcall , (smx_rdv_t) simcall->args[0].dp);
498       SIMIX_simcall_answer(simcall);
499       break;  
500
501 case SIMCALL_RDV_SET_RECEIVER:
502        simcall_HANDLER_rdv_set_receiver(simcall , (smx_rdv_t) simcall->args[0].dp, (smx_process_t) simcall->args[1].dp);
503       SIMIX_simcall_answer(simcall);
504       break;  
505
506 case SIMCALL_RDV_GET_RECEIVER:
507       simcall->result.dp = simcall_HANDLER_rdv_get_receiver(simcall , (smx_rdv_t) simcall->args[0].dp);
508       SIMIX_simcall_answer(simcall);
509       break;  
510
511 case SIMCALL_COMM_IPROBE:
512       simcall->result.dp = simcall_HANDLER_comm_iprobe(simcall , (smx_rdv_t) simcall->args[0].dp,  simcall->args[1].i,  simcall->args[2].i,  simcall->args[3].i, (simix_match_func_t) simcall->args[4].fp,  simcall->args[5].dp);
513       SIMIX_simcall_answer(simcall);
514       break;  
515
516 case SIMCALL_COMM_SEND:
517        simcall_HANDLER_comm_send(simcall , (smx_process_t) simcall->args[0].dp, (smx_rdv_t) simcall->args[1].dp,  simcall->args[2].d,  simcall->args[3].d,  simcall->args[4].dp,  simcall->args[5].sz, (simix_match_func_t) simcall->args[6].fp, (simix_copy_data_func_t) simcall->args[7].fp,  simcall->args[8].dp,  simcall->args[9].d);
518        break;  
519
520 case SIMCALL_COMM_ISEND:
521       simcall->result.dp = simcall_HANDLER_comm_isend(simcall , (smx_process_t) simcall->args[0].dp, (smx_rdv_t) simcall->args[1].dp,  simcall->args[2].d,  simcall->args[3].d,  simcall->args[4].dp,  simcall->args[5].sz, (simix_match_func_t) simcall->args[6].fp, (simix_clean_func_t) simcall->args[7].fp, (simix_copy_data_func_t) simcall->args[8].fp,  simcall->args[9].dp,  simcall->args[10].i);
522       SIMIX_simcall_answer(simcall);
523       break;  
524
525 case SIMCALL_COMM_RECV:
526        simcall_HANDLER_comm_recv(simcall , (smx_rdv_t) simcall->args[0].dp,  simcall->args[1].dp, (size_t*) simcall->args[2].dp, (simix_match_func_t) simcall->args[3].fp, (simix_copy_data_func_t) simcall->args[4].fp,  simcall->args[5].dp,  simcall->args[6].d,  simcall->args[7].d);
527        break;  
528
529 case SIMCALL_COMM_IRECV:
530       simcall->result.dp = simcall_HANDLER_comm_irecv(simcall , (smx_rdv_t) simcall->args[0].dp,  simcall->args[1].dp, (size_t*) simcall->args[2].dp, (simix_match_func_t) simcall->args[3].fp, (simix_copy_data_func_t) simcall->args[4].fp,  simcall->args[5].dp,  simcall->args[6].d);
531       SIMIX_simcall_answer(simcall);
532       break;  
533
534 case SIMCALL_COMM_CANCEL:
535        simcall_HANDLER_comm_cancel(simcall , (smx_action_t) simcall->args[0].dp);
536       SIMIX_simcall_answer(simcall);
537       break;  
538
539 case SIMCALL_COMM_WAITANY:
540        simcall_HANDLER_comm_waitany(simcall , (xbt_dynar_t) simcall->args[0].dp);
541        break;  
542
543 case SIMCALL_COMM_WAIT:
544        simcall_HANDLER_comm_wait(simcall , (smx_action_t) simcall->args[0].dp,  simcall->args[1].d);
545        break;  
546
547 case SIMCALL_COMM_TEST:
548        simcall_HANDLER_comm_test(simcall , (smx_action_t) simcall->args[0].dp);
549        break;  
550
551 case SIMCALL_COMM_TESTANY:
552        simcall_HANDLER_comm_testany(simcall , (xbt_dynar_t) simcall->args[0].dp);
553        break;  
554
555 case SIMCALL_COMM_GET_REMAINS:
556       simcall->result.d = simcall_HANDLER_comm_get_remains(simcall , (smx_action_t) simcall->args[0].dp);
557       SIMIX_simcall_answer(simcall);
558       break;  
559
560 case SIMCALL_COMM_GET_STATE:
561       simcall->result.i = simcall_HANDLER_comm_get_state(simcall , (smx_action_t) simcall->args[0].dp);
562       SIMIX_simcall_answer(simcall);
563       break;  
564
565 case SIMCALL_COMM_GET_SRC_DATA:
566       simcall->result.dp = simcall_HANDLER_comm_get_src_data(simcall , (smx_action_t) simcall->args[0].dp);
567       SIMIX_simcall_answer(simcall);
568       break;  
569
570 case SIMCALL_COMM_GET_DST_DATA:
571       simcall->result.dp = simcall_HANDLER_comm_get_dst_data(simcall , (smx_action_t) simcall->args[0].dp);
572       SIMIX_simcall_answer(simcall);
573       break;  
574
575 case SIMCALL_COMM_GET_SRC_PROC:
576       simcall->result.dp = simcall_HANDLER_comm_get_src_proc(simcall , (smx_action_t) simcall->args[0].dp);
577       SIMIX_simcall_answer(simcall);
578       break;  
579
580 case SIMCALL_COMM_GET_DST_PROC:
581       simcall->result.dp = simcall_HANDLER_comm_get_dst_proc(simcall , (smx_action_t) simcall->args[0].dp);
582       SIMIX_simcall_answer(simcall);
583       break;  
584
585 case SIMCALL_MUTEX_INIT:
586       simcall->result.dp = simcall_HANDLER_mutex_init(simcall );
587       SIMIX_simcall_answer(simcall);
588       break;  
589
590 case SIMCALL_MUTEX_DESTROY:
591        simcall_HANDLER_mutex_destroy(simcall , (smx_mutex_t) simcall->args[0].dp);
592       SIMIX_simcall_answer(simcall);
593       break;  
594
595 case SIMCALL_MUTEX_LOCK:
596        simcall_HANDLER_mutex_lock(simcall , (smx_mutex_t) simcall->args[0].dp);
597        break;  
598
599 case SIMCALL_MUTEX_TRYLOCK:
600       simcall->result.i = simcall_HANDLER_mutex_trylock(simcall , (smx_mutex_t) simcall->args[0].dp);
601       SIMIX_simcall_answer(simcall);
602       break;  
603
604 case SIMCALL_MUTEX_UNLOCK:
605        simcall_HANDLER_mutex_unlock(simcall , (smx_mutex_t) simcall->args[0].dp);
606       SIMIX_simcall_answer(simcall);
607       break;  
608
609 case SIMCALL_COND_INIT:
610       simcall->result.dp = simcall_HANDLER_cond_init(simcall );
611       SIMIX_simcall_answer(simcall);
612       break;  
613
614 case SIMCALL_COND_DESTROY:
615        simcall_HANDLER_cond_destroy(simcall , (smx_cond_t) simcall->args[0].dp);
616       SIMIX_simcall_answer(simcall);
617       break;  
618
619 case SIMCALL_COND_SIGNAL:
620        simcall_HANDLER_cond_signal(simcall , (smx_cond_t) simcall->args[0].dp);
621       SIMIX_simcall_answer(simcall);
622       break;  
623
624 case SIMCALL_COND_WAIT:
625        simcall_HANDLER_cond_wait(simcall , (smx_cond_t) simcall->args[0].dp, (smx_mutex_t) simcall->args[1].dp);
626        break;  
627
628 case SIMCALL_COND_WAIT_TIMEOUT:
629        simcall_HANDLER_cond_wait_timeout(simcall , (smx_cond_t) simcall->args[0].dp, (smx_mutex_t) simcall->args[1].dp,  simcall->args[2].d);
630        break;  
631
632 case SIMCALL_COND_BROADCAST:
633        simcall_HANDLER_cond_broadcast(simcall , (smx_cond_t) simcall->args[0].dp);
634       SIMIX_simcall_answer(simcall);
635       break;  
636
637 case SIMCALL_SEM_INIT:
638       simcall->result.dp = simcall_HANDLER_sem_init(simcall ,  simcall->args[0].i);
639       SIMIX_simcall_answer(simcall);
640       break;  
641
642 case SIMCALL_SEM_DESTROY:
643        simcall_HANDLER_sem_destroy(simcall , (smx_sem_t) simcall->args[0].dp);
644       SIMIX_simcall_answer(simcall);
645       break;  
646
647 case SIMCALL_SEM_RELEASE:
648        simcall_HANDLER_sem_release(simcall , (smx_sem_t) simcall->args[0].dp);
649       SIMIX_simcall_answer(simcall);
650       break;  
651
652 case SIMCALL_SEM_WOULD_BLOCK:
653       simcall->result.i = simcall_HANDLER_sem_would_block(simcall , (smx_sem_t) simcall->args[0].dp);
654       SIMIX_simcall_answer(simcall);
655       break;  
656
657 case SIMCALL_SEM_ACQUIRE:
658        simcall_HANDLER_sem_acquire(simcall , (smx_sem_t) simcall->args[0].dp);
659        break;  
660
661 case SIMCALL_SEM_ACQUIRE_TIMEOUT:
662        simcall_HANDLER_sem_acquire_timeout(simcall , (smx_sem_t) simcall->args[0].dp,  simcall->args[1].d);
663        break;  
664
665 case SIMCALL_SEM_GET_CAPACITY:
666       simcall->result.i = simcall_HANDLER_sem_get_capacity(simcall , (smx_sem_t) simcall->args[0].dp);
667       SIMIX_simcall_answer(simcall);
668       break;  
669
670 case SIMCALL_FILE_READ:
671        simcall_HANDLER_file_read(simcall , (smx_file_t) simcall->args[0].dp,  simcall->args[1].sgsz, (smx_host_t) simcall->args[2].dp);
672        break;  
673
674 case SIMCALL_FILE_WRITE:
675        simcall_HANDLER_file_write(simcall , (smx_file_t) simcall->args[0].dp,  simcall->args[1].sgsz, (smx_host_t) simcall->args[2].dp);
676        break;  
677
678 case SIMCALL_FILE_OPEN:
679        simcall_HANDLER_file_open(simcall ,  simcall->args[0].cc, (smx_host_t) simcall->args[1].dp);
680        break;  
681
682 case SIMCALL_FILE_CLOSE:
683        simcall_HANDLER_file_close(simcall , (smx_file_t) simcall->args[0].dp, (smx_host_t) simcall->args[1].dp);
684        break;  
685
686 case SIMCALL_FILE_UNLINK:
687       simcall->result.i = simcall_HANDLER_file_unlink(simcall , (smx_file_t) simcall->args[0].dp, (smx_host_t) simcall->args[1].dp);
688       SIMIX_simcall_answer(simcall);
689       break;  
690
691 case SIMCALL_FILE_GET_SIZE:
692       simcall->result.sgsz = simcall_HANDLER_file_get_size(simcall , (smx_file_t) simcall->args[0].dp);
693       SIMIX_simcall_answer(simcall);
694       break;  
695
696 case SIMCALL_FILE_TELL:
697       simcall->result.sgsz = simcall_HANDLER_file_tell(simcall , (smx_file_t) simcall->args[0].dp);
698       SIMIX_simcall_answer(simcall);
699       break;  
700
701 case SIMCALL_FILE_SEEK:
702       simcall->result.i = simcall_HANDLER_file_seek(simcall , (smx_file_t) simcall->args[0].dp,  simcall->args[1].sgoff,  simcall->args[2].i);
703       SIMIX_simcall_answer(simcall);
704       break;  
705
706 case SIMCALL_FILE_GET_INFO:
707       simcall->result.dp = simcall_HANDLER_file_get_info(simcall , (smx_file_t) simcall->args[0].dp);
708       SIMIX_simcall_answer(simcall);
709       break;  
710
711 case SIMCALL_FILE_MOVE:
712       simcall->result.i = simcall_HANDLER_file_move(simcall , (smx_file_t) simcall->args[0].dp,  simcall->args[1].cc);
713       SIMIX_simcall_answer(simcall);
714       break;  
715
716 case SIMCALL_STORAGE_GET_FREE_SIZE:
717       simcall->result.sgsz = simcall_HANDLER_storage_get_free_size(simcall , (smx_storage_t) simcall->args[0].dp);
718       SIMIX_simcall_answer(simcall);
719       break;  
720
721 case SIMCALL_STORAGE_GET_USED_SIZE:
722       simcall->result.sgsz = simcall_HANDLER_storage_get_used_size(simcall , (smx_storage_t) simcall->args[0].dp);
723       SIMIX_simcall_answer(simcall);
724       break;  
725
726 case SIMCALL_STORAGE_GET_PROPERTIES:
727       simcall->result.dp = simcall_HANDLER_storage_get_properties(simcall , (smx_storage_t) simcall->args[0].dp);
728       SIMIX_simcall_answer(simcall);
729       break;  
730
731 case SIMCALL_STORAGE_GET_CONTENT:
732       simcall->result.dp = simcall_HANDLER_storage_get_content(simcall , (smx_storage_t) simcall->args[0].dp);
733       SIMIX_simcall_answer(simcall);
734       break;  
735
736 case SIMCALL_ASR_GET_PROPERTIES:
737       simcall->result.dp = simcall_HANDLER_asr_get_properties(simcall ,  simcall->args[0].cc);
738       SIMIX_simcall_answer(simcall);
739       break;  
740
741 #ifdef HAVE_LATENCY_BOUND_TRACKING
742 case SIMCALL_COMM_IS_LATENCY_BOUNDED:
743       simcall->result.i = simcall_HANDLER_comm_is_latency_bounded(simcall , (smx_action_t) simcall->args[0].dp);
744       SIMIX_simcall_answer(simcall);
745       break;  
746
747 #endif
748
749 #ifdef HAVE_TRACING
750 case SIMCALL_SET_CATEGORY:
751        simcall_HANDLER_set_category(simcall , (smx_action_t) simcall->args[0].dp,  simcall->args[1].cc);
752       SIMIX_simcall_answer(simcall);
753       break;  
754
755 #endif
756
757 #ifdef HAVE_MC
758 case SIMCALL_MC_SNAPSHOT:
759       simcall->result.dp = simcall_HANDLER_mc_snapshot(simcall );
760       SIMIX_simcall_answer(simcall);
761       break;  
762
763 case SIMCALL_MC_COMPARE_SNAPSHOTS:
764       simcall->result.i = simcall_HANDLER_mc_compare_snapshots(simcall ,  simcall->args[0].dp,  simcall->args[1].dp);
765       SIMIX_simcall_answer(simcall);
766       break;  
767
768 case SIMCALL_MC_RANDOM:
769       simcall->result.i = simcall_HANDLER_mc_random(simcall ,  simcall->args[0].i,  simcall->args[1].i);
770       SIMIX_simcall_answer(simcall);
771       break;  
772
773 #endif
774     case NUM_SIMCALLS:
775       break;
776     case SIMCALL_NONE:
777       THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",
778           SIMIX_process_get_name(simcall->issuer),
779           SIMIX_host_get_name(SIMIX_process_get_host(simcall->issuer))
780           );
781       break;
782
783   }
784 }