diff options
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index e809c820f..8655506b0 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -689,6 +689,9 @@ static Result GetInfo(Core::System& system, u64* result, u64 info_id, Handle han | |||
| 689 | // 6.0.0+ | 689 | // 6.0.0+ |
| 690 | TotalPhysicalMemoryAvailableWithoutSystemResource = 21, | 690 | TotalPhysicalMemoryAvailableWithoutSystemResource = 21, |
| 691 | TotalPhysicalMemoryUsedWithoutSystemResource = 22, | 691 | TotalPhysicalMemoryUsedWithoutSystemResource = 22, |
| 692 | |||
| 693 | // Homebrew only | ||
| 694 | MesosphereCurrentProcess = 65001, | ||
| 692 | }; | 695 | }; |
| 693 | 696 | ||
| 694 | const auto info_id_type = static_cast<GetInfoType>(info_id); | 697 | const auto info_id_type = static_cast<GetInfoType>(info_id); |
| @@ -911,6 +914,27 @@ static Result GetInfo(Core::System& system, u64* result, u64 info_id, Handle han | |||
| 911 | *result = system.Kernel().CurrentScheduler()->GetIdleThread()->GetCpuTime(); | 914 | *result = system.Kernel().CurrentScheduler()->GetIdleThread()->GetCpuTime(); |
| 912 | return ResultSuccess; | 915 | return ResultSuccess; |
| 913 | } | 916 | } |
| 917 | case GetInfoType::MesosphereCurrentProcess: { | ||
| 918 | // Verify the input handle is invalid. | ||
| 919 | R_UNLESS(handle == InvalidHandle, ResultInvalidHandle); | ||
| 920 | |||
| 921 | // Verify the sub-type is valid. | ||
| 922 | R_UNLESS(info_sub_id == 0, ResultInvalidCombination); | ||
| 923 | |||
| 924 | // Get the handle table. | ||
| 925 | KProcess* current_process = system.Kernel().CurrentProcess(); | ||
| 926 | KHandleTable& handle_table = current_process->GetHandleTable(); | ||
| 927 | |||
| 928 | // Get a new handle for the current process. | ||
| 929 | Handle tmp; | ||
| 930 | R_TRY(handle_table.Add(&tmp, current_process)); | ||
| 931 | |||
| 932 | // Set the output. | ||
| 933 | *result = tmp; | ||
| 934 | |||
| 935 | // We succeeded. | ||
| 936 | return ResultSuccess; | ||
| 937 | } | ||
| 914 | default: | 938 | default: |
| 915 | LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id); | 939 | LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id); |
| 916 | return ResultInvalidEnumValue; | 940 | return ResultInvalidEnumValue; |