28 #ifndef __SIM_GUEST_ABI_DISPATCH_HH__
29 #define __SIM_GUEST_ABI_DISPATCH_HH__
34 #include <type_traits>
60 template <
typename ABI,
typename Ret,
bool store_ret,
typename Target,
61 typename State,
typename Args, std::size_t... I>
62 static inline typename std::enable_if_t<!store_ret, Ret>
64 std::index_sequence<I...>)
66 return target(tc, std::get<I>(args)...);
69 template <
typename ABI,
typename Ret,
bool store_ret,
typename Target,
70 typename State,
typename Args, std::size_t... I>
71 static inline typename std::enable_if_t<store_ret, Ret>
73 std::index_sequence<I...>)
75 Ret ret = target(tc, std::get<I>(args)...);
76 storeResult<ABI, Ret>(tc, ret, state);
80 template <
typename ABI,
typename Ret,
bool store_ret,
typename ...Args>
87 auto args = std::tuple<Args...>{getArgument<ABI, Args>(tc, state)...};
90 return callFromHelper<ABI, Ret, store_ret>(
91 target, tc, state, std::move(args),
92 std::make_index_sequence<
sizeof...(Args)>{});
101 template <
typename ABI,
typename Ret,
typename ...Args>
104 typename ABI::State &state)
109 GEM5_FOR_EACH_IN_PACK(
os << (
count++ ?
", " :
"("),
110 os << getArgument<ABI, Args>(tc, state));
117 #endif // __SIM_GUEST_ABI_DISPATCH_HH__