diff options
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index f287f7c97..4b7991c32 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -1346,6 +1346,24 @@ static ResultCode GetProcessInfo(u64* out, Handle process_handle, u32 type) { | |||
| 1346 | return RESULT_SUCCESS; | 1346 | return RESULT_SUCCESS; |
| 1347 | } | 1347 | } |
| 1348 | 1348 | ||
| 1349 | static ResultCode CreateResourceLimit(Handle* out_handle) { | ||
| 1350 | LOG_DEBUG(Kernel_SVC, "called"); | ||
| 1351 | |||
| 1352 | auto& kernel = Core::System::GetInstance().Kernel(); | ||
| 1353 | auto resource_limit = ResourceLimit::Create(kernel); | ||
| 1354 | |||
| 1355 | auto* const current_process = kernel.CurrentProcess(); | ||
| 1356 | ASSERT(current_process != nullptr); | ||
| 1357 | |||
| 1358 | const auto handle = current_process->GetHandleTable().Create(std::move(resource_limit)); | ||
| 1359 | if (handle.Failed()) { | ||
| 1360 | return handle.Code(); | ||
| 1361 | } | ||
| 1362 | |||
| 1363 | *out_handle = *handle; | ||
| 1364 | return RESULT_SUCCESS; | ||
| 1365 | } | ||
| 1366 | |||
| 1349 | namespace { | 1367 | namespace { |
| 1350 | struct FunctionDef { | 1368 | struct FunctionDef { |
| 1351 | using Func = void(); | 1369 | using Func = void(); |
| @@ -1482,7 +1500,7 @@ static const FunctionDef SVC_Table[] = { | |||
| 1482 | {0x7A, nullptr, "StartProcess"}, | 1500 | {0x7A, nullptr, "StartProcess"}, |
| 1483 | {0x7B, nullptr, "TerminateProcess"}, | 1501 | {0x7B, nullptr, "TerminateProcess"}, |
| 1484 | {0x7C, SvcWrap<GetProcessInfo>, "GetProcessInfo"}, | 1502 | {0x7C, SvcWrap<GetProcessInfo>, "GetProcessInfo"}, |
| 1485 | {0x7D, nullptr, "CreateResourceLimit"}, | 1503 | {0x7D, SvcWrap<CreateResourceLimit>, "CreateResourceLimit"}, |
| 1486 | {0x7E, nullptr, "SetResourceLimitLimitValue"}, | 1504 | {0x7E, nullptr, "SetResourceLimitLimitValue"}, |
| 1487 | {0x7F, nullptr, "CallSecureMonitor"}, | 1505 | {0x7F, nullptr, "CallSecureMonitor"}, |
| 1488 | }; | 1506 | }; |