diff options
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 1033f8552..11f7d2127 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -111,7 +111,7 @@ void Thread::Stop() { | |||
| 111 | 111 | ||
| 112 | Thread* ArbitrateHighestPriorityThread(u32 address) { | 112 | Thread* ArbitrateHighestPriorityThread(u32 address) { |
| 113 | Thread* highest_priority_thread = nullptr; | 113 | Thread* highest_priority_thread = nullptr; |
| 114 | s32 priority = THREADPRIO_LOWEST; | 114 | u32 priority = THREADPRIO_LOWEST; |
| 115 | 115 | ||
| 116 | // Iterate through threads, find highest priority thread that is waiting to be arbitrated... | 116 | // Iterate through threads, find highest priority thread that is waiting to be arbitrated... |
| 117 | for (auto& thread : thread_list) { | 117 | for (auto& thread : thread_list) { |
| @@ -311,7 +311,7 @@ static void DebugThreadQueue() { | |||
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | for (auto& t : thread_list) { | 313 | for (auto& t : thread_list) { |
| 314 | s32 priority = ready_queue.contains(t.get()); | 314 | u32 priority = ready_queue.contains(t.get()); |
| 315 | if (priority != -1) { | 315 | if (priority != -1) { |
| 316 | LOG_DEBUG(Kernel, "0x%02X %u", priority, t->GetObjectId()); | 316 | LOG_DEBUG(Kernel, "0x%02X %u", priority, t->GetObjectId()); |
| 317 | } | 317 | } |
| @@ -422,7 +422,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, | |||
| 422 | return ERR_OUT_OF_MEMORY; | 422 | return ERR_OUT_OF_MEMORY; |
| 423 | } | 423 | } |
| 424 | 424 | ||
| 425 | u32 offset = linheap_memory->size(); | 425 | size_t offset = linheap_memory->size(); |
| 426 | 426 | ||
| 427 | // Allocate some memory from the end of the linear heap for this region. | 427 | // Allocate some memory from the end of the linear heap for this region. |
| 428 | linheap_memory->insert(linheap_memory->end(), Memory::PAGE_SIZE, 0); | 428 | linheap_memory->insert(linheap_memory->end(), Memory::PAGE_SIZE, 0); |
| @@ -430,7 +430,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, | |||
| 430 | owner_process->linear_heap_used += Memory::PAGE_SIZE; | 430 | owner_process->linear_heap_used += Memory::PAGE_SIZE; |
| 431 | 431 | ||
| 432 | tls_slots.emplace_back(0); // The page is completely available at the start | 432 | tls_slots.emplace_back(0); // The page is completely available at the start |
| 433 | available_page = tls_slots.size() - 1; | 433 | available_page = static_cast<u32>(tls_slots.size() - 1); |
| 434 | available_slot = 0; // Use the first slot in the new page | 434 | available_slot = 0; // Use the first slot in the new page |
| 435 | 435 | ||
| 436 | auto& vm_manager = owner_process->vm_manager; | 436 | auto& vm_manager = owner_process->vm_manager; |
| @@ -457,7 +457,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, | |||
| 457 | return MakeResult<SharedPtr<Thread>>(std::move(thread)); | 457 | return MakeResult<SharedPtr<Thread>>(std::move(thread)); |
| 458 | } | 458 | } |
| 459 | 459 | ||
| 460 | void Thread::SetPriority(s32 priority) { | 460 | void Thread::SetPriority(u32 priority) { |
| 461 | ASSERT_MSG(priority <= THREADPRIO_LOWEST && priority >= THREADPRIO_HIGHEST, | 461 | ASSERT_MSG(priority <= THREADPRIO_LOWEST && priority >= THREADPRIO_HIGHEST, |
| 462 | "Invalid priority value."); | 462 | "Invalid priority value."); |
| 463 | // If thread was ready, adjust queues | 463 | // If thread was ready, adjust queues |
| @@ -470,7 +470,7 @@ void Thread::SetPriority(s32 priority) { | |||
| 470 | } | 470 | } |
| 471 | 471 | ||
| 472 | void Thread::UpdatePriority() { | 472 | void Thread::UpdatePriority() { |
| 473 | s32 best_priority = nominal_priority; | 473 | u32 best_priority = nominal_priority; |
| 474 | for (auto& mutex : held_mutexes) { | 474 | for (auto& mutex : held_mutexes) { |
| 475 | if (mutex->priority < best_priority) | 475 | if (mutex->priority < best_priority) |
| 476 | best_priority = mutex->priority; | 476 | best_priority = mutex->priority; |
| @@ -478,7 +478,7 @@ void Thread::UpdatePriority() { | |||
| 478 | BoostPriority(best_priority); | 478 | BoostPriority(best_priority); |
| 479 | } | 479 | } |
| 480 | 480 | ||
| 481 | void Thread::BoostPriority(s32 priority) { | 481 | void Thread::BoostPriority(u32 priority) { |
| 482 | // If thread was ready, adjust queues | 482 | // If thread was ready, adjust queues |
| 483 | if (status == THREADSTATUS_READY) | 483 | if (status == THREADSTATUS_READY) |
| 484 | ready_queue.move(this, current_priority, priority); | 484 | ready_queue.move(this, current_priority, priority); |
| @@ -487,7 +487,7 @@ void Thread::BoostPriority(s32 priority) { | |||
| 487 | current_priority = priority; | 487 | current_priority = priority; |
| 488 | } | 488 | } |
| 489 | 489 | ||
| 490 | SharedPtr<Thread> SetupMainThread(u32 entry_point, s32 priority, SharedPtr<Process> owner_process) { | 490 | SharedPtr<Thread> SetupMainThread(u32 entry_point, u32 priority, SharedPtr<Process> owner_process) { |
| 491 | // Initialize new "main" thread | 491 | // Initialize new "main" thread |
| 492 | auto thread_res = Thread::Create("main", entry_point, priority, 0, THREADPROCESSORID_0, | 492 | auto thread_res = Thread::Create("main", entry_point, priority, 0, THREADPROCESSORID_0, |
| 493 | Memory::HEAP_VADDR_END, owner_process); | 493 | Memory::HEAP_VADDR_END, owner_process); |
| @@ -531,7 +531,7 @@ void Thread::SetWaitSynchronizationOutput(s32 output) { | |||
| 531 | s32 Thread::GetWaitObjectIndex(WaitObject* object) const { | 531 | s32 Thread::GetWaitObjectIndex(WaitObject* object) const { |
| 532 | ASSERT_MSG(!wait_objects.empty(), "Thread is not waiting for anything"); | 532 | ASSERT_MSG(!wait_objects.empty(), "Thread is not waiting for anything"); |
| 533 | auto match = std::find(wait_objects.rbegin(), wait_objects.rend(), object); | 533 | auto match = std::find(wait_objects.rbegin(), wait_objects.rend(), object); |
| 534 | return std::distance(match, wait_objects.rend()) - 1; | 534 | return static_cast<s32>(std::distance(match, wait_objects.rend()) - 1); |
| 535 | } | 535 | } |
| 536 | 536 | ||
| 537 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 537 | //////////////////////////////////////////////////////////////////////////////////////////////////// |