| 164 | } |
| 165 | |
| 166 | void LoadImageVolatileMetadata(const fextl::string& ModuleName, uint64_t Address) { |
| 167 | const auto Module = reinterpret_cast<HMODULE>(Address); |
| 168 | IMAGE_NT_HEADERS* Nt = RtlImageNtHeader(Module); |
| 169 | uint64_t EndAddress = Address + Nt->OptionalHeader.SizeOfImage; |
| 170 | |
| 171 | fextl::set<uint64_t> VolatileInstructions; |
| 172 | FEXCore::IntervalList<uint64_t> VolatileValidRanges; |
| 173 | |
| 174 | // Load FEX extended volatile metadata. |
| 175 | auto it = ExtendedMetaData.find(ModuleName); |
| 176 | if (it != ExtendedMetaData.end()) { |
| 177 | FEX::Windows::ApplyFEXExtendedVolatileMetadata(it->second, VolatileInstructions, VolatileValidRanges, Address, EndAddress); |
| 178 | } |
| 179 | |
| 180 | if (VolatileInstructions.empty() && VolatileValidRanges.Empty()) { |
| 181 | return; |
| 182 | } |
| 183 | |
| 184 | LogMan::Msg::DFmt("Loaded volatile metadata for {:X}: {} entries", Address, VolatileInstructions.size()); |
| 185 | std::scoped_lock Lock(CTX->GetCodeInvalidationMutex()); |
| 186 | CTX->AddForceTSOInformation(VolatileValidRanges, std::move(VolatileInstructions)); |
| 187 | } |
| 188 | |
| 189 | void HandleImageMap(uint64_t Address) { |
| 190 | fextl::string ModuleName = FEX::Windows::GetSectionFilePath(Address); |
no test coverage detected