Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill another old-fashioned simcall
[simgrid.git] / src / simix / popping_generated.cpp
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 /* Copyright (c) 2014-2017. The SimGrid Team. All rights reserved.    */
8 /**********************************************************************/
9
10 /*
11  * Note that the name comes from http://en.wikipedia.org/wiki/Popping
12  * Indeed, the control flow is doing a strange dance in there.
13  *
14  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
15  */
16
17 #include <xbt/base.h>
18 #include "smx_private.h"
19 #if SIMGRID_HAVE_MC
20 #include "src/mc/mc_forward.hpp"
21 #endif
22
23 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);
24
25 /** @brief Simcalls' names (generated from src/simix/simcalls.in) */
26 const char* simcall_names[] = {
27     "SIMCALL_NONE",
28     "SIMCALL_PROCESS_KILL",
29     "SIMCALL_PROCESS_KILLALL",
30     "SIMCALL_PROCESS_CLEANUP",
31     "SIMCALL_PROCESS_SUSPEND",
32     "SIMCALL_PROCESS_JOIN",
33     "SIMCALL_PROCESS_SLEEP",
34     "SIMCALL_EXECUTION_START",
35     "SIMCALL_EXECUTION_PARALLEL_START",
36     "SIMCALL_EXECUTION_CANCEL",
37     "SIMCALL_EXECUTION_SET_PRIORITY",
38     "SIMCALL_EXECUTION_SET_BOUND",
39     "SIMCALL_EXECUTION_WAIT",
40     "SIMCALL_PROCESS_ON_EXIT",
41     "SIMCALL_PROCESS_RESTART",
42     "SIMCALL_COMM_IPROBE",
43     "SIMCALL_COMM_SEND",
44     "SIMCALL_COMM_ISEND",
45     "SIMCALL_COMM_RECV",
46     "SIMCALL_COMM_IRECV",
47     "SIMCALL_COMM_WAITANY",
48     "SIMCALL_COMM_WAIT",
49     "SIMCALL_COMM_TEST",
50     "SIMCALL_COMM_TESTANY",
51     "SIMCALL_MUTEX_INIT",
52     "SIMCALL_MUTEX_LOCK",
53     "SIMCALL_MUTEX_TRYLOCK",
54     "SIMCALL_MUTEX_UNLOCK",
55     "SIMCALL_COND_INIT",
56     "SIMCALL_COND_SIGNAL",
57     "SIMCALL_COND_WAIT",
58     "SIMCALL_COND_WAIT_TIMEOUT",
59     "SIMCALL_COND_BROADCAST",
60     "SIMCALL_SEM_INIT",
61     "SIMCALL_SEM_RELEASE",
62     "SIMCALL_SEM_WOULD_BLOCK",
63     "SIMCALL_SEM_ACQUIRE",
64     "SIMCALL_SEM_ACQUIRE_TIMEOUT",
65     "SIMCALL_SEM_GET_CAPACITY",
66     "SIMCALL_FILE_READ",
67     "SIMCALL_FILE_WRITE",
68     "SIMCALL_MC_RANDOM",
69     "SIMCALL_SET_CATEGORY",
70     "SIMCALL_RUN_KERNEL",
71     "SIMCALL_RUN_BLOCKING",
72 };
73
74 /** @private
75  * @brief (in kernel mode) unpack the simcall and activate the handler
76  *
77  * This function is generated from src/simix/simcalls.in
78  */
79 void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {
80   XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call));
81   SIMCALL_SET_MC_VALUE(simcall, value);
82   if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP)
83     return;
84   switch (simcall->call) {
85 case SIMCALL_PROCESS_KILL:
86       simcall_HANDLER_process_kill(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
87       SIMIX_simcall_answer(simcall);
88       break;
89
90 case SIMCALL_PROCESS_KILLALL:
91       simcall_HANDLER_process_killall(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]));
92       SIMIX_simcall_answer(simcall);
93       break;
94
95 case SIMCALL_PROCESS_CLEANUP:
96       SIMIX_process_cleanup(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
97       SIMIX_simcall_answer(simcall);
98       break;
99
100 case SIMCALL_PROCESS_SUSPEND:
101       simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
102       break;
103
104 case SIMCALL_PROCESS_JOIN:
105       simcall_HANDLER_process_join(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
106       break;
107
108 case SIMCALL_PROCESS_SLEEP:
109       simcall_HANDLER_process_sleep(simcall, simgrid::simix::unmarshal<double>(simcall->args[0]));
110       break;
111
112 case SIMCALL_EXECUTION_START:
113   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(
114       simcall->result,
115       simcall_HANDLER_execution_start(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]),
116                                       simgrid::simix::unmarshal<double>(simcall->args[1]),
117                                       simgrid::simix::unmarshal<double>(simcall->args[2]),
118                                       simgrid::simix::unmarshal<double>(simcall->args[3])));
119   SIMIX_simcall_answer(simcall);
120   break;
121
122 case SIMCALL_EXECUTION_PARALLEL_START:
123   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(
124       simcall->result,
125       SIMIX_execution_parallel_start(
126           simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]),
127           simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]), simgrid::simix::unmarshal<double*>(simcall->args[3]),
128           simgrid::simix::unmarshal<double*>(simcall->args[4]), simgrid::simix::unmarshal<double>(simcall->args[5]),
129           simgrid::simix::unmarshal<double>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
130   SIMIX_simcall_answer(simcall);
131   break;
132
133 case SIMCALL_EXECUTION_CANCEL:
134   SIMIX_execution_cancel(
135       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
136   SIMIX_simcall_answer(simcall);
137   break;
138
139 case SIMCALL_EXECUTION_SET_PRIORITY:
140   SIMIX_execution_set_priority(
141       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
142       simgrid::simix::unmarshal<double>(simcall->args[1]));
143   SIMIX_simcall_answer(simcall);
144   break;
145
146 case SIMCALL_EXECUTION_SET_BOUND:
147   SIMIX_execution_set_bound(
148       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
149       simgrid::simix::unmarshal<double>(simcall->args[1]));
150   SIMIX_simcall_answer(simcall);
151   break;
152
153 case SIMCALL_EXECUTION_WAIT:
154   simcall_HANDLER_execution_wait(
155       simcall,
156       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
157   break;
158
159 case SIMCALL_PROCESS_ON_EXIT:
160       SIMIX_process_on_exit(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]));
161       SIMIX_simcall_answer(simcall);
162       break;
163
164 case SIMCALL_PROCESS_RESTART:
165       simgrid::simix::marshal<smx_actor_t>(simcall->result, simcall_HANDLER_process_restart(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0])));
166       SIMIX_simcall_answer(simcall);
167       break;
168
169 case SIMCALL_COMM_IPROBE:
170   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
171       simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]),
172                                                    simgrid::simix::unmarshal<int>(simcall->args[1]),
173                                                    simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[2]),
174                                                    simgrid::simix::unmarshal<void*>(simcall->args[3])));
175   SIMIX_simcall_answer(simcall);
176   break;
177
178 case SIMCALL_COMM_SEND:
179       simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[7]), simgrid::simix::unmarshal<void*>(simcall->args[8]), simgrid::simix::unmarshal<double>(simcall->args[9]));
180       break;
181
182 case SIMCALL_COMM_ISEND:
183   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
184       simcall->result,
185       simcall_HANDLER_comm_isend(
186           simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]),
187           simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]),
188           simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]),
189           simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]),
190           simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]),
191           simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]),
192           simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]),
193           simgrid::simix::unmarshal<void*>(simcall->args[9]), simgrid::simix::unmarshal<int>(simcall->args[10])));
194   SIMIX_simcall_answer(simcall);
195   break;
196
197 case SIMCALL_COMM_RECV:
198       simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7]), simgrid::simix::unmarshal<double>(simcall->args[8]));
199       break;
200
201 case SIMCALL_COMM_IRECV:
202   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
203       simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]),
204                                                   simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]),
205                                                   simgrid::simix::unmarshal<void*>(simcall->args[2]),
206                                                   simgrid::simix::unmarshal<size_t*>(simcall->args[3]),
207                                                   simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]),
208                                                   simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]),
209                                                   simgrid::simix::unmarshal<void*>(simcall->args[6]),
210                                                   simgrid::simix::unmarshal<double>(simcall->args[7])));
211   SIMIX_simcall_answer(simcall);
212   break;
213
214 case SIMCALL_COMM_WAITANY:
215       simcall_HANDLER_comm_waitany(simcall, simgrid::simix::unmarshal<xbt_dynar_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
216       break;
217
218 case SIMCALL_COMM_WAIT:
219   simcall_HANDLER_comm_wait(
220       simcall,
221       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
222       simgrid::simix::unmarshal<double>(simcall->args[1]));
223   break;
224
225 case SIMCALL_COMM_TEST:
226   simcall_HANDLER_comm_test(
227       simcall,
228       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
229   break;
230
231 case SIMCALL_COMM_TESTANY:
232   simcall_HANDLER_comm_testany(
233       simcall,
234       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0]),
235       simgrid::simix::unmarshal<size_t>(simcall->args[1]));
236   break;
237
238 case SIMCALL_MUTEX_INIT:
239       simgrid::simix::marshal<smx_mutex_t>(simcall->result, simcall_HANDLER_mutex_init(simcall));
240       SIMIX_simcall_answer(simcall);
241       break;
242
243 case SIMCALL_MUTEX_LOCK:
244       simcall_HANDLER_mutex_lock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
245       break;
246
247 case SIMCALL_MUTEX_TRYLOCK:
248       simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mutex_trylock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0])));
249       SIMIX_simcall_answer(simcall);
250       break;
251
252 case SIMCALL_MUTEX_UNLOCK:
253       simcall_HANDLER_mutex_unlock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
254       SIMIX_simcall_answer(simcall);
255       break;
256
257 case SIMCALL_COND_INIT:
258       simgrid::simix::marshal<smx_cond_t>(simcall->result, SIMIX_cond_init());
259       SIMIX_simcall_answer(simcall);
260       break;
261
262 case SIMCALL_COND_SIGNAL:
263       SIMIX_cond_signal(simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]));
264       SIMIX_simcall_answer(simcall);
265       break;
266
267 case SIMCALL_COND_WAIT:
268       simcall_HANDLER_cond_wait(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]));
269       break;
270
271 case SIMCALL_COND_WAIT_TIMEOUT:
272       simcall_HANDLER_cond_wait_timeout(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]));
273       break;
274
275 case SIMCALL_COND_BROADCAST:
276       SIMIX_cond_broadcast(simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]));
277       SIMIX_simcall_answer(simcall);
278       break;
279
280 case SIMCALL_SEM_INIT:
281       simgrid::simix::marshal<smx_sem_t>(simcall->result, SIMIX_sem_init(simgrid::simix::unmarshal<unsigned int>(simcall->args[0])));
282       SIMIX_simcall_answer(simcall);
283       break;
284
285 case SIMCALL_SEM_RELEASE:
286       simcall_HANDLER_sem_release(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]));
287       SIMIX_simcall_answer(simcall);
288       break;
289
290 case SIMCALL_SEM_WOULD_BLOCK:
291       simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_sem_would_block(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0])));
292       SIMIX_simcall_answer(simcall);
293       break;
294
295 case SIMCALL_SEM_ACQUIRE:
296       simcall_HANDLER_sem_acquire(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]));
297       break;
298
299 case SIMCALL_SEM_ACQUIRE_TIMEOUT:
300       simcall_HANDLER_sem_acquire_timeout(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
301       break;
302
303 case SIMCALL_SEM_GET_CAPACITY:
304       simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_sem_get_capacity(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0])));
305       SIMIX_simcall_answer(simcall);
306       break;
307
308 case SIMCALL_FILE_READ:
309   simcall_HANDLER_file_read(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
310                             simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]));
311   break;
312
313 case SIMCALL_FILE_WRITE:
314   simcall_HANDLER_file_write(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
315                              simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]));
316   break;
317
318 case SIMCALL_MC_RANDOM:
319       simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mc_random(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1])));
320       SIMIX_simcall_answer(simcall);
321       break;
322
323 case SIMCALL_SET_CATEGORY:
324   SIMIX_set_category(
325       simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
326       simgrid::simix::unmarshal<const char*>(simcall->args[1]));
327   SIMIX_simcall_answer(simcall);
328   break;
329
330 case SIMCALL_RUN_KERNEL:
331       SIMIX_run_kernel(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
332       SIMIX_simcall_answer(simcall);
333       break;
334
335 case SIMCALL_RUN_BLOCKING:
336       SIMIX_run_blocking(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
337       break;
338     case NUM_SIMCALLS:
339       break;
340     case SIMCALL_NONE:
341       THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",
342           simcall->issuer->name.c_str(),
343           sg_host_get_name(simcall->issuer->host)
344           );
345       break;
346
347   }
348 }