[orbis-kernel] Workaround strange bug

Occurs in Debug builds.
This commit is contained in:
Ivan Chikish 2023-07-09 12:06:43 +03:00
parent c2e47df91f
commit 863b5c3a4a

View file

@ -109,8 +109,16 @@ template <auto Fn> constexpr auto wrap() -> decltype(detail::WrapImpl<Fn>()()) {
return detail::WrapImpl<Fn>()();
}
namespace {
struct sysc_hash {
std::size_t operator()(SysResult (*ptr)(Thread *, uint64_t *)) const {
return reinterpret_cast<std::uintptr_t>(ptr) >> 4;
}
};
} // namespace
static const std::unordered_map<SysResult (*)(Thread *, uint64_t *),
const char *>
const char *, sysc_hash>
gImplToName = {
{wrap<nosys>().call, "nosys"},
{wrap<sys_exit>().call, "sys_exit"},