summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index ef8fa98a9..725f16ea4 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -30,6 +30,7 @@
30#include "core/hle/kernel/k_memory_block.h" 30#include "core/hle/kernel/k_memory_block.h"
31#include "core/hle/kernel/k_memory_layout.h" 31#include "core/hle/kernel/k_memory_layout.h"
32#include "core/hle/kernel/k_page_table.h" 32#include "core/hle/kernel/k_page_table.h"
33#include "core/hle/kernel/k_process.h"
33#include "core/hle/kernel/k_readable_event.h" 34#include "core/hle/kernel/k_readable_event.h"
34#include "core/hle/kernel/k_resource_limit.h" 35#include "core/hle/kernel/k_resource_limit.h"
35#include "core/hle/kernel/k_scheduler.h" 36#include "core/hle/kernel/k_scheduler.h"
@@ -42,7 +43,6 @@
42#include "core/hle/kernel/k_writable_event.h" 43#include "core/hle/kernel/k_writable_event.h"
43#include "core/hle/kernel/kernel.h" 44#include "core/hle/kernel/kernel.h"
44#include "core/hle/kernel/physical_core.h" 45#include "core/hle/kernel/physical_core.h"
45#include "core/hle/kernel/process.h"
46#include "core/hle/kernel/svc.h" 46#include "core/hle/kernel/svc.h"
47#include "core/hle/kernel/svc_results.h" 47#include "core/hle/kernel/svc_results.h"
48#include "core/hle/kernel/svc_types.h" 48#include "core/hle/kernel/svc_types.h"
@@ -402,8 +402,8 @@ static ResultCode GetProcessId(Core::System& system, u64* out_process_id, Handle
402 R_UNLESS(obj.IsNotNull(), ResultInvalidHandle); 402 R_UNLESS(obj.IsNotNull(), ResultInvalidHandle);
403 403
404 // Get the process from the object. 404 // Get the process from the object.
405 Process* process = nullptr; 405 KProcess* process = nullptr;
406 if (Process* p = obj->DynamicCast<Process*>(); p != nullptr) { 406 if (KProcess* p = obj->DynamicCast<KProcess*>(); p != nullptr) {
407 // The object is a process, so we can use it directly. 407 // The object is a process, so we can use it directly.
408 process = p; 408 process = p;
409 } else if (KThread* t = obj->DynamicCast<KThread*>(); t != nullptr) { 409 } else if (KThread* t = obj->DynamicCast<KThread*>(); t != nullptr) {
@@ -733,7 +733,7 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
733 } 733 }
734 734
735 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); 735 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable();
736 KScopedAutoObject process = handle_table.GetObject<Process>(handle); 736 KScopedAutoObject process = handle_table.GetObject<KProcess>(handle);
737 if (process.IsNull()) { 737 if (process.IsNull()) {
738 LOG_ERROR(Kernel_SVC, "Process is not valid! info_id={}, info_sub_id={}, handle={:08X}", 738 LOG_ERROR(Kernel_SVC, "Process is not valid! info_id={}, info_sub_id={}, handle={:08X}",
739 info_id, info_sub_id, handle); 739 info_id, info_sub_id, handle);
@@ -838,7 +838,7 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
838 return ResultInvalidCombination; 838 return ResultInvalidCombination;
839 } 839 }
840 840
841 Process* const current_process = system.Kernel().CurrentProcess(); 841 KProcess* const current_process = system.Kernel().CurrentProcess();
842 HandleTable& handle_table = current_process->GetHandleTable(); 842 HandleTable& handle_table = current_process->GetHandleTable();
843 const auto resource_limit = current_process->GetResourceLimit(); 843 const auto resource_limit = current_process->GetResourceLimit();
844 if (!resource_limit) { 844 if (!resource_limit) {
@@ -861,9 +861,9 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
861 return ResultInvalidHandle; 861 return ResultInvalidHandle;
862 } 862 }
863 863
864 if (info_sub_id >= Process::RANDOM_ENTROPY_SIZE) { 864 if (info_sub_id >= KProcess::RANDOM_ENTROPY_SIZE) {
865 LOG_ERROR(Kernel_SVC, "Entropy size is out of range, expected {} but got {}", 865 LOG_ERROR(Kernel_SVC, "Entropy size is out of range, expected {} but got {}",
866 Process::RANDOM_ENTROPY_SIZE, info_sub_id); 866 KProcess::RANDOM_ENTROPY_SIZE, info_sub_id);
867 return ResultInvalidCombination; 867 return ResultInvalidCombination;
868 } 868 }
869 869
@@ -955,7 +955,7 @@ static ResultCode MapPhysicalMemory(Core::System& system, VAddr addr, u64 size)
955 return ResultInvalidMemoryRegion; 955 return ResultInvalidMemoryRegion;
956 } 956 }
957 957
958 Process* const current_process{system.Kernel().CurrentProcess()}; 958 KProcess* const current_process{system.Kernel().CurrentProcess()};
959 auto& page_table{current_process->PageTable()}; 959 auto& page_table{current_process->PageTable()};
960 960
961 if (current_process->GetSystemResourceSize() == 0) { 961 if (current_process->GetSystemResourceSize() == 0) {
@@ -1009,7 +1009,7 @@ static ResultCode UnmapPhysicalMemory(Core::System& system, VAddr addr, u64 size
1009 return ResultInvalidMemoryRegion; 1009 return ResultInvalidMemoryRegion;
1010 } 1010 }
1011 1011
1012 Process* const current_process{system.Kernel().CurrentProcess()}; 1012 KProcess* const current_process{system.Kernel().CurrentProcess()};
1013 auto& page_table{current_process->PageTable()}; 1013 auto& page_table{current_process->PageTable()};
1014 1014
1015 if (current_process->GetSystemResourceSize() == 0) { 1015 if (current_process->GetSystemResourceSize() == 0) {
@@ -1153,7 +1153,7 @@ static ResultCode GetThreadPriority32(Core::System& system, u32* out_priority, H
1153/// Sets the priority for the specified thread 1153/// Sets the priority for the specified thread
1154static ResultCode SetThreadPriority(Core::System& system, Handle thread_handle, u32 priority) { 1154static ResultCode SetThreadPriority(Core::System& system, Handle thread_handle, u32 priority) {
1155 // Get the current process. 1155 // Get the current process.
1156 Process& process = *system.Kernel().CurrentProcess(); 1156 KProcess& process = *system.Kernel().CurrentProcess();
1157 1157
1158 // Validate the priority. 1158 // Validate the priority.
1159 R_UNLESS(HighestThreadPriority <= priority && priority <= LowestThreadPriority, 1159 R_UNLESS(HighestThreadPriority <= priority && priority <= LowestThreadPriority,
@@ -1264,7 +1264,7 @@ static ResultCode QueryProcessMemory(Core::System& system, VAddr memory_info_add
1264 std::lock_guard lock{HLE::g_hle_lock}; 1264 std::lock_guard lock{HLE::g_hle_lock};
1265 LOG_TRACE(Kernel_SVC, "called process=0x{:08X} address={:X}", process_handle, address); 1265 LOG_TRACE(Kernel_SVC, "called process=0x{:08X} address={:X}", process_handle, address);
1266 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); 1266 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable();
1267 KScopedAutoObject process = handle_table.GetObject<Process>(process_handle); 1267 KScopedAutoObject process = handle_table.GetObject<KProcess>(process_handle);
1268 if (process.IsNull()) { 1268 if (process.IsNull()) {
1269 LOG_ERROR(Kernel_SVC, "Process handle does not exist, process_handle=0x{:08X}", 1269 LOG_ERROR(Kernel_SVC, "Process handle does not exist, process_handle=0x{:08X}",
1270 process_handle); 1270 process_handle);
@@ -1346,7 +1346,7 @@ static ResultCode MapProcessCodeMemory(Core::System& system, Handle process_hand
1346 } 1346 }
1347 1347
1348 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); 1348 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable();
1349 KScopedAutoObject process = handle_table.GetObject<Process>(process_handle); 1349 KScopedAutoObject process = handle_table.GetObject<KProcess>(process_handle);
1350 if (process.IsNull()) { 1350 if (process.IsNull()) {
1351 LOG_ERROR(Kernel_SVC, "Invalid process handle specified (handle=0x{:08X}).", 1351 LOG_ERROR(Kernel_SVC, "Invalid process handle specified (handle=0x{:08X}).",
1352 process_handle); 1352 process_handle);
@@ -1414,7 +1414,7 @@ static ResultCode UnmapProcessCodeMemory(Core::System& system, Handle process_ha
1414 } 1414 }
1415 1415
1416 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); 1416 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable();
1417 KScopedAutoObject process = handle_table.GetObject<Process>(process_handle); 1417 KScopedAutoObject process = handle_table.GetObject<KProcess>(process_handle);
1418 if (process.IsNull()) { 1418 if (process.IsNull()) {
1419 LOG_ERROR(Kernel_SVC, "Invalid process handle specified (handle=0x{:08X}).", 1419 LOG_ERROR(Kernel_SVC, "Invalid process handle specified (handle=0x{:08X}).",
1420 process_handle); 1420 process_handle);
@@ -1830,7 +1830,7 @@ static ResultCode ResetSignal(Core::System& system, Handle handle) {
1830 1830
1831 // Try to reset as process. 1831 // Try to reset as process.
1832 { 1832 {
1833 KScopedAutoObject process = handle_table.GetObject<Process>(handle); 1833 KScopedAutoObject process = handle_table.GetObject<KProcess>(handle);
1834 if (process.IsNotNull()) { 1834 if (process.IsNotNull()) {
1835 return process->Reset(); 1835 return process->Reset();
1836 } 1836 }
@@ -2077,7 +2077,7 @@ static ResultCode GetProcessInfo(Core::System& system, u64* out, Handle process_
2077 }; 2077 };
2078 2078
2079 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); 2079 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable();
2080 KScopedAutoObject process = handle_table.GetObject<Process>(process_handle); 2080 KScopedAutoObject process = handle_table.GetObject<KProcess>(process_handle);
2081 if (process.IsNull()) { 2081 if (process.IsNull()) {
2082 LOG_ERROR(Kernel_SVC, "Process handle does not exist, process_handle=0x{:08X}", 2082 LOG_ERROR(Kernel_SVC, "Process handle does not exist, process_handle=0x{:08X}",
2083 process_handle); 2083 process_handle);