28 #ifndef __SIM_GUEST_ABI_DISPATCH_HH__
29 #define __SIM_GUEST_ABI_DISPATCH_HH__
33 #include <type_traits>
55 template <
typename ABI,
bool store_ret,
typename Ret>
56 static typename std::enable_if_t<!std::is_void<Ret>::value && store_ret, Ret>
61 storeResult<ABI, Ret>(tc, ret, state);
65 template <
typename ABI,
bool store_ret,
typename Ret>
66 static typename std::enable_if_t<!std::is_void<Ret>::value && !store_ret, Ret>
74 template <
typename ABI>
84 template <
typename ABI,
bool store_ret,
typename Ret,
85 typename NextArg,
typename ...Args>
86 static typename std::enable_if_t<!std::is_void<Ret>::value, Ret>
91 NextArg next = getArgument<ABI, NextArg>(tc, state);
96 return target(_tc, next, args...);
100 return callFrom<ABI, store_ret, Ret, Args...>(tc, state, partial);
105 template <
typename ABI,
typename NextArg,
typename ...Args>
108 std::function<
void(
ThreadContext *, NextArg, Args...)> target)
111 NextArg next = getArgument<ABI, NextArg>(tc, state);
116 target(_tc, next, args...);
120 callFrom<ABI, Args...>(tc, state, partial);
131 template <
typename ABI,
typename Ret>
134 typename ABI::State &state)
142 template <
typename ABI,
typename Ret,
typename NextArg,
typename ...Args>
145 typename ABI::State &state)
152 NextArg next = getArgument<ABI, NextArg>(tc, state);
163 #endif // __SIM_GUEST_ABI_DISPATCH_HH__