diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/kernel/client_session.cpp | 5 | ||||
| -rw-r--r-- | src/core/hle/kernel/client_session.h | 7 | ||||
| -rw-r--r-- | src/core/hle/kernel/server_session.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/kernel/server_session.h | 11 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 2 |
5 files changed, 20 insertions, 11 deletions
diff --git a/src/core/hle/kernel/client_session.cpp b/src/core/hle/kernel/client_session.cpp index 5ab204b9b..be9eba519 100644 --- a/src/core/hle/kernel/client_session.cpp +++ b/src/core/hle/kernel/client_session.cpp | |||
| @@ -48,14 +48,15 @@ ResultVal<std::shared_ptr<ClientSession>> ClientSession::Create(KernelCore& kern | |||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | ResultCode ClientSession::SendSyncRequest(std::shared_ptr<Thread> thread, | 50 | ResultCode ClientSession::SendSyncRequest(std::shared_ptr<Thread> thread, |
| 51 | Core::Memory::Memory& memory) { | 51 | Core::Memory::Memory& memory, |
| 52 | Core::Timing::CoreTiming& core_timing) { | ||
| 52 | // Keep ServerSession alive until we're done working with it. | 53 | // Keep ServerSession alive until we're done working with it. |
| 53 | if (!parent->Server()) { | 54 | if (!parent->Server()) { |
| 54 | return ERR_SESSION_CLOSED_BY_REMOTE; | 55 | return ERR_SESSION_CLOSED_BY_REMOTE; |
| 55 | } | 56 | } |
| 56 | 57 | ||
| 57 | // Signal the server session that new data is available | 58 | // Signal the server session that new data is available |
| 58 | return parent->Server()->HandleSyncRequest(std::move(thread), memory); | 59 | return parent->Server()->HandleSyncRequest(std::move(thread), memory, core_timing); |
| 59 | } | 60 | } |
| 60 | 61 | ||
| 61 | } // namespace Kernel | 62 | } // namespace Kernel |
diff --git a/src/core/hle/kernel/client_session.h b/src/core/hle/kernel/client_session.h index c5f760d7d..e5e0690c2 100644 --- a/src/core/hle/kernel/client_session.h +++ b/src/core/hle/kernel/client_session.h | |||
| @@ -16,6 +16,10 @@ namespace Core::Memory { | |||
| 16 | class Memory; | 16 | class Memory; |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | namespace Core::Timing { | ||
| 20 | class CoreTiming; | ||
| 21 | } | ||
| 22 | |||
| 19 | namespace Kernel { | 23 | namespace Kernel { |
| 20 | 24 | ||
| 21 | class KernelCore; | 25 | class KernelCore; |
| @@ -42,7 +46,8 @@ public: | |||
| 42 | return HANDLE_TYPE; | 46 | return HANDLE_TYPE; |
| 43 | } | 47 | } |
| 44 | 48 | ||
| 45 | ResultCode SendSyncRequest(std::shared_ptr<Thread> thread, Core::Memory::Memory& memory); | 49 | ResultCode SendSyncRequest(std::shared_ptr<Thread> thread, Core::Memory::Memory& memory, |
| 50 | Core::Timing::CoreTiming& core_timing); | ||
| 46 | 51 | ||
| 47 | bool ShouldWait(const Thread* thread) const override; | 52 | bool ShouldWait(const Thread* thread) const override; |
| 48 | 53 | ||
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index 7e6391c6c..8c19f2534 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | #include "common/assert.h" | 8 | #include "common/assert.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/logging/log.h" | 10 | #include "common/logging/log.h" |
| 11 | #include "core/core.h" | ||
| 12 | #include "core/core_timing.h" | 11 | #include "core/core_timing.h" |
| 13 | #include "core/hle/ipc_helpers.h" | 12 | #include "core/hle/ipc_helpers.h" |
| 14 | #include "core/hle/kernel/client_port.h" | 13 | #include "core/hle/kernel/client_port.h" |
| @@ -185,10 +184,11 @@ ResultCode ServerSession::CompleteSyncRequest() { | |||
| 185 | } | 184 | } |
| 186 | 185 | ||
| 187 | ResultCode ServerSession::HandleSyncRequest(std::shared_ptr<Thread> thread, | 186 | ResultCode ServerSession::HandleSyncRequest(std::shared_ptr<Thread> thread, |
| 188 | Core::Memory::Memory& memory) { | 187 | Core::Memory::Memory& memory, |
| 188 | Core::Timing::CoreTiming& core_timing) { | ||
| 189 | const ResultCode result = QueueSyncRequest(std::move(thread), memory); | 189 | const ResultCode result = QueueSyncRequest(std::move(thread), memory); |
| 190 | const auto delay = std::chrono::nanoseconds{kernel.IsMulticore() ? 0 : 20000}; | 190 | const auto delay = std::chrono::nanoseconds{kernel.IsMulticore() ? 0 : 20000}; |
| 191 | Core::System::GetInstance().CoreTiming().ScheduleEvent(delay, request_event, {}); | 191 | core_timing.ScheduleEvent(delay, request_event, {}); |
| 192 | return result; | 192 | return result; |
| 193 | } | 193 | } |
| 194 | 194 | ||
diff --git a/src/core/hle/kernel/server_session.h b/src/core/hle/kernel/server_session.h index 403aaf10b..d23e9ec68 100644 --- a/src/core/hle/kernel/server_session.h +++ b/src/core/hle/kernel/server_session.h | |||
| @@ -18,8 +18,9 @@ class Memory; | |||
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | namespace Core::Timing { | 20 | namespace Core::Timing { |
| 21 | class CoreTiming; | ||
| 21 | struct EventType; | 22 | struct EventType; |
| 22 | } | 23 | } // namespace Core::Timing |
| 23 | 24 | ||
| 24 | namespace Kernel { | 25 | namespace Kernel { |
| 25 | 26 | ||
| @@ -87,12 +88,14 @@ public: | |||
| 87 | /** | 88 | /** |
| 88 | * Handle a sync request from the emulated application. | 89 | * Handle a sync request from the emulated application. |
| 89 | * | 90 | * |
| 90 | * @param thread Thread that initiated the request. | 91 | * @param thread Thread that initiated the request. |
| 91 | * @param memory Memory context to handle the sync request under. | 92 | * @param memory Memory context to handle the sync request under. |
| 93 | * @param core_timing Core timing context to schedule the request event under. | ||
| 92 | * | 94 | * |
| 93 | * @returns ResultCode from the operation. | 95 | * @returns ResultCode from the operation. |
| 94 | */ | 96 | */ |
| 95 | ResultCode HandleSyncRequest(std::shared_ptr<Thread> thread, Core::Memory::Memory& memory); | 97 | ResultCode HandleSyncRequest(std::shared_ptr<Thread> thread, Core::Memory::Memory& memory, |
| 98 | Core::Timing::CoreTiming& core_timing); | ||
| 96 | 99 | ||
| 97 | bool ShouldWait(const Thread* thread) const override; | 100 | bool ShouldWait(const Thread* thread) const override; |
| 98 | 101 | ||
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 01ae57053..bafd1ced7 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -346,7 +346,7 @@ static ResultCode SendSyncRequest(Core::System& system, Handle handle) { | |||
| 346 | SchedulerLock lock(system.Kernel()); | 346 | SchedulerLock lock(system.Kernel()); |
| 347 | thread->InvalidateHLECallback(); | 347 | thread->InvalidateHLECallback(); |
| 348 | thread->SetStatus(ThreadStatus::WaitIPC); | 348 | thread->SetStatus(ThreadStatus::WaitIPC); |
| 349 | session->SendSyncRequest(SharedFrom(thread), system.Memory()); | 349 | session->SendSyncRequest(SharedFrom(thread), system.Memory(), system.CoreTiming()); |
| 350 | } | 350 | } |
| 351 | 351 | ||
| 352 | if (thread->HasHLECallback()) { | 352 | if (thread->HasHLECallback()) { |