summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-08 00:04:02 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:38 +0200
commit445b4342b3db8ab447aaa9e5422d2a7a3a45e5ac (patch)
treec769dfe2a0dea5efe60fa7a4ba3d2c3ec687ec63 /src/core/hle/kernel
parentARM/Memory: Correct Exclusive Monitor and Implement Exclusive Memory Writes. (diff)
downloadyuzu-445b4342b3db8ab447aaa9e5422d2a7a3a45e5ac.tar
yuzu-445b4342b3db8ab447aaa9e5422d2a7a3a45e5ac.tar.gz
yuzu-445b4342b3db8ab447aaa9e5422d2a7a3a45e5ac.tar.bz2
yuzu-445b4342b3db8ab447aaa9e5422d2a7a3a45e5ac.tar.lz
yuzu-445b4342b3db8ab447aaa9e5422d2a7a3a45e5ac.tar.xz
yuzu-445b4342b3db8ab447aaa9e5422d2a7a3a45e5ac.tar.zst
yuzu-445b4342b3db8ab447aaa9e5422d2a7a3a45e5ac.zip
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/mutex.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp
index 16c95782a..5a96d5e90 100644
--- a/src/core/hle/kernel/mutex.cpp
+++ b/src/core/hle/kernel/mutex.cpp
@@ -9,7 +9,6 @@
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/core.h"
-#include "core/arm/exclusive_monitor.h"
#include "core/core.h"
#include "core/hle/kernel/errors.h"
#include "core/hle/kernel/handle_table.h"
@@ -135,12 +134,8 @@ std::pair<ResultCode, std::shared_ptr<Thread>> Mutex::Unlock(std::shared_ptr<Thr
}
auto [new_owner, num_waiters] = GetHighestPriorityMutexWaitingThread(owner, address);
- auto& monitor = system.Monitor();
- const std::size_t current_core = system.CurrentCoreIndex();
if (new_owner == nullptr) {
- do {
- monitor.SetExclusive32(current_core, address);
- } while (!monitor.ExclusiveWrite32(current_core, address, 0));
+ system.Memory().Write32(address, 0);
return {RESULT_SUCCESS, nullptr};
}
// Transfer the ownership of the mutex from the previous owner to the new one.
@@ -154,9 +149,7 @@ std::pair<ResultCode, std::shared_ptr<Thread>> Mutex::Unlock(std::shared_ptr<Thr
new_owner->SetLockOwner(nullptr);
new_owner->ResumeFromWait();
- do {
- monitor.SetExclusive32(current_core, address);
- } while (!monitor.ExclusiveWrite32(current_core, address, mutex_value));
+ system.Memory().Write32(address, mutex_value);
return {RESULT_SUCCESS, new_owner};
}