summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorGravatar Michael Scire2019-07-07 11:48:11 -0700
committerGravatar Michael Scire2019-07-07 11:48:11 -0700
commit1689784c198f6a7f3c389d4cd5edeccc74c1d9f3 (patch)
tree66fed74508274f801f37e08d5bc405227776cf4c /src/core/hle/kernel/svc.cpp
parentImplement MapPhysicalMemory/UnmapPhysicalMemory (diff)
downloadyuzu-1689784c198f6a7f3c389d4cd5edeccc74c1d9f3.tar.gz
yuzu-1689784c198f6a7f3c389d4cd5edeccc74c1d9f3.tar.xz
yuzu-1689784c198f6a7f3c389d4cd5edeccc74c1d9f3.zip
address review commentary
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index abb374892..85e4512f0 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -737,8 +737,8 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, u64 ha
737 // 5.0.0+ 737 // 5.0.0+
738 UserExceptionContextAddr = 20, 738 UserExceptionContextAddr = 20,
739 // 6.0.0+ 739 // 6.0.0+
740 TotalPhysicalMemoryAvailableWithoutMmHeap = 21, 740 TotalPhysicalMemoryAvailableWithoutSystemResource = 21,
741 TotalPhysicalMemoryUsedWithoutMmHeap = 22, 741 TotalPhysicalMemoryUsedWithoutSystemResource = 22,
742 }; 742 };
743 743
744 const auto info_id_type = static_cast<GetInfoType>(info_id); 744 const auto info_id_type = static_cast<GetInfoType>(info_id);
@@ -760,8 +760,8 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, u64 ha
760 case GetInfoType::SystemResourceUsage: 760 case GetInfoType::SystemResourceUsage:
761 case GetInfoType::TitleId: 761 case GetInfoType::TitleId:
762 case GetInfoType::UserExceptionContextAddr: 762 case GetInfoType::UserExceptionContextAddr:
763 case GetInfoType::TotalPhysicalMemoryAvailableWithoutMmHeap: 763 case GetInfoType::TotalPhysicalMemoryAvailableWithoutSystemResource:
764 case GetInfoType::TotalPhysicalMemoryUsedWithoutMmHeap: { 764 case GetInfoType::TotalPhysicalMemoryUsedWithoutSystemResource: {
765 if (info_sub_id != 0) { 765 if (info_sub_id != 0) {
766 return ERR_INVALID_ENUM_VALUE; 766 return ERR_INVALID_ENUM_VALUE;
767 } 767 }
@@ -827,17 +827,9 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, u64 ha
827 return RESULT_SUCCESS; 827 return RESULT_SUCCESS;
828 828
829 case GetInfoType::SystemResourceUsage: 829 case GetInfoType::SystemResourceUsage:
830 // On hardware, this returns the amount of system resource memory that has
831 // been used by the kernel. This is problematic for Yuzu to emulate, because
832 // system resource memory is used for page tables -- and yuzu doesn't really
833 // have a way to calculate how much memory is required for page tables for
834 // the current process at any given time.
835 // TODO: Is this even worth implementing? No game should ever use it, since
836 // the amount of remaining page table space should never be relevant except
837 // for diagnostics. Is returning a value other than zero wise?
838 LOG_WARNING(Kernel_SVC, 830 LOG_WARNING(Kernel_SVC,
839 "(STUBBED) Attempted to query system resource usage, returned 0"); 831 "(STUBBED) Attempted to query system resource usage");
840 *result = 0; 832 *result = process->GetSystemResourceUsage();
841 return RESULT_SUCCESS; 833 return RESULT_SUCCESS;
842 834
843 case GetInfoType::TitleId: 835 case GetInfoType::TitleId:
@@ -850,12 +842,12 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, u64 ha
850 *result = 0; 842 *result = 0;
851 return RESULT_SUCCESS; 843 return RESULT_SUCCESS;
852 844
853 case GetInfoType::TotalPhysicalMemoryAvailableWithoutMmHeap: 845 case GetInfoType::TotalPhysicalMemoryAvailableWithoutSystemResource:
854 *result = process->GetTotalPhysicalMemoryAvailable(); 846 *result = process->GetTotalPhysicalMemoryAvailableWithoutSystemResource();
855 return RESULT_SUCCESS; 847 return RESULT_SUCCESS;
856 848
857 case GetInfoType::TotalPhysicalMemoryUsedWithoutMmHeap: 849 case GetInfoType::TotalPhysicalMemoryUsedWithoutSystemResource:
858 *result = process->GetTotalPhysicalMemoryUsedWithoutMmHeap(); 850 *result = process->GetTotalPhysicalMemoryUsedWithoutSystemResource();
859 return RESULT_SUCCESS; 851 return RESULT_SUCCESS;
860 852
861 default: 853 default:
@@ -984,7 +976,7 @@ static ResultCode MapPhysicalMemory(Core::System& system, VAddr addr, u64 size)
984 return ERR_INVALID_MEMORY_RANGE; 976 return ERR_INVALID_MEMORY_RANGE;
985 } 977 }
986 978
987 auto* const current_process = Core::CurrentProcess(); 979 Process* const current_process = system.Kernel().CurrentProcess();
988 auto& vm_manager = current_process->VMManager(); 980 auto& vm_manager = current_process->VMManager();
989 981
990 if (current_process->GetSystemResourceSize() == 0) { 982 if (current_process->GetSystemResourceSize() == 0) {
@@ -1024,7 +1016,7 @@ static ResultCode UnmapPhysicalMemory(Core::System& system, VAddr addr, u64 size
1024 return ERR_INVALID_MEMORY_RANGE; 1016 return ERR_INVALID_MEMORY_RANGE;
1025 } 1017 }
1026 1018
1027 auto* const current_process = Core::CurrentProcess(); 1019 Process* const current_process = system.Kernel().CurrentProcess();
1028 auto& vm_manager = current_process->VMManager(); 1020 auto& vm_manager = current_process->VMManager();
1029 1021
1030 if (current_process->GetSystemResourceSize() == 0) { 1022 if (current_process->GetSystemResourceSize() == 0) {