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