summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-10-14 14:37:58 -0400
committerGravatar GitHub2018-10-14 14:37:58 -0400
commit2f8ca32020d2b32abfcb96d433ca79c4974e15be (patch)
tree8a63f146f9b1a4f647900866f84142c08784611b /src/core/hle/kernel/svc.cpp
parentMerge pull request #1495 from ogniK5377/break-stop (diff)
parentsvc: Implement svcGetProcessInfo (diff)
downloadyuzu-2f8ca32020d2b32abfcb96d433ca79c4974e15be.tar.gz
yuzu-2f8ca32020d2b32abfcb96d433ca79c4974e15be.tar.xz
yuzu-2f8ca32020d2b32abfcb96d433ca79c4974e15be.zip
Merge pull request #1492 from lioncash/proc
svc: Implement svcGetProcessInfo
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp25
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
1101static 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
1101namespace { 1124namespace {
1102struct FunctionDef { 1125struct 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"},