diff options
| author | 2019-03-05 11:54:06 -0500 | |
|---|---|---|
| committer | 2019-03-05 12:58:26 -0500 | |
| commit | ec6664f6d61f46569a2686b864ba3e9a0f85fc60 (patch) | |
| tree | 67a78607f085efd3e4258fd90afd2aa2036d0448 /src/core/hle/kernel/svc.cpp | |
| parent | Merge pull request #2185 from FearlessTobi/port-4630 (diff) | |
| download | yuzu-ec6664f6d61f46569a2686b864ba3e9a0f85fc60.tar.gz yuzu-ec6664f6d61f46569a2686b864ba3e9a0f85fc60.tar.xz yuzu-ec6664f6d61f46569a2686b864ba3e9a0f85fc60.zip | |
kernel/address_arbiter: Convert the address arbiter into a class
Places all of the functions for address arbiter operation into a class.
This will be necessary for future deglobalizing efforts related to both
the memory and system itself.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index c5d399bab..b7546087e 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -1495,13 +1495,14 @@ static ResultCode WaitForAddress(VAddr address, u32 type, s32 value, s64 timeout | |||
| 1495 | return ERR_INVALID_ADDRESS; | 1495 | return ERR_INVALID_ADDRESS; |
| 1496 | } | 1496 | } |
| 1497 | 1497 | ||
| 1498 | auto& address_arbiter = Core::System::GetInstance().Kernel().AddressArbiter(); | ||
| 1498 | switch (static_cast<AddressArbiter::ArbitrationType>(type)) { | 1499 | switch (static_cast<AddressArbiter::ArbitrationType>(type)) { |
| 1499 | case AddressArbiter::ArbitrationType::WaitIfLessThan: | 1500 | case AddressArbiter::ArbitrationType::WaitIfLessThan: |
| 1500 | return AddressArbiter::WaitForAddressIfLessThan(address, value, timeout, false); | 1501 | return address_arbiter.WaitForAddressIfLessThan(address, value, timeout, false); |
| 1501 | case AddressArbiter::ArbitrationType::DecrementAndWaitIfLessThan: | 1502 | case AddressArbiter::ArbitrationType::DecrementAndWaitIfLessThan: |
| 1502 | return AddressArbiter::WaitForAddressIfLessThan(address, value, timeout, true); | 1503 | return address_arbiter.WaitForAddressIfLessThan(address, value, timeout, true); |
| 1503 | case AddressArbiter::ArbitrationType::WaitIfEqual: | 1504 | case AddressArbiter::ArbitrationType::WaitIfEqual: |
| 1504 | return AddressArbiter::WaitForAddressIfEqual(address, value, timeout); | 1505 | return address_arbiter.WaitForAddressIfEqual(address, value, timeout); |
| 1505 | default: | 1506 | default: |
| 1506 | LOG_ERROR(Kernel_SVC, | 1507 | LOG_ERROR(Kernel_SVC, |
| 1507 | "Invalid arbitration type, expected WaitIfLessThan, DecrementAndWaitIfLessThan " | 1508 | "Invalid arbitration type, expected WaitIfLessThan, DecrementAndWaitIfLessThan " |
| @@ -1526,13 +1527,14 @@ static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to | |||
| 1526 | return ERR_INVALID_ADDRESS; | 1527 | return ERR_INVALID_ADDRESS; |
| 1527 | } | 1528 | } |
| 1528 | 1529 | ||
| 1530 | auto& address_arbiter = Core::System::GetInstance().Kernel().AddressArbiter(); | ||
| 1529 | switch (static_cast<AddressArbiter::SignalType>(type)) { | 1531 | switch (static_cast<AddressArbiter::SignalType>(type)) { |
| 1530 | case AddressArbiter::SignalType::Signal: | 1532 | case AddressArbiter::SignalType::Signal: |
| 1531 | return AddressArbiter::SignalToAddress(address, num_to_wake); | 1533 | return address_arbiter.SignalToAddress(address, num_to_wake); |
| 1532 | case AddressArbiter::SignalType::IncrementAndSignalIfEqual: | 1534 | case AddressArbiter::SignalType::IncrementAndSignalIfEqual: |
| 1533 | return AddressArbiter::IncrementAndSignalToAddressIfEqual(address, value, num_to_wake); | 1535 | return address_arbiter.IncrementAndSignalToAddressIfEqual(address, value, num_to_wake); |
| 1534 | case AddressArbiter::SignalType::ModifyByWaitingCountAndSignalIfEqual: | 1536 | case AddressArbiter::SignalType::ModifyByWaitingCountAndSignalIfEqual: |
| 1535 | return AddressArbiter::ModifyByWaitingCountAndSignalToAddressIfEqual(address, value, | 1537 | return address_arbiter.ModifyByWaitingCountAndSignalToAddressIfEqual(address, value, |
| 1536 | num_to_wake); | 1538 | num_to_wake); |
| 1537 | default: | 1539 | default: |
| 1538 | LOG_ERROR(Kernel_SVC, | 1540 | LOG_ERROR(Kernel_SVC, |