diff options
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 5f040f79f..c5d399bab 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -918,6 +918,7 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) | |||
| 918 | } | 918 | } |
| 919 | 919 | ||
| 920 | const auto& system = Core::System::GetInstance(); | 920 | const auto& system = Core::System::GetInstance(); |
| 921 | const auto& core_timing = system.CoreTiming(); | ||
| 921 | const auto& scheduler = system.CurrentScheduler(); | 922 | const auto& scheduler = system.CurrentScheduler(); |
| 922 | const auto* const current_thread = scheduler.GetCurrentThread(); | 923 | const auto* const current_thread = scheduler.GetCurrentThread(); |
| 923 | const bool same_thread = current_thread == thread; | 924 | const bool same_thread = current_thread == thread; |
| @@ -927,9 +928,9 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) | |||
| 927 | if (same_thread && info_sub_id == 0xFFFFFFFFFFFFFFFF) { | 928 | if (same_thread && info_sub_id == 0xFFFFFFFFFFFFFFFF) { |
| 928 | const u64 thread_ticks = current_thread->GetTotalCPUTimeTicks(); | 929 | const u64 thread_ticks = current_thread->GetTotalCPUTimeTicks(); |
| 929 | 930 | ||
| 930 | out_ticks = thread_ticks + (Core::Timing::GetTicks() - prev_ctx_ticks); | 931 | out_ticks = thread_ticks + (core_timing.GetTicks() - prev_ctx_ticks); |
| 931 | } else if (same_thread && info_sub_id == system.CurrentCoreIndex()) { | 932 | } else if (same_thread && info_sub_id == system.CurrentCoreIndex()) { |
| 932 | out_ticks = Core::Timing::GetTicks() - prev_ctx_ticks; | 933 | out_ticks = core_timing.GetTicks() - prev_ctx_ticks; |
| 933 | } | 934 | } |
| 934 | 935 | ||
| 935 | *result = out_ticks; | 936 | *result = out_ticks; |
| @@ -1546,10 +1547,11 @@ static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to | |||
| 1546 | static u64 GetSystemTick() { | 1547 | static u64 GetSystemTick() { |
| 1547 | LOG_TRACE(Kernel_SVC, "called"); | 1548 | LOG_TRACE(Kernel_SVC, "called"); |
| 1548 | 1549 | ||
| 1549 | const u64 result{Core::Timing::GetTicks()}; | 1550 | auto& core_timing = Core::System::GetInstance().CoreTiming(); |
| 1551 | const u64 result{core_timing.GetTicks()}; | ||
| 1550 | 1552 | ||
| 1551 | // Advance time to defeat dumb games that busy-wait for the frame to end. | 1553 | // Advance time to defeat dumb games that busy-wait for the frame to end. |
| 1552 | Core::Timing::AddTicks(400); | 1554 | core_timing.AddTicks(400); |
| 1553 | 1555 | ||
| 1554 | return result; | 1556 | return result; |
| 1555 | } | 1557 | } |