Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
f6bcfeac861a43cb76b06675a43d9c65278879f5
[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_forward.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_VM_MIGRATEFROM_RESUMETO] = "SIMCALL_VM_MIGRATEFROM_RESUMETO",
68   [SIMCALL_PROCESS_CREATE] = "SIMCALL_PROCESS_CREATE",
69   [SIMCALL_PROCESS_KILL] = "SIMCALL_PROCESS_KILL",
70   [SIMCALL_PROCESS_KILLALL] = "SIMCALL_PROCESS_KILLALL",
71   [SIMCALL_PROCESS_CLEANUP] = "SIMCALL_PROCESS_CLEANUP",
72   [SIMCALL_PROCESS_CHANGE_HOST] = "SIMCALL_PROCESS_CHANGE_HOST",
73   [SIMCALL_PROCESS_SUSPEND] = "SIMCALL_PROCESS_SUSPEND",
74   [SIMCALL_PROCESS_RESUME] = "SIMCALL_PROCESS_RESUME",
75   [SIMCALL_PROCESS_COUNT] = "SIMCALL_PROCESS_COUNT",
76   [SIMCALL_PROCESS_GET_PID] = "SIMCALL_PROCESS_GET_PID",
77   [SIMCALL_PROCESS_GET_PPID] = "SIMCALL_PROCESS_GET_PPID",
78   [SIMCALL_PROCESS_GET_DATA] = "SIMCALL_PROCESS_GET_DATA",
79   [SIMCALL_PROCESS_SET_DATA] = "SIMCALL_PROCESS_SET_DATA",
80   [SIMCALL_PROCESS_GET_HOST] = "SIMCALL_PROCESS_GET_HOST",
81   [SIMCALL_PROCESS_GET_NAME] = "SIMCALL_PROCESS_GET_NAME",
82   [SIMCALL_PROCESS_IS_SUSPENDED] = "SIMCALL_PROCESS_IS_SUSPENDED",
83   [SIMCALL_PROCESS_GET_PROPERTIES] = "SIMCALL_PROCESS_GET_PROPERTIES",
84   [SIMCALL_PROCESS_JOIN] = "SIMCALL_PROCESS_JOIN",
85   [SIMCALL_PROCESS_SLEEP] = "SIMCALL_PROCESS_SLEEP",
86   [SIMCALL_PROCESS_ON_EXIT] = "SIMCALL_PROCESS_ON_EXIT",
87   [SIMCALL_PROCESS_AUTO_RESTART_SET] = "SIMCALL_PROCESS_AUTO_RESTART_SET",
88   [SIMCALL_PROCESS_RESTART] = "SIMCALL_PROCESS_RESTART",
89   [SIMCALL_RDV_CREATE] = "SIMCALL_RDV_CREATE",
90   [SIMCALL_RDV_DESTROY] = "SIMCALL_RDV_DESTROY",
91   [SIMCALL_RDV_COMM_COUNT_BY_HOST] = "SIMCALL_RDV_COMM_COUNT_BY_HOST",
92   [SIMCALL_RDV_GET_HEAD] = "SIMCALL_RDV_GET_HEAD",
93   [SIMCALL_RDV_SET_RECEIVER] = "SIMCALL_RDV_SET_RECEIVER",
94   [SIMCALL_RDV_GET_RECEIVER] = "SIMCALL_RDV_GET_RECEIVER",
95   [SIMCALL_COMM_IPROBE] = "SIMCALL_COMM_IPROBE",
96   [SIMCALL_COMM_SEND] = "SIMCALL_COMM_SEND",
97   [SIMCALL_COMM_ISEND] = "SIMCALL_COMM_ISEND",
98   [SIMCALL_COMM_RECV] = "SIMCALL_COMM_RECV",
99   [SIMCALL_COMM_IRECV] = "SIMCALL_COMM_IRECV",
100   [SIMCALL_COMM_CANCEL] = "SIMCALL_COMM_CANCEL",
101   [SIMCALL_COMM_WAITANY] = "SIMCALL_COMM_WAITANY",
102   [SIMCALL_COMM_WAIT] = "SIMCALL_COMM_WAIT",
103   [SIMCALL_COMM_TEST] = "SIMCALL_COMM_TEST",
104   [SIMCALL_COMM_TESTANY] = "SIMCALL_COMM_TESTANY",
105   [SIMCALL_COMM_GET_REMAINS] = "SIMCALL_COMM_GET_REMAINS",
106   [SIMCALL_COMM_GET_STATE] = "SIMCALL_COMM_GET_STATE",
107   [SIMCALL_COMM_GET_SRC_DATA] = "SIMCALL_COMM_GET_SRC_DATA",
108   [SIMCALL_COMM_GET_DST_DATA] = "SIMCALL_COMM_GET_DST_DATA",
109   [SIMCALL_COMM_GET_SRC_PROC] = "SIMCALL_COMM_GET_SRC_PROC",
110   [SIMCALL_COMM_GET_DST_PROC] = "SIMCALL_COMM_GET_DST_PROC",
111   [SIMCALL_MUTEX_INIT] = "SIMCALL_MUTEX_INIT",
112   [SIMCALL_MUTEX_DESTROY] = "SIMCALL_MUTEX_DESTROY",
113   [SIMCALL_MUTEX_LOCK] = "SIMCALL_MUTEX_LOCK",
114   [SIMCALL_MUTEX_TRYLOCK] = "SIMCALL_MUTEX_TRYLOCK",
115   [SIMCALL_MUTEX_UNLOCK] = "SIMCALL_MUTEX_UNLOCK",
116   [SIMCALL_COND_INIT] = "SIMCALL_COND_INIT",
117   [SIMCALL_COND_DESTROY] = "SIMCALL_COND_DESTROY",
118   [SIMCALL_COND_SIGNAL] = "SIMCALL_COND_SIGNAL",
119   [SIMCALL_COND_WAIT] = "SIMCALL_COND_WAIT",
120   [SIMCALL_COND_WAIT_TIMEOUT] = "SIMCALL_COND_WAIT_TIMEOUT",
121   [SIMCALL_COND_BROADCAST] = "SIMCALL_COND_BROADCAST",
122   [SIMCALL_SEM_INIT] = "SIMCALL_SEM_INIT",
123   [SIMCALL_SEM_DESTROY] = "SIMCALL_SEM_DESTROY",
124   [SIMCALL_SEM_RELEASE] = "SIMCALL_SEM_RELEASE",
125   [SIMCALL_SEM_WOULD_BLOCK] = "SIMCALL_SEM_WOULD_BLOCK",
126   [SIMCALL_SEM_ACQUIRE] = "SIMCALL_SEM_ACQUIRE",
127   [SIMCALL_SEM_ACQUIRE_TIMEOUT] = "SIMCALL_SEM_ACQUIRE_TIMEOUT",
128   [SIMCALL_SEM_GET_CAPACITY] = "SIMCALL_SEM_GET_CAPACITY",
129   [SIMCALL_FILE_READ] = "SIMCALL_FILE_READ",
130   [SIMCALL_FILE_WRITE] = "SIMCALL_FILE_WRITE",
131   [SIMCALL_FILE_OPEN] = "SIMCALL_FILE_OPEN",
132   [SIMCALL_FILE_CLOSE] = "SIMCALL_FILE_CLOSE",
133   [SIMCALL_FILE_UNLINK] = "SIMCALL_FILE_UNLINK",
134   [SIMCALL_FILE_GET_SIZE] = "SIMCALL_FILE_GET_SIZE",
135   [SIMCALL_FILE_TELL] = "SIMCALL_FILE_TELL",
136   [SIMCALL_FILE_SEEK] = "SIMCALL_FILE_SEEK",
137   [SIMCALL_FILE_GET_INFO] = "SIMCALL_FILE_GET_INFO",
138   [SIMCALL_FILE_MOVE] = "SIMCALL_FILE_MOVE",
139   [SIMCALL_STORAGE_GET_FREE_SIZE] = "SIMCALL_STORAGE_GET_FREE_SIZE",
140   [SIMCALL_STORAGE_GET_USED_SIZE] = "SIMCALL_STORAGE_GET_USED_SIZE",
141   [SIMCALL_STORAGE_GET_PROPERTIES] = "SIMCALL_STORAGE_GET_PROPERTIES",
142   [SIMCALL_STORAGE_GET_CONTENT] = "SIMCALL_STORAGE_GET_CONTENT",
143   [SIMCALL_ASR_GET_PROPERTIES] = "SIMCALL_ASR_GET_PROPERTIES",
144   [SIMCALL_MC_RANDOM] = "SIMCALL_MC_RANDOM",
145   [SIMCALL_SET_CATEGORY] = "SIMCALL_SET_CATEGORY",
146 #ifdef HAVE_LATENCY_BOUND_TRACKING
147   [SIMCALL_COMM_IS_LATENCY_BOUNDED] = "SIMCALL_COMM_IS_LATENCY_BOUNDED",
148 #endif
149
150 #ifdef HAVE_MC
151   [SIMCALL_MC_SNAPSHOT] = "SIMCALL_MC_SNAPSHOT",
152   [SIMCALL_MC_COMPARE_SNAPSHOTS] = "SIMCALL_MC_COMPARE_SNAPSHOTS",
153 #endif
154 [SIMCALL_NONE] = "NONE"
155 };
156
157 /**
158  * @brief (in kernel mode) unpack the simcall and activate the handler
159  * 
160  * This function is generated from src/simix/simcalls.in
161  */
162 void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {
163   XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call));
164   SIMCALL_SET_MC_VALUE(simcall, value);
165   if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP)
166     return;
167   switch (simcall->call) {
168 case SIMCALL_HOST_GET_BY_NAME:
169       simcall->result.dp = SIMIX_host_get_by_name( simcall->args[0].cc);
170       SIMIX_simcall_answer(simcall);
171       break;  
172
173 case SIMCALL_HOST_GET_NAME:
174       simcall->result.cc = SIMIX_host_get_name((smx_host_t) simcall->args[0].dp);
175       SIMIX_simcall_answer(simcall);
176       break;  
177
178 case SIMCALL_HOST_ON:
179        SIMIX_host_on((smx_host_t) simcall->args[0].dp);
180       SIMIX_simcall_answer(simcall);
181       break;  
182
183 case SIMCALL_HOST_OFF:
184        simcall_HANDLER_host_off(simcall , (smx_host_t) simcall->args[0].dp);
185       SIMIX_simcall_answer(simcall);
186       break;  
187
188 case SIMCALL_HOST_GET_PROPERTIES:
189       simcall->result.dp = SIMIX_host_get_properties((smx_host_t) simcall->args[0].dp);
190       SIMIX_simcall_answer(simcall);
191       break;  
192
193 case SIMCALL_HOST_GET_CORE:
194       simcall->result.i = SIMIX_host_get_core((smx_host_t) simcall->args[0].dp);
195       SIMIX_simcall_answer(simcall);
196       break;  
197
198 case SIMCALL_HOST_GET_PROCESS_LIST:
199       simcall->result.dp = SIMIX_host_get_process_list((smx_host_t) simcall->args[0].dp);
200       SIMIX_simcall_answer(simcall);
201       break;  
202
203 case SIMCALL_HOST_GET_SPEED:
204       simcall->result.d = SIMIX_host_get_speed((smx_host_t) simcall->args[0].dp);
205       SIMIX_simcall_answer(simcall);
206       break;  
207
208 case SIMCALL_HOST_GET_AVAILABLE_SPEED:
209       simcall->result.d = SIMIX_host_get_available_speed((smx_host_t) simcall->args[0].dp);
210       SIMIX_simcall_answer(simcall);
211       break;  
212
213 case SIMCALL_HOST_GET_STATE:
214       simcall->result.i = SIMIX_host_get_state((smx_host_t) simcall->args[0].dp);
215       SIMIX_simcall_answer(simcall);
216       break;  
217
218 case SIMCALL_HOST_GET_CURRENT_POWER_PEAK:
219       simcall->result.d = SIMIX_host_get_current_power_peak((smx_host_t) simcall->args[0].dp);
220       SIMIX_simcall_answer(simcall);
221       break;  
222
223 case SIMCALL_HOST_GET_POWER_PEAK_AT:
224       simcall->result.d = SIMIX_host_get_power_peak_at((smx_host_t) simcall->args[0].dp, simcall->args[1].i);
225       SIMIX_simcall_answer(simcall);
226       break;  
227
228 case SIMCALL_HOST_GET_NB_PSTATES:
229       simcall->result.i = SIMIX_host_get_nb_pstates((smx_host_t) simcall->args[0].dp);
230       SIMIX_simcall_answer(simcall);
231       break;  
232
233 case SIMCALL_HOST_SET_POWER_PEAK_AT:
234        SIMIX_host_set_power_peak_at((smx_host_t) simcall->args[0].dp, simcall->args[1].i);
235       SIMIX_simcall_answer(simcall);
236       break;  
237
238 case SIMCALL_HOST_GET_CONSUMED_ENERGY:
239       simcall->result.d = SIMIX_host_get_consumed_energy((smx_host_t) simcall->args[0].dp);
240       SIMIX_simcall_answer(simcall);
241       break;  
242
243 case SIMCALL_HOST_EXECUTE:
244       simcall->result.dp = SIMIX_host_execute( 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);
245       SIMIX_simcall_answer(simcall);
246       break;  
247
248 case SIMCALL_HOST_PARALLEL_EXECUTE:
249       simcall->result.dp = SIMIX_host_parallel_execute( 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);
250       SIMIX_simcall_answer(simcall);
251       break;  
252
253 case SIMCALL_HOST_EXECUTION_DESTROY:
254        SIMIX_host_execution_destroy((smx_synchro_t) simcall->args[0].dp);
255       SIMIX_simcall_answer(simcall);
256       break;  
257
258 case SIMCALL_HOST_EXECUTION_CANCEL:
259        SIMIX_host_execution_cancel((smx_synchro_t) simcall->args[0].dp);
260       SIMIX_simcall_answer(simcall);
261       break;  
262
263 case SIMCALL_HOST_EXECUTION_GET_REMAINS:
264       simcall->result.d = SIMIX_host_execution_get_remains((smx_synchro_t) simcall->args[0].dp);
265       SIMIX_simcall_answer(simcall);
266       break;  
267
268 case SIMCALL_HOST_EXECUTION_GET_STATE:
269       simcall->result.i = SIMIX_host_execution_get_state((smx_synchro_t) simcall->args[0].dp);
270       SIMIX_simcall_answer(simcall);
271       break;  
272
273 case SIMCALL_HOST_EXECUTION_SET_PRIORITY:
274        SIMIX_host_execution_set_priority((smx_synchro_t) simcall->args[0].dp, simcall->args[1].d);
275       SIMIX_simcall_answer(simcall);
276       break;  
277
278 case SIMCALL_HOST_EXECUTION_SET_BOUND:
279        SIMIX_host_execution_set_bound((smx_synchro_t) simcall->args[0].dp, simcall->args[1].d);
280       SIMIX_simcall_answer(simcall);
281       break;  
282
283 case SIMCALL_HOST_EXECUTION_SET_AFFINITY:
284        SIMIX_host_execution_set_affinity((smx_synchro_t) simcall->args[0].dp,(smx_host_t) simcall->args[1].dp, simcall->args[2].ul);
285       SIMIX_simcall_answer(simcall);
286       break;  
287
288 case SIMCALL_HOST_EXECUTION_WAIT:
289        simcall_HANDLER_host_execution_wait(simcall , (smx_synchro_t) simcall->args[0].dp);
290        break;  
291
292 case SIMCALL_HOST_GET_MOUNTED_STORAGE_LIST:
293       simcall->result.dp = SIMIX_host_get_mounted_storage_list((smx_host_t) simcall->args[0].dp);
294       SIMIX_simcall_answer(simcall);
295       break;  
296
297 case SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST:
298       simcall->result.dp = SIMIX_host_get_attached_storage_list((smx_host_t) simcall->args[0].dp);
299       SIMIX_simcall_answer(simcall);
300       break;  
301
302 case SIMCALL_HOST_GET_PARAMS:
303        SIMIX_host_get_params((smx_host_t) simcall->args[0].dp,(ws_params_t) simcall->args[1].dp);
304       SIMIX_simcall_answer(simcall);
305       break;  
306
307 case SIMCALL_HOST_SET_PARAMS:
308        SIMIX_host_set_params((smx_host_t) simcall->args[0].dp,(ws_params_t) simcall->args[1].dp);
309       SIMIX_simcall_answer(simcall);
310       break;  
311
312 case SIMCALL_VM_CREATE:
313       simcall->result.dp = SIMIX_vm_create( simcall->args[0].cc,(smx_host_t) simcall->args[1].dp);
314       SIMIX_simcall_answer(simcall);
315       break;  
316
317 case SIMCALL_VM_START:
318        SIMIX_vm_start((smx_host_t) simcall->args[0].dp);
319       SIMIX_simcall_answer(simcall);
320       break;  
321
322 case SIMCALL_VM_GET_STATE:
323       simcall->result.i = SIMIX_vm_get_state((smx_host_t) simcall->args[0].dp);
324       SIMIX_simcall_answer(simcall);
325       break;  
326
327 case SIMCALL_VM_MIGRATE:
328        SIMIX_vm_migrate((smx_host_t) simcall->args[0].dp,(smx_host_t) simcall->args[1].dp);
329       SIMIX_simcall_answer(simcall);
330       break;  
331
332 case SIMCALL_VM_GET_PM:
333       simcall->result.dp = SIMIX_vm_get_pm((smx_host_t) simcall->args[0].dp);
334       SIMIX_simcall_answer(simcall);
335       break;  
336
337 case SIMCALL_VM_SET_BOUND:
338        SIMIX_vm_set_bound((smx_host_t) simcall->args[0].dp, simcall->args[1].d);
339       SIMIX_simcall_answer(simcall);
340       break;  
341
342 case SIMCALL_VM_SET_AFFINITY:
343        SIMIX_vm_set_affinity((smx_host_t) simcall->args[0].dp,(smx_host_t) simcall->args[1].dp, simcall->args[2].ul);
344       SIMIX_simcall_answer(simcall);
345       break;  
346
347 case SIMCALL_VM_DESTROY:
348        SIMIX_vm_destroy((smx_host_t) simcall->args[0].dp);
349       SIMIX_simcall_answer(simcall);
350       break;  
351
352 case SIMCALL_VM_SUSPEND:
353        simcall_HANDLER_vm_suspend(simcall , (smx_host_t) simcall->args[0].dp);
354       SIMIX_simcall_answer(simcall);
355       break;  
356
357 case SIMCALL_VM_RESUME:
358        simcall_HANDLER_vm_resume(simcall , (smx_host_t) simcall->args[0].dp);
359       SIMIX_simcall_answer(simcall);
360       break;  
361
362 case SIMCALL_VM_SHUTDOWN:
363        simcall_HANDLER_vm_shutdown(simcall , (smx_host_t) simcall->args[0].dp);
364       SIMIX_simcall_answer(simcall);
365       break;  
366
367 case SIMCALL_VM_SAVE:
368        simcall_HANDLER_vm_save(simcall , (smx_host_t) simcall->args[0].dp);
369       SIMIX_simcall_answer(simcall);
370       break;  
371
372 case SIMCALL_VM_RESTORE:
373        simcall_HANDLER_vm_restore(simcall , (smx_host_t) simcall->args[0].dp);
374       SIMIX_simcall_answer(simcall);
375       break;  
376
377 case SIMCALL_VM_MIGRATEFROM_RESUMETO:
378        SIMIX_vm_migratefrom_resumeto((smx_host_t) simcall->args[0].dp,(smx_host_t) simcall->args[1].dp,(smx_host_t) simcall->args[2].dp);
379       SIMIX_simcall_answer(simcall);
380       break;  
381
382 case SIMCALL_PROCESS_CREATE:
383        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);
384       SIMIX_simcall_answer(simcall);
385       break;  
386
387 case SIMCALL_PROCESS_KILL:
388        simcall_HANDLER_process_kill(simcall , (smx_process_t) simcall->args[0].dp);
389       SIMIX_simcall_answer(simcall);
390       break;  
391
392 case SIMCALL_PROCESS_KILLALL:
393        simcall_HANDLER_process_killall(simcall ,  simcall->args[0].i);
394       SIMIX_simcall_answer(simcall);
395       break;  
396
397 case SIMCALL_PROCESS_CLEANUP:
398        SIMIX_process_cleanup((smx_process_t) simcall->args[0].dp);
399       SIMIX_simcall_answer(simcall);
400       break;  
401
402 case SIMCALL_PROCESS_CHANGE_HOST:
403        simcall_HANDLER_process_change_host(simcall , (smx_process_t) simcall->args[0].dp, (smx_host_t) simcall->args[1].dp);
404       SIMIX_simcall_answer(simcall);
405       break;  
406
407 case SIMCALL_PROCESS_SUSPEND:
408        simcall_HANDLER_process_suspend(simcall , (smx_process_t) simcall->args[0].dp);
409        break;  
410
411 case SIMCALL_PROCESS_RESUME:
412        simcall_HANDLER_process_resume(simcall , (smx_process_t) simcall->args[0].dp);
413       SIMIX_simcall_answer(simcall);
414       break;  
415
416 case SIMCALL_PROCESS_COUNT:
417       simcall->result.i = SIMIX_process_count();
418       SIMIX_simcall_answer(simcall);
419       break;  
420
421 case SIMCALL_PROCESS_GET_PID:
422       simcall->result.i = SIMIX_process_get_PID((smx_process_t) simcall->args[0].dp);
423       SIMIX_simcall_answer(simcall);
424       break;  
425
426 case SIMCALL_PROCESS_GET_PPID:
427       simcall->result.i = SIMIX_process_get_PPID((smx_process_t) simcall->args[0].dp);
428       SIMIX_simcall_answer(simcall);
429       break;  
430
431 case SIMCALL_PROCESS_GET_DATA:
432       simcall->result.dp = SIMIX_process_get_data((smx_process_t) simcall->args[0].dp);
433       SIMIX_simcall_answer(simcall);
434       break;  
435
436 case SIMCALL_PROCESS_SET_DATA:
437        SIMIX_process_set_data((smx_process_t) simcall->args[0].dp, simcall->args[1].dp);
438       SIMIX_simcall_answer(simcall);
439       break;  
440
441 case SIMCALL_PROCESS_GET_HOST:
442       simcall->result.dp = SIMIX_process_get_host((smx_process_t) simcall->args[0].dp);
443       SIMIX_simcall_answer(simcall);
444       break;  
445
446 case SIMCALL_PROCESS_GET_NAME:
447       simcall->result.cc = SIMIX_process_get_name((smx_process_t) simcall->args[0].dp);
448       SIMIX_simcall_answer(simcall);
449       break;  
450
451 case SIMCALL_PROCESS_IS_SUSPENDED:
452       simcall->result.i = SIMIX_process_is_suspended((smx_process_t) simcall->args[0].dp);
453       SIMIX_simcall_answer(simcall);
454       break;  
455
456 case SIMCALL_PROCESS_GET_PROPERTIES:
457       simcall->result.dp = SIMIX_process_get_properties((smx_process_t) simcall->args[0].dp);
458       SIMIX_simcall_answer(simcall);
459       break;  
460
461 case SIMCALL_PROCESS_JOIN:
462        simcall_HANDLER_process_join(simcall , (smx_process_t) simcall->args[0].dp,  simcall->args[1].d);
463        break;  
464
465 case SIMCALL_PROCESS_SLEEP:
466        simcall_HANDLER_process_sleep(simcall ,  simcall->args[0].d);
467        break;  
468
469 case SIMCALL_PROCESS_ON_EXIT:
470        SIMIX_process_on_exit((smx_process_t) simcall->args[0].dp,(int_f_pvoid_pvoid_t) simcall->args[1].fp, simcall->args[2].dp);
471       SIMIX_simcall_answer(simcall);
472       break;  
473
474 case SIMCALL_PROCESS_AUTO_RESTART_SET:
475        SIMIX_process_auto_restart_set((smx_process_t) simcall->args[0].dp, simcall->args[1].i);
476       SIMIX_simcall_answer(simcall);
477       break;  
478
479 case SIMCALL_PROCESS_RESTART:
480       simcall->result.dp = simcall_HANDLER_process_restart(simcall , (smx_process_t) simcall->args[0].dp);
481       SIMIX_simcall_answer(simcall);
482       break;  
483
484 case SIMCALL_RDV_CREATE:
485       simcall->result.dp = SIMIX_rdv_create( simcall->args[0].cc);
486       SIMIX_simcall_answer(simcall);
487       break;  
488
489 case SIMCALL_RDV_DESTROY:
490        SIMIX_rdv_destroy((smx_rdv_t) simcall->args[0].dp);
491       SIMIX_simcall_answer(simcall);
492       break;  
493
494 case SIMCALL_RDV_COMM_COUNT_BY_HOST:
495       simcall->result.ui = SIMIX_rdv_comm_count_by_host((smx_rdv_t) simcall->args[0].dp,(smx_host_t) simcall->args[1].dp);
496       SIMIX_simcall_answer(simcall);
497       break;  
498
499 case SIMCALL_RDV_GET_HEAD:
500       simcall->result.dp = SIMIX_rdv_get_head((smx_rdv_t) simcall->args[0].dp);
501       SIMIX_simcall_answer(simcall);
502       break;  
503
504 case SIMCALL_RDV_SET_RECEIVER:
505        SIMIX_rdv_set_receiver((smx_rdv_t) simcall->args[0].dp,(smx_process_t) simcall->args[1].dp);
506       SIMIX_simcall_answer(simcall);
507       break;  
508
509 case SIMCALL_RDV_GET_RECEIVER:
510       simcall->result.dp = SIMIX_rdv_get_receiver((smx_rdv_t) simcall->args[0].dp);
511       SIMIX_simcall_answer(simcall);
512       break;  
513
514 case SIMCALL_COMM_IPROBE:
515       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);
516       SIMIX_simcall_answer(simcall);
517       break;  
518
519 case SIMCALL_COMM_SEND:
520        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);
521        break;  
522
523 case SIMCALL_COMM_ISEND:
524       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);
525       SIMIX_simcall_answer(simcall);
526       break;  
527
528 case SIMCALL_COMM_RECV:
529        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);
530        break;  
531
532 case SIMCALL_COMM_IRECV:
533       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);
534       SIMIX_simcall_answer(simcall);
535       break;  
536
537 case SIMCALL_COMM_CANCEL:
538        SIMIX_comm_cancel((smx_synchro_t) simcall->args[0].dp);
539       SIMIX_simcall_answer(simcall);
540       break;  
541
542 case SIMCALL_COMM_WAITANY:
543        simcall_HANDLER_comm_waitany(simcall , (xbt_dynar_t) simcall->args[0].dp);
544        break;  
545
546 case SIMCALL_COMM_WAIT:
547        simcall_HANDLER_comm_wait(simcall , (smx_synchro_t) simcall->args[0].dp,  simcall->args[1].d);
548        break;  
549
550 case SIMCALL_COMM_TEST:
551        simcall_HANDLER_comm_test(simcall , (smx_synchro_t) simcall->args[0].dp);
552        break;  
553
554 case SIMCALL_COMM_TESTANY:
555        simcall_HANDLER_comm_testany(simcall , (xbt_dynar_t) simcall->args[0].dp);
556        break;  
557
558 case SIMCALL_COMM_GET_REMAINS:
559       simcall->result.d = SIMIX_comm_get_remains((smx_synchro_t) simcall->args[0].dp);
560       SIMIX_simcall_answer(simcall);
561       break;  
562
563 case SIMCALL_COMM_GET_STATE:
564       simcall->result.i = SIMIX_comm_get_state((smx_synchro_t) simcall->args[0].dp);
565       SIMIX_simcall_answer(simcall);
566       break;  
567
568 case SIMCALL_COMM_GET_SRC_DATA:
569       simcall->result.dp = SIMIX_comm_get_src_data((smx_synchro_t) simcall->args[0].dp);
570       SIMIX_simcall_answer(simcall);
571       break;  
572
573 case SIMCALL_COMM_GET_DST_DATA:
574       simcall->result.dp = SIMIX_comm_get_dst_data((smx_synchro_t) simcall->args[0].dp);
575       SIMIX_simcall_answer(simcall);
576       break;  
577
578 case SIMCALL_COMM_GET_SRC_PROC:
579       simcall->result.dp = SIMIX_comm_get_src_proc((smx_synchro_t) simcall->args[0].dp);
580       SIMIX_simcall_answer(simcall);
581       break;  
582
583 case SIMCALL_COMM_GET_DST_PROC:
584       simcall->result.dp = SIMIX_comm_get_dst_proc((smx_synchro_t) simcall->args[0].dp);
585       SIMIX_simcall_answer(simcall);
586       break;  
587
588 case SIMCALL_MUTEX_INIT:
589       simcall->result.dp = simcall_HANDLER_mutex_init(simcall );
590       SIMIX_simcall_answer(simcall);
591       break;  
592
593 case SIMCALL_MUTEX_DESTROY:
594        SIMIX_mutex_destroy((smx_mutex_t) simcall->args[0].dp);
595       SIMIX_simcall_answer(simcall);
596       break;  
597
598 case SIMCALL_MUTEX_LOCK:
599        simcall_HANDLER_mutex_lock(simcall , (smx_mutex_t) simcall->args[0].dp);
600        break;  
601
602 case SIMCALL_MUTEX_TRYLOCK:
603       simcall->result.i = simcall_HANDLER_mutex_trylock(simcall , (smx_mutex_t) simcall->args[0].dp);
604       SIMIX_simcall_answer(simcall);
605       break;  
606
607 case SIMCALL_MUTEX_UNLOCK:
608        simcall_HANDLER_mutex_unlock(simcall , (smx_mutex_t) simcall->args[0].dp);
609       SIMIX_simcall_answer(simcall);
610       break;  
611
612 case SIMCALL_COND_INIT:
613       simcall->result.dp = SIMIX_cond_init();
614       SIMIX_simcall_answer(simcall);
615       break;  
616
617 case SIMCALL_COND_DESTROY:
618        SIMIX_cond_destroy((smx_cond_t) simcall->args[0].dp);
619       SIMIX_simcall_answer(simcall);
620       break;  
621
622 case SIMCALL_COND_SIGNAL:
623        SIMIX_cond_signal((smx_cond_t) simcall->args[0].dp);
624       SIMIX_simcall_answer(simcall);
625       break;  
626
627 case SIMCALL_COND_WAIT:
628        simcall_HANDLER_cond_wait(simcall , (smx_cond_t) simcall->args[0].dp, (smx_mutex_t) simcall->args[1].dp);
629        break;  
630
631 case SIMCALL_COND_WAIT_TIMEOUT:
632        simcall_HANDLER_cond_wait_timeout(simcall , (smx_cond_t) simcall->args[0].dp, (smx_mutex_t) simcall->args[1].dp,  simcall->args[2].d);
633        break;  
634
635 case SIMCALL_COND_BROADCAST:
636        SIMIX_cond_broadcast((smx_cond_t) simcall->args[0].dp);
637       SIMIX_simcall_answer(simcall);
638       break;  
639
640 case SIMCALL_SEM_INIT:
641       simcall->result.dp = SIMIX_sem_init( simcall->args[0].ui);
642       SIMIX_simcall_answer(simcall);
643       break;  
644
645 case SIMCALL_SEM_DESTROY:
646        SIMIX_sem_destroy((smx_sem_t) simcall->args[0].dp);
647       SIMIX_simcall_answer(simcall);
648       break;  
649
650 case SIMCALL_SEM_RELEASE:
651        simcall_HANDLER_sem_release(simcall , (smx_sem_t) simcall->args[0].dp);
652       SIMIX_simcall_answer(simcall);
653       break;  
654
655 case SIMCALL_SEM_WOULD_BLOCK:
656       simcall->result.i = simcall_HANDLER_sem_would_block(simcall , (smx_sem_t) simcall->args[0].dp);
657       SIMIX_simcall_answer(simcall);
658       break;  
659
660 case SIMCALL_SEM_ACQUIRE:
661        simcall_HANDLER_sem_acquire(simcall , (smx_sem_t) simcall->args[0].dp);
662        break;  
663
664 case SIMCALL_SEM_ACQUIRE_TIMEOUT:
665        simcall_HANDLER_sem_acquire_timeout(simcall , (smx_sem_t) simcall->args[0].dp,  simcall->args[1].d);
666        break;  
667
668 case SIMCALL_SEM_GET_CAPACITY:
669       simcall->result.i = simcall_HANDLER_sem_get_capacity(simcall , (smx_sem_t) simcall->args[0].dp);
670       SIMIX_simcall_answer(simcall);
671       break;  
672
673 case SIMCALL_FILE_READ:
674        simcall_HANDLER_file_read(simcall , (smx_file_t) simcall->args[0].dp,  simcall->args[1].sgsz, (smx_host_t) simcall->args[2].dp);
675        break;  
676
677 case SIMCALL_FILE_WRITE:
678        simcall_HANDLER_file_write(simcall , (smx_file_t) simcall->args[0].dp,  simcall->args[1].sgsz, (smx_host_t) simcall->args[2].dp);
679        break;  
680
681 case SIMCALL_FILE_OPEN:
682        simcall_HANDLER_file_open(simcall ,  simcall->args[0].cc, (smx_host_t) simcall->args[1].dp);
683        break;  
684
685 case SIMCALL_FILE_CLOSE:
686        simcall_HANDLER_file_close(simcall , (smx_file_t) simcall->args[0].dp, (smx_host_t) simcall->args[1].dp);
687        break;  
688
689 case SIMCALL_FILE_UNLINK:
690       simcall->result.i = SIMIX_file_unlink((smx_file_t) simcall->args[0].dp,(smx_host_t) simcall->args[1].dp);
691       SIMIX_simcall_answer(simcall);
692       break;  
693
694 case SIMCALL_FILE_GET_SIZE:
695       simcall->result.sgsz = simcall_HANDLER_file_get_size(simcall , (smx_file_t) simcall->args[0].dp);
696       SIMIX_simcall_answer(simcall);
697       break;  
698
699 case SIMCALL_FILE_TELL:
700       simcall->result.sgsz = simcall_HANDLER_file_tell(simcall , (smx_file_t) simcall->args[0].dp);
701       SIMIX_simcall_answer(simcall);
702       break;  
703
704 case SIMCALL_FILE_SEEK:
705       simcall->result.i = simcall_HANDLER_file_seek(simcall , (smx_file_t) simcall->args[0].dp,  simcall->args[1].sgoff,  simcall->args[2].i);
706       SIMIX_simcall_answer(simcall);
707       break;  
708
709 case SIMCALL_FILE_GET_INFO:
710       simcall->result.dp = simcall_HANDLER_file_get_info(simcall , (smx_file_t) simcall->args[0].dp);
711       SIMIX_simcall_answer(simcall);
712       break;  
713
714 case SIMCALL_FILE_MOVE:
715       simcall->result.i = simcall_HANDLER_file_move(simcall , (smx_file_t) simcall->args[0].dp,  simcall->args[1].cc);
716       SIMIX_simcall_answer(simcall);
717       break;  
718
719 case SIMCALL_STORAGE_GET_FREE_SIZE:
720       simcall->result.sgsz = simcall_HANDLER_storage_get_free_size(simcall , (smx_storage_t) simcall->args[0].dp);
721       SIMIX_simcall_answer(simcall);
722       break;  
723
724 case SIMCALL_STORAGE_GET_USED_SIZE:
725       simcall->result.sgsz = simcall_HANDLER_storage_get_used_size(simcall , (smx_storage_t) simcall->args[0].dp);
726       SIMIX_simcall_answer(simcall);
727       break;  
728
729 case SIMCALL_STORAGE_GET_PROPERTIES:
730       simcall->result.dp = SIMIX_storage_get_properties((smx_storage_t) simcall->args[0].dp);
731       SIMIX_simcall_answer(simcall);
732       break;  
733
734 case SIMCALL_STORAGE_GET_CONTENT:
735       simcall->result.dp = SIMIX_storage_get_content((smx_storage_t) simcall->args[0].dp);
736       SIMIX_simcall_answer(simcall);
737       break;  
738
739 case SIMCALL_ASR_GET_PROPERTIES:
740       simcall->result.dp = simcall_HANDLER_asr_get_properties(simcall ,  simcall->args[0].cc);
741       SIMIX_simcall_answer(simcall);
742       break;  
743
744 case SIMCALL_MC_RANDOM:
745       simcall->result.i = simcall_HANDLER_mc_random(simcall ,  simcall->args[0].i,  simcall->args[1].i);
746       SIMIX_simcall_answer(simcall);
747       break;  
748
749 case SIMCALL_SET_CATEGORY:
750        SIMIX_set_category((smx_synchro_t) simcall->args[0].dp, simcall->args[1].cc);
751       SIMIX_simcall_answer(simcall);
752       break;  
753
754 #ifdef HAVE_LATENCY_BOUND_TRACKING
755 case SIMCALL_COMM_IS_LATENCY_BOUNDED:
756       simcall->result.i = SIMIX_comm_is_latency_bounded((smx_synchro_t) simcall->args[0].dp);
757       SIMIX_simcall_answer(simcall);
758       break;  
759
760 #endif
761
762 #ifdef HAVE_MC
763 case SIMCALL_MC_SNAPSHOT:
764       simcall->result.dp = simcall_HANDLER_mc_snapshot(simcall );
765       SIMIX_simcall_answer(simcall);
766       break;  
767
768 case SIMCALL_MC_COMPARE_SNAPSHOTS:
769       simcall->result.i = simcall_HANDLER_mc_compare_snapshots(simcall , (mc_snapshot_t) simcall->args[0].dp, (mc_snapshot_t) simcall->args[1].dp);
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 }