Exclusive Monitor: Allow clearing a single processor.

This commit is contained in:
Fernando Sahmkow 2020-03-07 15:07:29 -04:00 committed by MerryMage
parent 2068658a82
commit b5d8b24a3c
2 changed files with 10 additions and 1 deletions

View file

@ -46,6 +46,8 @@ public:
/// Unmark everything. /// Unmark everything.
void Clear(); void Clear();
/// Unmark processor id
void Clear(size_t processor_id);
private: private:
bool CheckAndClear(size_t processor_id, VAddr address, size_t size); bool CheckAndClear(size_t processor_id, VAddr address, size_t size);
@ -53,7 +55,7 @@ private:
void Lock(); void Lock();
void Unlock(); void Unlock();
static constexpr VAddr RESERVATION_GRANULE_MASK = 0xFFFF'FFFF'FFFF'FFF0ull; static constexpr VAddr RESERVATION_GRANULE_MASK = 0xFFFF'FFFF'FFFF'FFFFull;
static constexpr VAddr INVALID_EXCLUSIVE_ADDRESS = 0xDEAD'DEAD'DEAD'DEADull; static constexpr VAddr INVALID_EXCLUSIVE_ADDRESS = 0xDEAD'DEAD'DEAD'DEADull;
std::atomic_flag is_locked; std::atomic_flag is_locked;
std::vector<VAddr> exclusive_addresses; std::vector<VAddr> exclusive_addresses;

View file

@ -60,5 +60,12 @@ void ExclusiveMonitor::Clear() {
Unlock(); Unlock();
} }
void ExclusiveMonitor::Clear(size_t processor_id) {
Lock();
exclusive_addresses[processor_id] = INVALID_EXCLUSIVE_ADDRESS;
Unlock();
}
} // namespace A64 } // namespace A64
} // namespace Dynarmic } // namespace Dynarmic