diff options
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index e406df829..d9d919e18 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -1092,6 +1092,29 @@ static ResultCode ClearEvent(Handle handle) { | |||
| 1092 | return RESULT_SUCCESS; | 1092 | return RESULT_SUCCESS; |
| 1093 | } | 1093 | } |
| 1094 | 1094 | ||
| 1095 | static ResultCode GetProcessInfo(u64* out, Handle process_handle, u32 type) { | ||
| 1096 | LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, type=0x{:X}", process_handle, type); | ||
| 1097 | |||
| 1098 | // This function currently only allows retrieving a process' status. | ||
| 1099 | enum class InfoType { | ||
| 1100 | Status, | ||
| 1101 | }; | ||
| 1102 | |||
| 1103 | const auto& kernel = Core::System::GetInstance().Kernel(); | ||
| 1104 | const auto process = kernel.HandleTable().Get<Process>(process_handle); | ||
| 1105 | if (!process) { | ||
| 1106 | return ERR_INVALID_HANDLE; | ||
| 1107 | } | ||
| 1108 | |||
| 1109 | const auto info_type = static_cast<InfoType>(type); | ||
| 1110 | if (info_type != InfoType::Status) { | ||
| 1111 | return ERR_INVALID_ENUM_VALUE; | ||
| 1112 | } | ||
| 1113 | |||
| 1114 | *out = static_cast<u64>(process->GetStatus()); | ||
| 1115 | return RESULT_SUCCESS; | ||
| 1116 | } | ||
| 1117 | |||
| 1095 | namespace { | 1118 | namespace { |
| 1096 | struct FunctionDef { | 1119 | struct FunctionDef { |
| 1097 | using Func = void(); | 1120 | using Func = void(); |
| @@ -1227,7 +1250,7 @@ static const FunctionDef SVC_Table[] = { | |||
| 1227 | {0x79, nullptr, "CreateProcess"}, | 1250 | {0x79, nullptr, "CreateProcess"}, |
| 1228 | {0x7A, nullptr, "StartProcess"}, | 1251 | {0x7A, nullptr, "StartProcess"}, |
| 1229 | {0x7B, nullptr, "TerminateProcess"}, | 1252 | {0x7B, nullptr, "TerminateProcess"}, |
| 1230 | {0x7C, nullptr, "GetProcessInfo"}, | 1253 | {0x7C, SvcWrap<GetProcessInfo>, "GetProcessInfo"}, |
| 1231 | {0x7D, nullptr, "CreateResourceLimit"}, | 1254 | {0x7D, nullptr, "CreateResourceLimit"}, |
| 1232 | {0x7E, nullptr, "SetResourceLimitLimitValue"}, | 1255 | {0x7E, nullptr, "SetResourceLimitLimitValue"}, |
| 1233 | {0x7F, nullptr, "CallSecureMonitor"}, | 1256 | {0x7F, nullptr, "CallSecureMonitor"}, |