summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2021-02-04 03:45:52 +0100
committerLioncash <mathew1800@gmail.com>2021-02-06 10:06:33 +0100
commit7b9c58880fb70baf4507e53ca6d36e2865519ced (patch)
treed05bdcc3cc40fa76e7a38f28f5439ff3f59c5453 /src/core/hle
parentMerge pull request #5862 from bunnei/kevent (diff)
downloadyuzu-7b9c58880fb70baf4507e53ca6d36e2865519ced.tar
yuzu-7b9c58880fb70baf4507e53ca6d36e2865519ced.tar.gz
yuzu-7b9c58880fb70baf4507e53ca6d36e2865519ced.tar.bz2
yuzu-7b9c58880fb70baf4507e53ca6d36e2865519ced.tar.lz
yuzu-7b9c58880fb70baf4507e53ca6d36e2865519ced.tar.xz
yuzu-7b9c58880fb70baf4507e53ca6d36e2865519ced.tar.zst
yuzu-7b9c58880fb70baf4507e53ca6d36e2865519ced.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/kernel/k_address_arbiter.cpp53
1 files changed, 13 insertions, 40 deletions
diff --git a/src/core/hle/kernel/k_address_arbiter.cpp b/src/core/hle/kernel/k_address_arbiter.cpp
index f2f497dc4..02c629a3d 100644
--- a/src/core/hle/kernel/k_address_arbiter.cpp
+++ b/src/core/hle/kernel/k_address_arbiter.cpp
@@ -146,61 +146,34 @@ ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32
// Perform signaling.
s32 num_waiters{};
{
- KScopedSchedulerLock sl(kernel);
+ [[maybe_unused]] const KScopedSchedulerLock sl(kernel);
auto it = thread_tree.nfind_light({addr, -1});
// Determine the updated value.
s32 new_value{};
- if (/*GetTargetFirmware() >= TargetFirmware_7_0_0*/ true) {
- if (count <= 0) {
- if ((it != thread_tree.end()) && (it->GetAddressArbiterKey() == addr)) {
- new_value = value - 2;
- } else {
- new_value = value + 1;
- }
+ if (count <= 0) {
+ if (it != thread_tree.end() && it->GetAddressArbiterKey() == addr) {
+ new_value = value - 2;
} else {
- if ((it != thread_tree.end()) && (it->GetAddressArbiterKey() == addr)) {
- auto tmp_it = it;
- s32 tmp_num_waiters{};
- while ((++tmp_it != thread_tree.end()) &&
- (tmp_it->GetAddressArbiterKey() == addr)) {
- if ((tmp_num_waiters++) >= count) {
- break;
- }
- }
-
- if (tmp_num_waiters < count) {
- new_value = value - 1;
- } else {
- new_value = value;
- }
- } else {
- new_value = value + 1;
- }
+ new_value = value + 1;
}
} else {
- if (count <= 0) {
- if ((it != thread_tree.end()) && (it->GetAddressArbiterKey() == addr)) {
- new_value = value - 1;
- } else {
- new_value = value + 1;
- }
- } else {
+ if (it != thread_tree.end() && it->GetAddressArbiterKey() == addr) {
auto tmp_it = it;
s32 tmp_num_waiters{};
- while ((tmp_it != thread_tree.end()) && (tmp_it->GetAddressArbiterKey() == addr) &&
- (tmp_num_waiters < count + 1)) {
- ++tmp_num_waiters;
- ++tmp_it;
+ while (++tmp_it != thread_tree.end() && tmp_it->GetAddressArbiterKey() == addr) {
+ if (tmp_num_waiters++ >= count) {
+ break;
+ }
}
- if (tmp_num_waiters == 0) {
- new_value = value + 1;
- } else if (tmp_num_waiters <= count) {
+ if (tmp_num_waiters < count) {
new_value = value - 1;
} else {
new_value = value;
}
+ } else {
+ new_value = value + 1;
}
}