diff options
Diffstat (limited to 'src')
| -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 | |||
| 644 | } | 644 | } |
| 645 | 645 | ||
| 646 | /// Get resource limit current values | 646 | /// Get resource limit current values |
| 647 | static ResultCode GetResourceLimitCurrentValues(s64* values, Kernel::Handle resource_limit_handle, | 647 | static ResultCode GetResourceLimitCurrentValues(VAddr values, Kernel::Handle resource_limit_handle, |
| 648 | u32* names, u32 name_count) { | 648 | VAddr names, u32 name_count) { |
| 649 | LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%p, name_count=%d", | 649 | LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%08X, name_count=%d", |
| 650 | resource_limit_handle, names, name_count); | 650 | resource_limit_handle, names, name_count); |
| 651 | 651 | ||
| 652 | SharedPtr<Kernel::ResourceLimit> resource_limit = | 652 | SharedPtr<Kernel::ResourceLimit> resource_limit = |
| @@ -654,16 +654,19 @@ static ResultCode GetResourceLimitCurrentValues(s64* values, Kernel::Handle reso | |||
| 654 | if (resource_limit == nullptr) | 654 | if (resource_limit == nullptr) |
| 655 | return ERR_INVALID_HANDLE; | 655 | return ERR_INVALID_HANDLE; |
| 656 | 656 | ||
| 657 | for (unsigned int i = 0; i < name_count; ++i) | 657 | for (unsigned int i = 0; i < name_count; ++i) { |
| 658 | values[i] = resource_limit->GetCurrentResourceValue(names[i]); | 658 | u32 name = Memory::Read32(names + i * sizeof(u32)); |
| 659 | s64 value = resource_limit->GetCurrentResourceValue(name); | ||
| 660 | Memory::Write64(values + i * sizeof(u64), value); | ||
| 661 | } | ||
| 659 | 662 | ||
| 660 | return RESULT_SUCCESS; | 663 | return RESULT_SUCCESS; |
| 661 | } | 664 | } |
| 662 | 665 | ||
| 663 | /// Get resource limit max values | 666 | /// Get resource limit max values |
| 664 | static ResultCode GetResourceLimitLimitValues(s64* values, Kernel::Handle resource_limit_handle, | 667 | static ResultCode GetResourceLimitLimitValues(VAddr values, Kernel::Handle resource_limit_handle, |
| 665 | u32* names, u32 name_count) { | 668 | VAddr names, u32 name_count) { |
| 666 | LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%p, name_count=%d", | 669 | LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%08X, name_count=%d", |
| 667 | resource_limit_handle, names, name_count); | 670 | resource_limit_handle, names, name_count); |
| 668 | 671 | ||
| 669 | SharedPtr<Kernel::ResourceLimit> resource_limit = | 672 | SharedPtr<Kernel::ResourceLimit> resource_limit = |
| @@ -671,8 +674,11 @@ static ResultCode GetResourceLimitLimitValues(s64* values, Kernel::Handle resour | |||
| 671 | if (resource_limit == nullptr) | 674 | if (resource_limit == nullptr) |
| 672 | return ERR_INVALID_HANDLE; | 675 | return ERR_INVALID_HANDLE; |
| 673 | 676 | ||
| 674 | for (unsigned int i = 0; i < name_count; ++i) | 677 | for (unsigned int i = 0; i < name_count; ++i) { |
| 675 | values[i] = resource_limit->GetMaxResourceValue(names[i]); | 678 | u32 name = Memory::Read32(names + i * sizeof(u32)); |
| 679 | s64 value = resource_limit->GetMaxResourceValue(names); | ||
| 680 | Memory::Write64(values + i * sizeof(u64), value); | ||
| 681 | } | ||
| 676 | 682 | ||
| 677 | return RESULT_SUCCESS; | 683 | return RESULT_SUCCESS; |
| 678 | } | 684 | } |