diff options
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 80d70a816..52011be9c 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -141,38 +141,6 @@ enum class ResourceLimitValueType { | |||
| 141 | PeakValue, | 141 | PeakValue, |
| 142 | }; | 142 | }; |
| 143 | 143 | ||
| 144 | ResultVal<s64> RetrieveResourceLimitValue(Core::System& system, Handle resource_limit, | ||
| 145 | u32 resource_type, ResourceLimitValueType value_type) { | ||
| 146 | std::lock_guard lock{HLE::g_hle_lock}; | ||
| 147 | const auto type = static_cast<LimitableResource>(resource_type); | ||
| 148 | if (!IsValidResourceType(type)) { | ||
| 149 | LOG_ERROR(Kernel_SVC, "Invalid resource limit type: '{}'", resource_type); | ||
| 150 | return ResultInvalidEnumValue; | ||
| 151 | } | ||
| 152 | |||
| 153 | const auto* const current_process = system.Kernel().CurrentProcess(); | ||
| 154 | ASSERT(current_process != nullptr); | ||
| 155 | |||
| 156 | auto resource_limit_object = | ||
| 157 | current_process->GetHandleTable().GetObject<KResourceLimit>(resource_limit); | ||
| 158 | if (resource_limit_object.IsNull()) { | ||
| 159 | LOG_ERROR(Kernel_SVC, "Handle to non-existent resource limit instance used. Handle={:08X}", | ||
| 160 | resource_limit); | ||
| 161 | return ResultInvalidHandle; | ||
| 162 | } | ||
| 163 | |||
| 164 | switch (value_type) { | ||
| 165 | case ResourceLimitValueType::CurrentValue: | ||
| 166 | return MakeResult(resource_limit_object->GetCurrentValue(type)); | ||
| 167 | case ResourceLimitValueType::LimitValue: | ||
| 168 | return MakeResult(resource_limit_object->GetLimitValue(type)); | ||
| 169 | case ResourceLimitValueType::PeakValue: | ||
| 170 | return MakeResult(resource_limit_object->GetPeakValue(type)); | ||
| 171 | default: | ||
| 172 | LOG_ERROR(Kernel_SVC, "Invalid resource value_type: '{}'", value_type); | ||
| 173 | return ResultInvalidEnumValue; | ||
| 174 | } | ||
| 175 | } | ||
| 176 | } // Anonymous namespace | 144 | } // Anonymous namespace |
| 177 | 145 | ||
| 178 | /// Set the process heap to a given Size. It can both extend and shrink the heap. | 146 | /// Set the process heap to a given Size. It can both extend and shrink the heap. |