summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2019-03-07 18:42:44 -0500
committerGravatar Lioncash2019-03-07 23:27:47 -0500
commitb7f331afa3db235db39eca041fef720873f3091a (patch)
treecf2a5f7a3744fb7ed2104bf166aa65433377f1c1 /src/core/hle/kernel/svc.cpp
parentkernel/svc: Move address arbiter waiting behind a unified API function (diff)
downloadyuzu-b7f331afa3db235db39eca041fef720873f3091a.tar.gz
yuzu-b7f331afa3db235db39eca041fef720873f3091a.tar.xz
yuzu-b7f331afa3db235db39eca041fef720873f3091a.zip
kernel/svc: Move address arbiter signaling behind a unified API function
Similar to how WaitForAddress was isolated to its own function, we can also move the necessary conditional checking into the address arbiter class itself, allowing us to hide the implementation details of it from public use.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 82ceb235c..d44def658 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -1499,22 +1499,9 @@ static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to
1499 return ERR_INVALID_ADDRESS; 1499 return ERR_INVALID_ADDRESS;
1500 } 1500 }
1501 1501
1502 const auto signal_type = static_cast<AddressArbiter::SignalType>(type);
1502 auto& address_arbiter = Core::System::GetInstance().Kernel().AddressArbiter(); 1503 auto& address_arbiter = Core::System::GetInstance().Kernel().AddressArbiter();
1503 switch (static_cast<AddressArbiter::SignalType>(type)) { 1504 return address_arbiter.SignalToAddress(address, signal_type, value, num_to_wake);
1504 case AddressArbiter::SignalType::Signal:
1505 return address_arbiter.SignalToAddress(address, num_to_wake);
1506 case AddressArbiter::SignalType::IncrementAndSignalIfEqual:
1507 return address_arbiter.IncrementAndSignalToAddressIfEqual(address, value, num_to_wake);
1508 case AddressArbiter::SignalType::ModifyByWaitingCountAndSignalIfEqual:
1509 return address_arbiter.ModifyByWaitingCountAndSignalToAddressIfEqual(address, value,
1510 num_to_wake);
1511 default:
1512 LOG_ERROR(Kernel_SVC,
1513 "Invalid signal type, expected Signal, IncrementAndSignalIfEqual "
1514 "or ModifyByWaitingCountAndSignalIfEqual but got {}",
1515 type);
1516 return ERR_INVALID_ENUM_VALUE;
1517 }
1518} 1505}
1519 1506
1520/// This returns the total CPU ticks elapsed since the CPU was powered-on 1507/// This returns the total CPU ticks elapsed since the CPU was powered-on