diff options
| author | 2022-06-20 17:39:10 -0700 | |
|---|---|---|
| committer | 2022-06-25 16:23:23 -0700 | |
| commit | 48737a4bb2372d4564f369694df7c2ca5812bf25 (patch) | |
| tree | 132290c6188d3f977ef6d2afd4b5259f7e763888 | |
| parent | Merge pull request #8500 from liamwhite/poke (diff) | |
| download | yuzu-48737a4bb2372d4564f369694df7c2ca5812bf25.tar.gz yuzu-48737a4bb2372d4564f369694df7c2ca5812bf25.tar.xz yuzu-48737a4bb2372d4564f369694df7c2ca5812bf25.zip | |
Support InfoType_MesosphereCurrentProcess
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 2ff6d5fa6..0aa068f1d 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -692,6 +692,9 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle | |||
| 692 | // 6.0.0+ | 692 | // 6.0.0+ |
| 693 | TotalPhysicalMemoryAvailableWithoutSystemResource = 21, | 693 | TotalPhysicalMemoryAvailableWithoutSystemResource = 21, |
| 694 | TotalPhysicalMemoryUsedWithoutSystemResource = 22, | 694 | TotalPhysicalMemoryUsedWithoutSystemResource = 22, |
| 695 | |||
| 696 | // Homebrew only | ||
| 697 | MesosphereCurrentProcess = 65001, | ||
| 695 | }; | 698 | }; |
| 696 | 699 | ||
| 697 | const auto info_id_type = static_cast<GetInfoType>(info_id); | 700 | const auto info_id_type = static_cast<GetInfoType>(info_id); |
| @@ -914,6 +917,17 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle | |||
| 914 | *result = system.Kernel().CurrentScheduler()->GetIdleThread()->GetCpuTime(); | 917 | *result = system.Kernel().CurrentScheduler()->GetIdleThread()->GetCpuTime(); |
| 915 | return ResultSuccess; | 918 | return ResultSuccess; |
| 916 | } | 919 | } |
| 920 | case GetInfoType::MesosphereCurrentProcess: { | ||
| 921 | R_UNLESS(handle == InvalidHandle, ResultInvalidHandle); | ||
| 922 | R_UNLESS(info_sub_id == 0, ResultInvalidCombination); | ||
| 923 | |||
| 924 | KProcess* const current_process = system.Kernel().CurrentProcess(); | ||
| 925 | Handle process_handle{}; | ||
| 926 | R_TRY(current_process->GetHandleTable().Add(&process_handle, current_process)); | ||
| 927 | |||
| 928 | *result = process_handle; | ||
| 929 | return ResultSuccess; | ||
| 930 | } | ||
| 917 | default: | 931 | default: |
| 918 | LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id); | 932 | LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id); |
| 919 | return ResultInvalidEnumValue; | 933 | return ResultInvalidEnumValue; |