summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-03-15 15:54:40 -0400
committerGravatar Fernando Sahmkow2020-06-27 11:35:50 -0400
commit25565dffd588006aace7530486e71ff318dc5550 (patch)
treee30556e18f3dae60ea6cb8d32b84fbcc42860d24 /src/core/hle/kernel
parentCPU_Manager: Correct stopping on SingleCore. (diff)
downloadyuzu-25565dffd588006aace7530486e71ff318dc5550.tar.gz
yuzu-25565dffd588006aace7530486e71ff318dc5550.tar.xz
yuzu-25565dffd588006aace7530486e71ff318dc5550.zip
ARM: Addapt to new Exclusive Monitor Interface.
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/address_arbiter.cpp9
-rw-r--r--src/core/hle/kernel/svc.cpp4
2 files changed, 4 insertions, 9 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp
index e8f22b598..4d2a9b35d 100644
--- a/src/core/hle/kernel/address_arbiter.cpp
+++ b/src/core/hle/kernel/address_arbiter.cpp
@@ -80,8 +80,7 @@ ResultCode AddressArbiter::IncrementAndSignalToAddressIfEqual(VAddr address, s32
80 auto& monitor = system.Monitor(); 80 auto& monitor = system.Monitor();
81 u32 current_value; 81 u32 current_value;
82 do { 82 do {
83 monitor.SetExclusive32(current_core, address); 83 current_value = monitor.ExclusiveRead32(current_core, address);
84 current_value = memory.Read32(address);
85 84
86 if (current_value != value) { 85 if (current_value != value) {
87 return ERR_INVALID_STATE; 86 return ERR_INVALID_STATE;
@@ -110,8 +109,7 @@ ResultCode AddressArbiter::ModifyByWaitingCountAndSignalToAddressIfEqual(VAddr a
110 auto& monitor = system.Monitor(); 109 auto& monitor = system.Monitor();
111 s32 updated_value; 110 s32 updated_value;
112 do { 111 do {
113 monitor.SetExclusive32(current_core, address); 112 updated_value = monitor.ExclusiveRead32(current_core, address);
114 updated_value = memory.Read32(address);
115 113
116 if (updated_value != value) { 114 if (updated_value != value) {
117 return ERR_INVALID_STATE; 115 return ERR_INVALID_STATE;
@@ -186,8 +184,7 @@ ResultCode AddressArbiter::WaitForAddressIfLessThan(VAddr address, s32 value, s6
186 const std::size_t current_core = system.CurrentCoreIndex(); 184 const std::size_t current_core = system.CurrentCoreIndex();
187 auto& monitor = system.Monitor(); 185 auto& monitor = system.Monitor();
188 do { 186 do {
189 monitor.SetExclusive32(current_core, address); 187 current_value = static_cast<s32>(monitor.ExclusiveRead32(current_core, address));
190 current_value = static_cast<s32>(memory.Read32(address));
191 if (should_decrement) { 188 if (should_decrement) {
192 decrement_value = current_value - 1; 189 decrement_value = current_value - 1;
193 } else { 190 } else {
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 9b9f9402e..36e9c48f9 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -1653,10 +1653,8 @@ static void SignalProcessWideKey(Core::System& system, VAddr condition_variable_
1653 u32 update_val = 0; 1653 u32 update_val = 0;
1654 const VAddr mutex_address = thread->GetMutexWaitAddress(); 1654 const VAddr mutex_address = thread->GetMutexWaitAddress();
1655 do { 1655 do {
1656 monitor.SetExclusive32(current_core, mutex_address);
1657
1658 // If the mutex is not yet acquired, acquire it. 1656 // If the mutex is not yet acquired, acquire it.
1659 mutex_val = memory.Read32(mutex_address); 1657 mutex_val = monitor.ExclusiveRead32(current_core, mutex_address);
1660 1658
1661 if (mutex_val != 0) { 1659 if (mutex_val != 0) {
1662 update_val = mutex_val | Mutex::MutexHasWaitersFlag; 1660 update_val = mutex_val | Mutex::MutexHasWaitersFlag;