diff options
| author | 2015-04-06 21:58:05 -0400 | |
|---|---|---|
| committer | 2015-04-09 19:06:42 -0400 | |
| commit | c077bcefa9e72078ab9df798f41376c0b91abd15 (patch) | |
| tree | 9afdf79102644efc26bbaec762aaee72ebcdfb1f /src/core/hle/svc.cpp | |
| 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 'src/core/hle/svc.cpp')
| -rw-r--r-- | src/core/hle/svc.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
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 | ||