* Instructs the Core to redirect calls to functions at the given * address to another function. The original callee address is passed * to the target function through an implicit argument stored in r11. * * For 32-bit the implicit argument is stored in the lower 32-bits of mm0. * * The primary use case of this is ensuring that host function pointers * returned from thunked API
| 410 | * returned from thunked APIs can safely be called by the guest. |
| 411 | */ |
| 412 | void LinkAddressToGuestFunction(void* argsv) { |
| 413 | struct args_t { |
| 414 | uintptr_t original_callee; |
| 415 | uintptr_t target_addr; // Guest function to call when branching to original_callee |
| 416 | }; |
| 417 | |
| 418 | auto args = reinterpret_cast<args_t*>(argsv); |
| 419 | auto CTX = static_cast<FEXCore::Context::Context*>(ThreadObject->Thread->CTX); |
| 420 | CTX->AddThunkTrampolineIRHandler(args->original_callee, args->target_addr); |
| 421 | } |
| 422 | |
| 423 | /** |
| 424 | * Guest-side helper to initiate creation of a host trampoline for |
nothing calls this directly
no test coverage detected