summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2017-12-30 13:40:28 -0500
committerGravatar bunnei2017-12-30 13:40:28 -0500
commita3228d9b7770d02504e9e468266f3326a49862b7 (patch)
tree180866af63d117ccdafe04a30670000d40c268a7 /src
parentsvc: Implement svcStartThread. (diff)
downloadyuzu-a3228d9b7770d02504e9e468266f3326a49862b7.tar.gz
yuzu-a3228d9b7770d02504e9e468266f3326a49862b7.tar.xz
yuzu-a3228d9b7770d02504e9e468266f3326a49862b7.zip
svc: Minor cleanups.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/svc.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 120cf75f3..9f983ce0e 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -73,7 +73,7 @@ static ResultCode ConnectToPort(Kernel::Handle* out_handle, VAddr port_name_addr
73/// Makes a blocking IPC call to an OS service. 73/// Makes a blocking IPC call to an OS service.
74static ResultCode SendSyncRequest(Kernel::Handle handle) { 74static ResultCode SendSyncRequest(Kernel::Handle handle) {
75 SharedPtr<Kernel::SyncObject> session = Kernel::g_handle_table.Get<Kernel::SyncObject>(handle); 75 SharedPtr<Kernel::SyncObject> session = Kernel::g_handle_table.Get<Kernel::SyncObject>(handle);
76 if (session == nullptr) { 76 if (!session) {
77 LOG_ERROR(Kernel_SVC, "called with invalid handle=0x%08X", handle); 77 LOG_ERROR(Kernel_SVC, "called with invalid handle=0x%08X", handle);
78 return ERR_INVALID_HANDLE; 78 return ERR_INVALID_HANDLE;
79 } 79 }
@@ -88,11 +88,11 @@ static ResultCode SendSyncRequest(Kernel::Handle handle) {
88} 88}
89 89
90/// Get the ID for the specified thread. 90/// Get the ID for the specified thread.
91static ResultCode GetThreadId(u32* thread_id, Kernel::Handle handle) { 91static ResultCode GetThreadId(u32* thread_id, Kernel::Handle thread_handle) {
92 LOG_TRACE(Kernel_SVC, "called thread=0x%08X", handle); 92 LOG_TRACE(Kernel_SVC, "called thread=0x%08X", thread_handle);
93 93
94 const SharedPtr<Kernel::Thread> thread = Kernel::g_handle_table.Get<Kernel::Thread>(handle); 94 const SharedPtr<Kernel::Thread> thread = Kernel::g_handle_table.Get<Kernel::Thread>(thread_handle);
95 if (thread == nullptr) { 95 if (!thread) {
96 return ERR_INVALID_HANDLE; 96 return ERR_INVALID_HANDLE;
97 } 97 }
98 98
@@ -106,7 +106,7 @@ static ResultCode GetProcessId(u32* process_id, Kernel::Handle process_handle) {
106 106
107 const SharedPtr<Kernel::Process> process = 107 const SharedPtr<Kernel::Process> process =
108 Kernel::g_handle_table.Get<Kernel::Process>(process_handle); 108 Kernel::g_handle_table.Get<Kernel::Process>(process_handle);
109 if (process == nullptr) { 109 if (!process) {
110 return ERR_INVALID_HANDLE; 110 return ERR_INVALID_HANDLE;
111 } 111 }
112 112
@@ -153,7 +153,7 @@ static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* /*page_i
153 Kernel::Handle process_handle, u64 addr) { 153 Kernel::Handle process_handle, u64 addr) {
154 using Kernel::Process; 154 using Kernel::Process;
155 Kernel::SharedPtr<Process> process = Kernel::g_handle_table.Get<Process>(process_handle); 155 Kernel::SharedPtr<Process> process = Kernel::g_handle_table.Get<Process>(process_handle);
156 if (process == nullptr) { 156 if (!process) {
157 return ERR_INVALID_HANDLE; 157 return ERR_INVALID_HANDLE;
158 } 158 }
159 auto vma = process->vm_manager.FindVMA(addr); 159 auto vma = process->vm_manager.FindVMA(addr);
@@ -169,6 +169,7 @@ static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* /*page_i
169 memory_info->size = vma->second.size; 169 memory_info->size = vma->second.size;
170 memory_info->type = static_cast<u32>(vma->second.meminfo_state); 170 memory_info->type = static_cast<u32>(vma->second.meminfo_state);
171 } 171 }
172
172 LOG_TRACE(Kernel_SVC, "called process=0x%08X addr=%llx", process_handle, addr); 173 LOG_TRACE(Kernel_SVC, "called process=0x%08X addr=%llx", process_handle, addr);
173 return RESULT_SUCCESS; 174 return RESULT_SUCCESS;
174} 175}
@@ -179,7 +180,7 @@ static ResultCode QueryMemory(MemoryInfo* memory_info, PageInfo* page_info, VAdd
179 return QueryProcessMemory(memory_info, page_info, Kernel::CurrentProcess, addr); 180 return QueryProcessMemory(memory_info, page_info, Kernel::CurrentProcess, addr);
180} 181}
181 182
182/// Starts the thread for the provided handle. 183/// Starts the thread for the provided handle
183static ResultCode StartThread(Handle thread_handle) { 184static ResultCode StartThread(Handle thread_handle) {
184 LOG_TRACE(Kernel_SVC, "called thread=0x%08X", thread_handle); 185 LOG_TRACE(Kernel_SVC, "called thread=0x%08X", thread_handle);
185 186