diff options
| author | 2020-02-25 19:43:28 -0400 | |
|---|---|---|
| committer | 2020-06-27 11:35:14 -0400 | |
| commit | 15a79eb0d7abe752a9a55d0cfa7ea220e17318b7 (patch) | |
| tree | 863357ab4be1ff9a72804c40455d6a4c4c493acd /src/core/hle/kernel/svc.cpp | |
| parent | SVC: Correct ArbitrateUnlock (diff) | |
| download | yuzu-15a79eb0d7abe752a9a55d0cfa7ea220e17318b7.tar.gz yuzu-15a79eb0d7abe752a9a55d0cfa7ea220e17318b7.tar.xz yuzu-15a79eb0d7abe752a9a55d0cfa7ea220e17318b7.zip | |
SVC: Correct SendSyncRequest.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 0d905c0ca..768d72b92 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #include "core/hle/kernel/svc_wrap.h" | 38 | #include "core/hle/kernel/svc_wrap.h" |
| 39 | #include "core/hle/kernel/synchronization.h" | 39 | #include "core/hle/kernel/synchronization.h" |
| 40 | #include "core/hle/kernel/thread.h" | 40 | #include "core/hle/kernel/thread.h" |
| 41 | #include "core/hle/kernel/time_manager.h" | ||
| 41 | #include "core/hle/kernel/transfer_memory.h" | 42 | #include "core/hle/kernel/transfer_memory.h" |
| 42 | #include "core/hle/kernel/writable_event.h" | 43 | #include "core/hle/kernel/writable_event.h" |
| 43 | #include "core/hle/lock.h" | 44 | #include "core/hle/lock.h" |
| @@ -318,11 +319,23 @@ static ResultCode SendSyncRequest(Core::System& system, Handle handle) { | |||
| 318 | LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({})", handle, session->GetName()); | 319 | LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({})", handle, session->GetName()); |
| 319 | 320 | ||
| 320 | auto thread = system.CurrentScheduler().GetCurrentThread(); | 321 | auto thread = system.CurrentScheduler().GetCurrentThread(); |
| 321 | thread->InvalidateWakeupCallback(); | 322 | { |
| 322 | thread->SetStatus(ThreadStatus::WaitIPC); | 323 | SchedulerLock lock(system.Kernel()); |
| 323 | system.PrepareReschedule(thread->GetProcessorID()); | 324 | thread->InvalidateHLECallback(); |
| 325 | thread->SetStatus(ThreadStatus::WaitIPC); | ||
| 326 | session->SendSyncRequest(SharedFrom(thread), system.Memory()); | ||
| 327 | } | ||
| 328 | ResultCode result = thread->GetSignalingResult(); | ||
| 329 | if (thread->HasHLECallback()) { | ||
| 330 | Handle event_handle = thread->GetHLETimeEvent(); | ||
| 331 | if (event_handle != InvalidHandle) { | ||
| 332 | auto& time_manager = system.Kernel().TimeManager(); | ||
| 333 | time_manager.UnscheduleTimeEvent(event_handle); | ||
| 334 | } | ||
| 335 | thread->InvokeHLECallback(ThreadWakeupReason::Timeout, SharedFrom(thread), nullptr, 0); | ||
| 336 | } | ||
| 324 | 337 | ||
| 325 | return session->SendSyncRequest(SharedFrom(thread), system.Memory()); | 338 | return result; |
| 326 | } | 339 | } |
| 327 | 340 | ||
| 328 | static ResultCode SendSyncRequest32(Core::System& system, Handle handle) { | 341 | static ResultCode SendSyncRequest32(Core::System& system, Handle handle) { |