MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / AddCustomIREntrypoint

Method AddCustomIREntrypoint

FEXCore/Source/Interface/Core/Core.cpp:924–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

922}
923
924std::optional<CustomIRResult>
925ContextImpl::AddCustomIREntrypoint(uintptr_t Entrypoint, CustomIREntrypointHandler Handler, void* Creator, void* Data) {
926 LOGMAN_THROW_A_FMT(Config.Is64BitMode || !(Entrypoint >> 32), "64-bit Entrypoint in 32-bit mode {:x}", Entrypoint);
927
928 std::unique_lock lk(CustomIRMutex);
929
930 auto InsertedIterator = CustomIRHandlers.emplace(Entrypoint, CustomIRHandlerEntry {Handler, Creator, Data});
931 HasCustomIRHandlers = true;
932
933 if (!InsertedIterator.second) {
934 const auto& [fn, Creator, Data] = InsertedIterator.first->second;
935 return CustomIRResult(Creator, Data);
936 }
937
938 return std::nullopt;
939}
940
941void ContextImpl::AddThunkTrampolineIRHandler(uintptr_t Entrypoint, uintptr_t GuestThunkEntrypoint) {
942 LOGMAN_THROW_A_FMT(Entrypoint, "Tried to link null pointer address to guest function");

Callers

nothing calls this directly

Calls 2

CustomIRResultClass · 0.85
emplaceMethod · 0.80

Tested by

no test coverage detected