summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-12-04 06:29:15 +0100
committerLioncash <mathew1800@gmail.com>2018-12-04 07:50:30 +0100
commit312690b4509a6e5c5e97b667136aea7693e52ca0 (patch)
tree81c05c9ff48b02023c713d5ed57fc6799e27b274 /src/core/hle/kernel/svc.cpp
parentMerge pull request #1852 from VPeruS/fix-format-string (diff)
downloadyuzu-312690b4509a6e5c5e97b667136aea7693e52ca0.tar
yuzu-312690b4509a6e5c5e97b667136aea7693e52ca0.tar.gz
yuzu-312690b4509a6e5c5e97b667136aea7693e52ca0.tar.bz2
yuzu-312690b4509a6e5c5e97b667136aea7693e52ca0.tar.lz
yuzu-312690b4509a6e5c5e97b667136aea7693e52ca0.tar.xz
yuzu-312690b4509a6e5c5e97b667136aea7693e52ca0.tar.zst
yuzu-312690b4509a6e5c5e97b667136aea7693e52ca0.zip
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 948989b31..b022a7bc5 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -663,7 +663,7 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
TotalMemoryUsage = 6,
TotalHeapUsage = 7,
IsCurrentProcessBeingDebugged = 8,
- ResourceHandleLimit = 9,
+ RegisterResourceLimit = 9,
IdleTickCount = 10,
RandomEntropy = 11,
PerformanceCounter = 0xF0000002,
@@ -787,6 +787,33 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
*result = 0;
return RESULT_SUCCESS;
+ case GetInfoType::RegisterResourceLimit: {
+ if (handle != 0) {
+ return ERR_INVALID_HANDLE;
+ }
+
+ if (info_sub_id != 0) {
+ return ERR_INVALID_COMBINATION;
+ }
+
+ Process* const current_process = Core::CurrentProcess();
+ HandleTable& handle_table = current_process->GetHandleTable();
+ const auto resource_limit = current_process->GetResourceLimit();
+ if (!resource_limit) {
+ *result = KernelHandle::InvalidHandle;
+ // Yes, the kernel considers this a successful operation.
+ return RESULT_SUCCESS;
+ }
+
+ const auto table_result = handle_table.Create(resource_limit);
+ if (table_result.Failed()) {
+ return table_result.Code();
+ }
+
+ *result = *table_result;
+ return RESULT_SUCCESS;
+ }
+
case GetInfoType::RandomEntropy:
if (handle != 0) {
LOG_ERROR(Kernel_SVC, "Process Handle is non zero, expected 0 result but got {:016X}",