summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-rw-r--r--src/core/hle/kernel/thread.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 36222d45f..4cd57ab25 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -101,9 +101,10 @@ void ExitCurrentThread() {
101 * @param cycles_late The number of CPU cycles that have passed since the desired wakeup time 101 * @param cycles_late The number of CPU cycles that have passed since the desired wakeup time
102 */ 102 */
103static void ThreadWakeupCallback(u64 thread_handle, int cycles_late) { 103static void ThreadWakeupCallback(u64 thread_handle, int cycles_late) {
104 SharedPtr<Thread> thread = wakeup_callback_handle_table.Get<Thread>((Handle)thread_handle); 104 const auto proper_handle = static_cast<Handle>(thread_handle);
105 SharedPtr<Thread> thread = wakeup_callback_handle_table.Get<Thread>(proper_handle);
105 if (thread == nullptr) { 106 if (thread == nullptr) {
106 LOG_CRITICAL(Kernel, "Callback fired for invalid thread %08X", (Handle)thread_handle); 107 NGLOG_CRITICAL(Kernel, "Callback fired for invalid thread {:08X}", proper_handle);
107 return; 108 return;
108 } 109 }
109 110
@@ -238,19 +239,19 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point,
238 SharedPtr<Process> owner_process) { 239 SharedPtr<Process> owner_process) {
239 // Check if priority is in ranged. Lowest priority -> highest priority id. 240 // Check if priority is in ranged. Lowest priority -> highest priority id.
240 if (priority > THREADPRIO_LOWEST) { 241 if (priority > THREADPRIO_LOWEST) {
241 LOG_ERROR(Kernel_SVC, "Invalid thread priority: %u", priority); 242 NGLOG_ERROR(Kernel_SVC, "Invalid thread priority: {}", priority);
242 return ERR_OUT_OF_RANGE; 243 return ERR_OUT_OF_RANGE;
243 } 244 }
244 245
245 if (processor_id > THREADPROCESSORID_MAX) { 246 if (processor_id > THREADPROCESSORID_MAX) {
246 LOG_ERROR(Kernel_SVC, "Invalid processor id: %d", processor_id); 247 NGLOG_ERROR(Kernel_SVC, "Invalid processor id: {}", processor_id);
247 return ERR_OUT_OF_RANGE_KERNEL; 248 return ERR_OUT_OF_RANGE_KERNEL;
248 } 249 }
249 250
250 // TODO(yuriks): Other checks, returning 0xD9001BEA 251 // TODO(yuriks): Other checks, returning 0xD9001BEA
251 252
252 if (!Memory::IsValidVirtualAddress(*owner_process, entry_point)) { 253 if (!Memory::IsValidVirtualAddress(*owner_process, entry_point)) {
253 LOG_ERROR(Kernel_SVC, "(name=%s): invalid entry %016" PRIx64, name.c_str(), entry_point); 254 NGLOG_ERROR(Kernel_SVC, "(name={}): invalid entry {:016X}", name, entry_point);
254 // TODO (bunnei): Find the correct error code to use here 255 // TODO (bunnei): Find the correct error code to use here
255 return ResultCode(-1); 256 return ResultCode(-1);
256 } 257 }
@@ -289,8 +290,8 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point,
289 auto& linheap_memory = memory_region->linear_heap_memory; 290 auto& linheap_memory = memory_region->linear_heap_memory;
290 291
291 if (linheap_memory->size() + Memory::PAGE_SIZE > memory_region->size) { 292 if (linheap_memory->size() + Memory::PAGE_SIZE > memory_region->size) {
292 LOG_ERROR(Kernel_SVC, 293 NGLOG_ERROR(Kernel_SVC,
293 "Not enough space in region to allocate a new TLS page for thread"); 294 "Not enough space in region to allocate a new TLS page for thread");
294 return ERR_OUT_OF_MEMORY; 295 return ERR_OUT_OF_MEMORY;
295 } 296 }
296 297