From 25565dffd588006aace7530486e71ff318dc5550 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sun, 15 Mar 2020 15:54:40 -0400 Subject: ARM: Addapt to new Exclusive Monitor Interface. --- src/core/arm/dynarmic/arm_dynarmic_64.cpp | 22 ++++++++++------------ src/core/arm/dynarmic/arm_dynarmic_64.h | 10 +++++----- src/core/arm/exclusive_monitor.h | 10 +++++----- 3 files changed, 20 insertions(+), 22 deletions(-) (limited to 'src/core/arm') diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index 84b872f0b..2e664cfa8 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp @@ -180,8 +180,6 @@ std::shared_ptr ARM_Dynarmic_64::MakeJit(Common::PageTable& return std::make_shared(config); } - - void ARM_Dynarmic_64::Run() { jit->Run(); } @@ -297,24 +295,24 @@ DynarmicExclusiveMonitor::DynarmicExclusiveMonitor(Memory::Memory& memory, std:: DynarmicExclusiveMonitor::~DynarmicExclusiveMonitor() = default; -void DynarmicExclusiveMonitor::SetExclusive8(std::size_t core_index, VAddr addr) { - monitor.Mark(core_index, addr, 1, [&]() -> u8 { return memory.Read8(addr); }); +u8 DynarmicExclusiveMonitor::ExclusiveRead8(std::size_t core_index, VAddr addr) { + return monitor.ReadAndMark(core_index, addr, [&]() -> u8 { return memory.Read8(addr); }); } -void DynarmicExclusiveMonitor::SetExclusive16(std::size_t core_index, VAddr addr) { - monitor.Mark(core_index, addr, 2, [&]() -> u16 { return memory.Read16(addr); }); +u16 DynarmicExclusiveMonitor::ExclusiveRead16(std::size_t core_index, VAddr addr) { + return monitor.ReadAndMark(core_index, addr, [&]() -> u16 { return memory.Read16(addr); }); } -void DynarmicExclusiveMonitor::SetExclusive32(std::size_t core_index, VAddr addr) { - monitor.Mark(core_index, addr, 4, [&]() -> u32 { return memory.Read32(addr); }); +u32 DynarmicExclusiveMonitor::ExclusiveRead32(std::size_t core_index, VAddr addr) { + return monitor.ReadAndMark(core_index, addr, [&]() -> u32 { return memory.Read32(addr); }); } -void DynarmicExclusiveMonitor::SetExclusive64(std::size_t core_index, VAddr addr) { - monitor.Mark(core_index, addr, 8, [&]() -> u64 { return memory.Read64(addr); }); +u64 DynarmicExclusiveMonitor::ExclusiveRead64(std::size_t core_index, VAddr addr) { + return monitor.ReadAndMark(core_index, addr, [&]() -> u64 { return memory.Read64(addr); }); } -void DynarmicExclusiveMonitor::SetExclusive128(std::size_t core_index, VAddr addr) { - monitor.Mark(core_index, addr, 16, [&]() -> u128 { +u128 DynarmicExclusiveMonitor::ExclusiveRead128(std::size_t core_index, VAddr addr) { + return monitor.ReadAndMark(core_index, addr, [&]() -> u128 { u128 result; result[0] = memory.Read64(addr); result[1] = memory.Read64(addr + 8); diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.h b/src/core/arm/dynarmic/arm_dynarmic_64.h index 3ead59f16..5560578ad 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.h +++ b/src/core/arm/dynarmic/arm_dynarmic_64.h @@ -82,11 +82,11 @@ public: explicit DynarmicExclusiveMonitor(Memory::Memory& memory, std::size_t core_count); ~DynarmicExclusiveMonitor() override; - void SetExclusive8(std::size_t core_index, VAddr addr) override; - void SetExclusive16(std::size_t core_index, VAddr addr) override; - void SetExclusive32(std::size_t core_index, VAddr addr) override; - void SetExclusive64(std::size_t core_index, VAddr addr) override; - void SetExclusive128(std::size_t core_index, VAddr addr) override; + u8 ExclusiveRead8(std::size_t core_index, VAddr addr) override; + u16 ExclusiveRead16(std::size_t core_index, VAddr addr) override; + u32 ExclusiveRead32(std::size_t core_index, VAddr addr) override; + u64 ExclusiveRead64(std::size_t core_index, VAddr addr) override; + u128 ExclusiveRead128(std::size_t core_index, VAddr addr) override; void ClearExclusive() override; bool ExclusiveWrite8(std::size_t core_index, VAddr vaddr, u8 value) override; diff --git a/src/core/arm/exclusive_monitor.h b/src/core/arm/exclusive_monitor.h index 2ee312eee..62f6e6023 100644 --- a/src/core/arm/exclusive_monitor.h +++ b/src/core/arm/exclusive_monitor.h @@ -18,11 +18,11 @@ class ExclusiveMonitor { public: virtual ~ExclusiveMonitor(); - virtual void SetExclusive8(std::size_t core_index, VAddr addr) = 0; - virtual void SetExclusive16(std::size_t core_index, VAddr addr) = 0; - virtual void SetExclusive32(std::size_t core_index, VAddr addr) = 0; - virtual void SetExclusive64(std::size_t core_index, VAddr addr) = 0; - virtual void SetExclusive128(std::size_t core_index, VAddr addr) = 0; + 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; virtual void ClearExclusive() = 0; virtual bool ExclusiveWrite8(std::size_t core_index, VAddr vaddr, u8 value) = 0; -- cgit v1.2.3