-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3589 from bylaws/wow-inval
WOW64 backend code invalidation fixes
- Loading branch information
Showing
4 changed files
with
86 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
// SPDX-License-Identifier: MIT | ||
// FIXME TODO put in cpp | ||
#pragma once | ||
|
||
#include "IntervalList.h" | ||
#include <mutex> | ||
#include <unordered_map> | ||
|
||
namespace FEXCore::Core { | ||
struct InternalThreadState; | ||
} | ||
|
||
namespace FEXCore::Context { | ||
class Context; | ||
} | ||
|
||
namespace FEX::Windows { | ||
/** | ||
* @brief Handles SMC and regular code invalidation | ||
*/ | ||
class InvalidationTracker { | ||
public: | ||
void HandleMemoryProtectionNotification(FEXCore::Core::InternalThreadState* Thread, uint64_t Address, uint64_t Size, ULONG Prot); | ||
void InvalidateContainingSection(FEXCore::Core::InternalThreadState* Thread, uint64_t Address, bool Free); | ||
void InvalidateAlignedInterval(FEXCore::Core::InternalThreadState* Thread, uint64_t Address, uint64_t Size, bool Free); | ||
InvalidationTracker(FEXCore::Context::Context& CTX, const std::unordered_map<DWORD, FEXCore::Core::InternalThreadState*>& Threads); | ||
void HandleMemoryProtectionNotification(uint64_t Address, uint64_t Size, ULONG Prot); | ||
void InvalidateContainingSection(uint64_t Address, bool Free); | ||
void InvalidateAlignedInterval(uint64_t Address, uint64_t Size, bool Free); | ||
void ReprotectRWXIntervals(uint64_t Address, uint64_t Size); | ||
bool HandleRWXAccessViolation(FEXCore::Core::InternalThreadState* Thread, uint64_t FaultAddress); | ||
bool HandleRWXAccessViolation(uint64_t FaultAddress); | ||
|
||
private: | ||
IntervalList<uint64_t> RWXIntervals; | ||
std::mutex RWXIntervalsLock; | ||
FEXCore::Context::Context& CTX; | ||
const std::unordered_map<DWORD, FEXCore::Core::InternalThreadState*>& Threads; | ||
}; | ||
} // namespace FEX::Windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters