diff options
| author | 2021-10-16 11:54:09 +0200 | |
|---|---|---|
| committer | 2021-10-16 20:33:44 +0200 | |
| commit | da6673e79acf26d728d347edc15c123d6c96a42f (patch) | |
| tree | c2fd1dc9f2673bd7e279434f79fea2cdc5a64f70 /src/core/hle/kernel/svc.cpp | |
| parent | Merge pull request #7190 from Morph1984/missing-ui-main (diff) | |
| download | yuzu-da6673e79acf26d728d347edc15c123d6c96a42f.tar.gz yuzu-da6673e79acf26d728d347edc15c123d6c96a42f.tar.xz yuzu-da6673e79acf26d728d347edc15c123d6c96a42f.zip | |
SVC: Implement svcInfo:IdleTickCount
Used by the Witcher 3
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index f98f24a60..7f38ade1c 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -886,7 +886,24 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle | |||
| 886 | *result = out_ticks; | 886 | *result = out_ticks; |
| 887 | return ResultSuccess; | 887 | return ResultSuccess; |
| 888 | } | 888 | } |
| 889 | case GetInfoType::IdleTickCount: { | ||
| 890 | if (handle == 0) { | ||
| 891 | LOG_ERROR(Kernel_SVC, "Thread handle does not exist, handle=0x{:08X}", | ||
| 892 | static_cast<Handle>(handle)); | ||
| 893 | return ResultInvalidHandle; | ||
| 894 | } | ||
| 889 | 895 | ||
| 896 | if (info_sub_id != 0xFFFFFFFFFFFFFFFF && info_sub_id != system.CurrentCoreIndex()) { | ||
| 897 | LOG_ERROR(Kernel_SVC, "Core is not the current core, got {}", info_sub_id); | ||
| 898 | return ResultInvalidCombination; | ||
| 899 | } | ||
| 900 | |||
| 901 | const auto& scheduler = *system.Kernel().CurrentScheduler(); | ||
| 902 | const auto* const idle_thread = scheduler.GetIdleThread(); | ||
| 903 | |||
| 904 | *result = idle_thread->GetCpuTime(); | ||
| 905 | return ResultSuccess; | ||
| 906 | } | ||
| 890 | default: | 907 | default: |
| 891 | LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id); | 908 | LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id); |
| 892 | return ResultInvalidEnumValue; | 909 | return ResultInvalidEnumValue; |