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 198865fd0..7a053da1e 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -1098,6 +1098,29 @@ static ResultCode ClearEvent(Handle handle) { | |||
| 1098 | return RESULT_SUCCESS; | 1098 | return RESULT_SUCCESS; |
| 1099 | } | 1099 | } |
| 1100 | 1100 | ||
| 1101 | static ResultCode GetProcessInfo(u64* out, Handle process_handle, u32 type) { | ||
| 1102 | LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, type=0x{:X}", process_handle, type); | ||
| 1103 | |||
| 1104 | // This function currently only allows retrieving a process' status. | ||
| 1105 | enum class InfoType { | ||
| 1106 | Status, | ||
| 1107 | }; | ||
| 1108 | |||
| 1109 | const auto& kernel = Core::System::GetInstance().Kernel(); | ||
| 1110 | const auto process = kernel.HandleTable().Get<Process>(process_handle); | ||
| 1111 | if (!process) { | ||
| 1112 | return ERR_INVALID_HANDLE; | ||
| 1113 | } | ||
| 1114 | |||
| 1115 | const auto info_type = static_cast<InfoType>(type); | ||
| 1116 | if (info_type != InfoType::Status) { | ||
| 1117 | return ERR_INVALID_ENUM_VALUE; | ||
| 1118 | } | ||
| 1119 | |||
| 1120 | *out = static_cast<u64>(process->GetStatus()); | ||
| 1121 | return RESULT_SUCCESS; | ||
| 1122 | } | ||
| 1123 | |||
| 1101 | namespace { | 1124 | namespace { |
| 1102 | struct FunctionDef { | 1125 | struct FunctionDef { |
| 1103 | using Func = void(); | 1126 | using Func = void(); |
| @@ -1233,7 +1256,7 @@ static const FunctionDef SVC_Table[] = { | |||
| 1233 | {0x79, nullptr, "CreateProcess"}, | 1256 | {0x79, nullptr, "CreateProcess"}, |
| 1234 | {0x7A, nullptr, "StartProcess"}, | 1257 | {0x7A, nullptr, "StartProcess"}, |
| 1235 | {0x7B, nullptr, "TerminateProcess"}, | 1258 | {0x7B, nullptr, "TerminateProcess"}, |
| 1236 | {0x7C, nullptr, "GetProcessInfo"}, | 1259 | {0x7C, SvcWrap<GetProcessInfo>, "GetProcessInfo"}, |
| 1237 | {0x7D, nullptr, "CreateResourceLimit"}, | 1260 | {0x7D, nullptr, "CreateResourceLimit"}, |
| 1238 | {0x7E, nullptr, "SetResourceLimitLimitValue"}, | 1261 | {0x7E, nullptr, "SetResourceLimitLimitValue"}, |
| 1239 | {0x7F, nullptr, "CallSecureMonitor"}, | 1262 | {0x7F, nullptr, "CallSecureMonitor"}, |