diff options
author | Subv <subv2112@gmail.com> | 2017-10-04 19:23:08 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2017-10-04 21:04:27 +0200 |
commit | 97f262c1f5c39e51d6fe2e32429610599299db60 (patch) | |
tree | 5f614fc8b1da8397e1081efe08488278c6cbee9a | |
parent | SVC: Remove GetPointer usage in CreatePort. (diff) | |
download | yuzu-97f262c1f5c39e51d6fe2e32429610599299db60.tar yuzu-97f262c1f5c39e51d6fe2e32429610599299db60.tar.gz yuzu-97f262c1f5c39e51d6fe2e32429610599299db60.tar.bz2 yuzu-97f262c1f5c39e51d6fe2e32429610599299db60.tar.lz yuzu-97f262c1f5c39e51d6fe2e32429610599299db60.tar.xz yuzu-97f262c1f5c39e51d6fe2e32429610599299db60.tar.zst yuzu-97f262c1f5c39e51d6fe2e32429610599299db60.zip |
-rw-r--r-- | src/core/hle/svc.cpp | 26 |
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; } |