From 821cff12278ebc3e6ffc12696cb42cbe450c6d1e Mon Sep 17 00:00:00 2001
From: MerryMage <MerryMage@users.noreply.github.com>
Date: Wed, 4 Jul 2018 00:03:36 +0100
Subject: [PATCH] A64: Add ClearExclusiveState method

---
 include/dynarmic/A64/a64.h        | 3 +++
 src/backend_x64/a64_interface.cpp | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/include/dynarmic/A64/a64.h b/include/dynarmic/A64/a64.h
index 0e3808ff..02123f6a 100644
--- a/include/dynarmic/A64/a64.h
+++ b/include/dynarmic/A64/a64.h
@@ -100,6 +100,9 @@ public:
     /// Modify PSTATE
     void SetPstate(std::uint32_t value);
 
+    /// Clears exclusive state for this core.
+    void ClearExclusiveState();
+
     /**
      * Returns true if Jit::Run was called but hasn't returned yet.
      * i.e.: We're in a callback.
diff --git a/src/backend_x64/a64_interface.cpp b/src/backend_x64/a64_interface.cpp
index 8e3f88c1..6d55fbe9 100644
--- a/src/backend_x64/a64_interface.cpp
+++ b/src/backend_x64/a64_interface.cpp
@@ -167,6 +167,10 @@ public:
         jit_state.SetPstate(value);
     }
 
+    void ClearExclusiveState() {
+        jit_state.exclusive_state = 0;
+    }
+
     bool IsExecuting() const {
         return is_executing;
     }
@@ -338,6 +342,10 @@ void Jit::SetPstate(u32 value) {
     impl->SetPstate(value);
 }
 
+void Jit::ClearExclusiveState() {
+    impl->ClearExclusiveState();
+}
+
 bool Jit::IsExecuting() const {
     return impl->IsExecuting();
 }