2020-01-26 20:14:18 +00:00
|
|
|
// Copyright 2018 yuzu emulator team
|
2018-07-03 13:28:46 +00:00
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-01-26 14:28:23 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2018-07-03 13:28:46 +00:00
|
|
|
#include "common/common_types.h"
|
|
|
|
|
2020-03-31 19:10:44 +00:00
|
|
|
namespace Core::Memory {
|
2020-01-26 14:28:23 +00:00
|
|
|
class Memory;
|
|
|
|
}
|
|
|
|
|
2018-08-25 01:43:32 +00:00
|
|
|
namespace Core {
|
|
|
|
|
2018-07-03 13:28:46 +00:00
|
|
|
class ExclusiveMonitor {
|
|
|
|
public:
|
|
|
|
virtual ~ExclusiveMonitor();
|
|
|
|
|
2020-03-15 19:54:40 +00:00
|
|
|
virtual u8 ExclusiveRead8(std::size_t core_index, VAddr addr) = 0;
|
|
|
|
virtual u16 ExclusiveRead16(std::size_t core_index, VAddr addr) = 0;
|
|
|
|
virtual u32 ExclusiveRead32(std::size_t core_index, VAddr addr) = 0;
|
|
|
|
virtual u64 ExclusiveRead64(std::size_t core_index, VAddr addr) = 0;
|
|
|
|
virtual u128 ExclusiveRead128(std::size_t core_index, VAddr addr) = 0;
|
2018-07-03 13:28:46 +00:00
|
|
|
virtual void ClearExclusive() = 0;
|
|
|
|
|
2018-09-15 13:21:06 +00:00
|
|
|
virtual bool ExclusiveWrite8(std::size_t core_index, VAddr vaddr, u8 value) = 0;
|
|
|
|
virtual bool ExclusiveWrite16(std::size_t core_index, VAddr vaddr, u16 value) = 0;
|
|
|
|
virtual bool ExclusiveWrite32(std::size_t core_index, VAddr vaddr, u32 value) = 0;
|
|
|
|
virtual bool ExclusiveWrite64(std::size_t core_index, VAddr vaddr, u64 value) = 0;
|
|
|
|
virtual bool ExclusiveWrite128(std::size_t core_index, VAddr vaddr, u128 value) = 0;
|
2018-07-03 13:28:46 +00:00
|
|
|
};
|
2018-08-25 01:43:32 +00:00
|
|
|
|
2020-01-26 20:14:18 +00:00
|
|
|
std::unique_ptr<Core::ExclusiveMonitor> MakeExclusiveMonitor(Memory::Memory& memory,
|
|
|
|
std::size_t num_cores);
|
2020-01-26 14:28:23 +00:00
|
|
|
|
2018-08-25 01:43:32 +00:00
|
|
|
} // namespace Core
|