diff options
| author | 2015-04-06 21:58:05 -0400 | |
|---|---|---|
| committer | 2015-04-09 19:06:42 -0400 | |
| commit | c077bcefa9e72078ab9df798f41376c0b91abd15 (patch) | |
| tree | 9afdf79102644efc26bbaec762aaee72ebcdfb1f /src | |
| parent | Kernel: Implemented priority inheritance for mutexes. (diff) | |
| download | yuzu-c077bcefa9e72078ab9df798f41376c0b91abd15.tar.gz yuzu-c077bcefa9e72078ab9df798f41376c0b91abd15.tar.xz yuzu-c077bcefa9e72078ab9df798f41376c0b91abd15.zip | |
SVC: Update various SVCs to cause a reschedule.
- CreateMutex/ReleaseMutex/ReleaseSemaphore/SetTimer/CancelTimer/ArbitrateAddress
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/kernel/address_arbiter.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/svc.cpp | 24 |
2 files changed, 22 insertions, 6 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 42f8ce2d9..19135266c 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp | |||
| @@ -46,14 +46,12 @@ ResultCode AddressArbiter::ArbitrateAddress(ArbitrationType type, VAddr address, | |||
| 46 | case ArbitrationType::WaitIfLessThan: | 46 | case ArbitrationType::WaitIfLessThan: |
| 47 | if ((s32)Memory::Read32(address) <= value) { | 47 | if ((s32)Memory::Read32(address) <= value) { |
| 48 | Kernel::WaitCurrentThread_ArbitrateAddress(address); | 48 | Kernel::WaitCurrentThread_ArbitrateAddress(address); |
| 49 | HLE::Reschedule(__func__); | ||
| 50 | } | 49 | } |
| 51 | break; | 50 | break; |
| 52 | case ArbitrationType::WaitIfLessThanWithTimeout: | 51 | case ArbitrationType::WaitIfLessThanWithTimeout: |
| 53 | if ((s32)Memory::Read32(address) <= value) { | 52 | if ((s32)Memory::Read32(address) <= value) { |
| 54 | Kernel::WaitCurrentThread_ArbitrateAddress(address); | 53 | Kernel::WaitCurrentThread_ArbitrateAddress(address); |
| 55 | GetCurrentThread()->WakeAfterDelay(nanoseconds); | 54 | GetCurrentThread()->WakeAfterDelay(nanoseconds); |
| 56 | HLE::Reschedule(__func__); | ||
| 57 | } | 55 | } |
| 58 | break; | 56 | break; |
| 59 | case ArbitrationType::DecrementAndWaitIfLessThan: | 57 | case ArbitrationType::DecrementAndWaitIfLessThan: |
| @@ -62,7 +60,6 @@ ResultCode AddressArbiter::ArbitrateAddress(ArbitrationType type, VAddr address, | |||
| 62 | Memory::Write32(address, memory_value); | 60 | Memory::Write32(address, memory_value); |
| 63 | if (memory_value <= value) { | 61 | if (memory_value <= value) { |
| 64 | Kernel::WaitCurrentThread_ArbitrateAddress(address); | 62 | Kernel::WaitCurrentThread_ArbitrateAddress(address); |
| 65 | HLE::Reschedule(__func__); | ||
| 66 | } | 63 | } |
| 67 | break; | 64 | break; |
| 68 | } | 65 | } |
| @@ -73,7 +70,6 @@ ResultCode AddressArbiter::ArbitrateAddress(ArbitrationType type, VAddr address, | |||
| 73 | if (memory_value <= value) { | 70 | if (memory_value <= value) { |
| 74 | Kernel::WaitCurrentThread_ArbitrateAddress(address); | 71 | Kernel::WaitCurrentThread_ArbitrateAddress(address); |
| 75 | GetCurrentThread()->WakeAfterDelay(nanoseconds); | 72 | GetCurrentThread()->WakeAfterDelay(nanoseconds); |
| 76 | HLE::Reschedule(__func__); | ||
| 77 | } | 73 | } |
| 78 | break; | 74 | break; |
| 79 | } | 75 | } |
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 82e187466..43b7e5cbf 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp | |||
| @@ -283,8 +283,13 @@ static ResultCode ArbitrateAddress(Handle handle, u32 address, u32 type, u32 val | |||
| 283 | if (arbiter == nullptr) | 283 | if (arbiter == nullptr) |
| 284 | return ERR_INVALID_HANDLE; | 284 | return ERR_INVALID_HANDLE; |
| 285 | 285 | ||
| 286 | return arbiter->ArbitrateAddress(static_cast<Kernel::ArbitrationType>(type), | 286 | auto res = arbiter->ArbitrateAddress(static_cast<Kernel::ArbitrationType>(type), |
| 287 | address, value, nanoseconds); | 287 | address, value, nanoseconds); |
| 288 | |||
| 289 | if (res == RESULT_SUCCESS) | ||
| 290 | HLE::Reschedule(__func__); | ||
| 291 | |||
| 292 | return res; | ||
| 288 | } | 293 | } |
| 289 | 294 | ||
| 290 | /// Used to output a message on a debug hardware unit - does nothing on a retail unit | 295 | /// Used to output a message on a debug hardware unit - does nothing on a retail unit |
| @@ -386,8 +391,11 @@ static ResultCode CreateMutex(Handle* out_handle, u32 initial_locked) { | |||
| 386 | SharedPtr<Mutex> mutex = Mutex::Create(initial_locked != 0); | 391 | SharedPtr<Mutex> mutex = Mutex::Create(initial_locked != 0); |
| 387 | CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(mutex))); | 392 | CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(mutex))); |
| 388 | 393 | ||
| 394 | HLE::Reschedule(__func__); | ||
| 395 | |||
| 389 | LOG_TRACE(Kernel_SVC, "called initial_locked=%s : created handle=0x%08X", | 396 | LOG_TRACE(Kernel_SVC, "called initial_locked=%s : created handle=0x%08X", |
| 390 | initial_locked ? "true" : "false", *out_handle); | 397 | initial_locked ? "true" : "false", *out_handle); |
| 398 | |||
| 391 | return RESULT_SUCCESS; | 399 | return RESULT_SUCCESS; |
| 392 | } | 400 | } |
| 393 | 401 | ||
| @@ -402,6 +410,9 @@ static ResultCode ReleaseMutex(Handle handle) { | |||
| 402 | return ERR_INVALID_HANDLE; | 410 | return ERR_INVALID_HANDLE; |
| 403 | 411 | ||
| 404 | mutex->Release(); | 412 | mutex->Release(); |
| 413 | |||
| 414 | HLE::Reschedule(__func__); | ||
| 415 | |||
| 405 | return RESULT_SUCCESS; | 416 | return RESULT_SUCCESS; |
| 406 | } | 417 | } |
| 407 | 418 | ||
| @@ -440,6 +451,9 @@ static ResultCode ReleaseSemaphore(s32* count, Handle handle, s32 release_count) | |||
| 440 | return ERR_INVALID_HANDLE; | 451 | return ERR_INVALID_HANDLE; |
| 441 | 452 | ||
| 442 | CASCADE_RESULT(*count, semaphore->Release(release_count)); | 453 | CASCADE_RESULT(*count, semaphore->Release(release_count)); |
| 454 | |||
| 455 | HLE::Reschedule(__func__); | ||
| 456 | |||
| 443 | return RESULT_SUCCESS; | 457 | return RESULT_SUCCESS; |
| 444 | } | 458 | } |
| 445 | 459 | ||
| @@ -532,6 +546,9 @@ static ResultCode SetTimer(Handle handle, s64 initial, s64 interval) { | |||
| 532 | return ERR_INVALID_HANDLE; | 546 | return ERR_INVALID_HANDLE; |
| 533 | 547 | ||
| 534 | timer->Set(initial, interval); | 548 | timer->Set(initial, interval); |
| 549 | |||
| 550 | HLE::Reschedule(__func__); | ||
| 551 | |||
| 535 | return RESULT_SUCCESS; | 552 | return RESULT_SUCCESS; |
| 536 | } | 553 | } |
| 537 | 554 | ||
| @@ -546,6 +563,9 @@ static ResultCode CancelTimer(Handle handle) { | |||
| 546 | return ERR_INVALID_HANDLE; | 563 | return ERR_INVALID_HANDLE; |
| 547 | 564 | ||
| 548 | timer->Cancel(); | 565 | timer->Cancel(); |
| 566 | |||
| 567 | HLE::Reschedule(__func__); | ||
| 568 | |||
| 549 | return RESULT_SUCCESS; | 569 | return RESULT_SUCCESS; |
| 550 | } | 570 | } |
| 551 | 571 | ||