1 /**********************************************************************/
2 /* File generated by src/simix/simcalls.py from src/simix/simcalls.in */
4 /* DO NOT EVER CHANGE THIS FILE */
6 /* change simcalls specification in src/simix/simcalls.in */
7 /* Copyright (c) 2014-2022. The SimGrid Team. All rights reserved. */
8 /**********************************************************************/
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.
14 * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
17 #include <simgrid/config.h>
18 #include <simgrid/host.h>
21 #include "src/mc/mc_forward.hpp"
23 #include "src/kernel/activity/ConditionVariableImpl.hpp"
24 #include "src/kernel/actor/SimcallObserver.hpp"
25 #include "src/kernel/context/Context.hpp"
27 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
29 using simgrid::simix::Simcall;
30 /** @brief Simcalls' names (generated from src/simix/simcalls.in) */
31 constexpr std::array<const char*, simgrid::simix::NUM_SIMCALLS> simcall_names{{
33 "Simcall::RUN_KERNEL",
34 "Simcall::RUN_BLOCKING",
38 * @brief (in kernel mode) unpack the simcall and activate the handler
40 * This function is generated from src/simix/simcalls.in
42 void simgrid::kernel::actor::ActorImpl::simcall_handle(int times_considered)
44 XBT_DEBUG("Handling simcall %p: %s", &simcall_, SIMIX_simcall_name(simcall_));
45 if (simcall_.observer_ != nullptr)
46 simcall_.observer_->prepare(times_considered);
47 if (context_->wannadie())
49 switch (simcall_.call_) {
50 case Simcall::RUN_KERNEL:
51 SIMIX_run_kernel(simgrid::simix::unmarshal<std::function<void()> const*>(simcall_.args_[0]));
55 case Simcall::RUN_BLOCKING:
56 SIMIX_run_blocking(simgrid::simix::unmarshal<std::function<void()> const*>(simcall_.args_[0]));
60 throw std::invalid_argument(simgrid::xbt::string_printf("Asked to do the noop syscall on %s@%s",
62 sg_host_get_name(get_host())));