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

Method MonoBackpatcherWrite

FEXCore/Source/Interface/Core/Core.cpp:1011–1027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1009}
1010
1011void ContextImpl::MonoBackpatcherWrite(FEXCore::Core::CpuStateFrame* Frame, uint8_t Size, uint64_t Address, uint64_t Value) {
1012 auto Thread = Frame->Thread;
1013 auto CTX = static_cast<ContextImpl*>(Thread->CTX);
1014 {
1015 auto lk = GuardSignalDeferringSection(CTX->CodeInvalidationMutex, Thread);
1016
1017 if (Size == 8) {
1018 *reinterpret_cast<uint64_t *>(Address) = Value;
1019 } else if (Size == 4) {
1020 *reinterpret_cast<uint32_t *>(Address) = Value;
1021 } else {
1022 ERROR_AND_DIE_FMT("Unexpected write size for backpatcher: {}", Size);
1023 }
1024 }
1025
1026 CTX->SyscallHandler->InvalidateGuestCodeRange(Thread, Address, Size);
1027}
1028
1029IR::AOTIRCacheEntry* ContextImpl::LoadAOTIRCacheEntry(const fextl::string& filename) {
1030 auto rv = IRCaptureCache.LoadAOTIRCacheEntry(filename);

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected