summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/svc.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index b72ca3581..e8ca419d5 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -644,9 +644,9 @@ static ResultCode GetResourceLimit(Kernel::Handle* resource_limit, Kernel::Handl
}
/// Get resource limit current values
-static ResultCode GetResourceLimitCurrentValues(s64* values, Kernel::Handle resource_limit_handle,
- u32* names, u32 name_count) {
- LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%p, name_count=%d",
+static ResultCode GetResourceLimitCurrentValues(VAddr values, Kernel::Handle resource_limit_handle,
+ VAddr names, u32 name_count) {
+ LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%08X, name_count=%d",
resource_limit_handle, names, name_count);
SharedPtr<Kernel::ResourceLimit> resource_limit =
@@ -654,16 +654,19 @@ static ResultCode GetResourceLimitCurrentValues(s64* values, Kernel::Handle reso
if (resource_limit == nullptr)
return ERR_INVALID_HANDLE;
- for (unsigned int i = 0; i < name_count; ++i)
- values[i] = resource_limit->GetCurrentResourceValue(names[i]);
+ for (unsigned int i = 0; i < name_count; ++i) {
+ u32 name = Memory::Read32(names + i * sizeof(u32));
+ s64 value = resource_limit->GetCurrentResourceValue(name);
+ Memory::Write64(values + i * sizeof(u64), value);
+ }
return RESULT_SUCCESS;
}
/// Get resource limit max values
-static ResultCode GetResourceLimitLimitValues(s64* values, Kernel::Handle resource_limit_handle,
- u32* names, u32 name_count) {
- LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%p, name_count=%d",
+static ResultCode GetResourceLimitLimitValues(VAddr values, Kernel::Handle resource_limit_handle,
+ VAddr names, u32 name_count) {
+ LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%08X, name_count=%d",
resource_limit_handle, names, name_count);
SharedPtr<Kernel::ResourceLimit> resource_limit =
@@ -671,8 +674,11 @@ static ResultCode GetResourceLimitLimitValues(s64* values, Kernel::Handle resour
if (resource_limit == nullptr)
return ERR_INVALID_HANDLE;
- for (unsigned int i = 0; i < name_count; ++i)
- values[i] = resource_limit->GetMaxResourceValue(names[i]);
+ for (unsigned int i = 0; i < name_count; ++i) {
+ u32 name = Memory::Read32(names + i * sizeof(u32));
+ s64 value = resource_limit->GetMaxResourceValue(names);
+ Memory::Write64(values + i * sizeof(u64), value);
+ }
return RESULT_SUCCESS;
}