summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/mutex.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2019-11-26 17:39:57 -0500
committerGravatar Lioncash2019-11-26 21:55:39 -0500
commite4c381b8850db96f162cfcf2cbe28b0e7c1f76f1 (patch)
tree14b95ea207543f3884558ebdf8673a511bf64dc3 /src/core/hle/kernel/mutex.cpp
parentcore/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory class (diff)
downloadyuzu-e4c381b8850db96f162cfcf2cbe28b0e7c1f76f1.tar.gz
yuzu-e4c381b8850db96f162cfcf2cbe28b0e7c1f76f1.tar.xz
yuzu-e4c381b8850db96f162cfcf2cbe28b0e7c1f76f1.zip
core/memory: Migrate over Write{8, 16, 32, 64, Block} to the Memory class
The Write functions are used slightly less than the Read functions, which make these a bit nicer to move over. The only adjustments we really need to make here are to Dynarmic's exclusive monitor instance. We need to keep a reference to the currently active memory instance to perform exclusive read/write operations.
Diffstat (limited to 'src/core/hle/kernel/mutex.cpp')
-rw-r--r--src/core/hle/kernel/mutex.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp
index 88eede436..061e9bcb0 100644
--- a/src/core/hle/kernel/mutex.cpp
+++ b/src/core/hle/kernel/mutex.cpp
@@ -117,7 +117,7 @@ ResultCode Mutex::Release(VAddr address) {
117 117
118 // There are no more threads waiting for the mutex, release it completely. 118 // There are no more threads waiting for the mutex, release it completely.
119 if (thread == nullptr) { 119 if (thread == nullptr) {
120 Memory::Write32(address, 0); 120 system.Memory().Write32(address, 0);
121 return RESULT_SUCCESS; 121 return RESULT_SUCCESS;
122 } 122 }
123 123
@@ -132,7 +132,7 @@ ResultCode Mutex::Release(VAddr address) {
132 } 132 }
133 133
134 // Grant the mutex to the next waiting thread and resume it. 134 // Grant the mutex to the next waiting thread and resume it.
135 Memory::Write32(address, mutex_value); 135 system.Memory().Write32(address, mutex_value);
136 136
137 ASSERT(thread->GetStatus() == ThreadStatus::WaitMutex); 137 ASSERT(thread->GetStatus() == ThreadStatus::WaitMutex);
138 thread->ResumeFromWait(); 138 thread->ResumeFromWait();