Logo AND Algorithmique Numérique Distribuée

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