Logo AND Algorithmique Numérique Distribuée

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