diff options
| author | 2017-09-27 00:26:09 +0100 | |
|---|---|---|
| committer | 2017-09-30 09:34:35 +0100 | |
| commit | a13ab958cbba75bc9abd1ca50f3030a10a75784e (patch) | |
| tree | 016f6866d15fb9a41a15666f492bed352d95b523 /src/core/hle/kernel | |
| parent | Merge pull request #2961 from Subv/load_titles (diff) | |
| download | yuzu-a13ab958cbba75bc9abd1ca50f3030a10a75784e.tar.gz yuzu-a13ab958cbba75bc9abd1ca50f3030a10a75784e.tar.xz yuzu-a13ab958cbba75bc9abd1ca50f3030a10a75784e.zip | |
Fixed type conversion ambiguity
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/mutex.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/resource_limit.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/resource_limit.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/shared_memory.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/kernel/shared_memory.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 18 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.h | 14 | ||||
| -rw-r--r-- | src/core/hle/kernel/wait_object.cpp | 2 |
9 files changed, 24 insertions, 23 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 5ebe2eca4..6020e9764 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp | |||
| @@ -37,7 +37,7 @@ SharedPtr<Object> HLERequestContext::GetIncomingHandle(u32 id_from_cmdbuf) const | |||
| 37 | 37 | ||
| 38 | u32 HLERequestContext::AddOutgoingHandle(SharedPtr<Object> object) { | 38 | u32 HLERequestContext::AddOutgoingHandle(SharedPtr<Object> object) { |
| 39 | request_handles.push_back(std::move(object)); | 39 | request_handles.push_back(std::move(object)); |
| 40 | return request_handles.size() - 1; | 40 | return static_cast<u32>(request_handles.size() - 1); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | void HLERequestContext::ClearIncomingObjects() { | 43 | void HLERequestContext::ClearIncomingObjects() { |
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index cef961289..2cbca5e5b 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp | |||
| @@ -90,7 +90,7 @@ void Mutex::UpdatePriority() { | |||
| 90 | if (!holding_thread) | 90 | if (!holding_thread) |
| 91 | return; | 91 | return; |
| 92 | 92 | ||
| 93 | s32 best_priority = THREADPRIO_LOWEST; | 93 | u32 best_priority = THREADPRIO_LOWEST; |
| 94 | for (auto& waiter : GetWaitingThreads()) { | 94 | for (auto& waiter : GetWaitingThreads()) { |
| 95 | if (waiter->current_priority < best_priority) | 95 | if (waiter->current_priority < best_priority) |
| 96 | best_priority = waiter->current_priority; | 96 | best_priority = waiter->current_priority; |
diff --git a/src/core/hle/kernel/resource_limit.cpp b/src/core/hle/kernel/resource_limit.cpp index a8f10a3ee..517dc47a8 100644 --- a/src/core/hle/kernel/resource_limit.cpp +++ b/src/core/hle/kernel/resource_limit.cpp | |||
| @@ -61,7 +61,7 @@ s32 ResourceLimit::GetCurrentResourceValue(u32 resource) const { | |||
| 61 | } | 61 | } |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | s32 ResourceLimit::GetMaxResourceValue(u32 resource) const { | 64 | u32 ResourceLimit::GetMaxResourceValue(u32 resource) const { |
| 65 | switch (resource) { | 65 | switch (resource) { |
| 66 | case PRIORITY: | 66 | case PRIORITY: |
| 67 | return max_priority; | 67 | return max_priority; |
diff --git a/src/core/hle/kernel/resource_limit.h b/src/core/hle/kernel/resource_limit.h index 6cdfbcf8d..42874eb8d 100644 --- a/src/core/hle/kernel/resource_limit.h +++ b/src/core/hle/kernel/resource_limit.h | |||
| @@ -67,7 +67,7 @@ public: | |||
| 67 | * @param resource Requested resource type | 67 | * @param resource Requested resource type |
| 68 | * @returns The max value of the resource type | 68 | * @returns The max value of the resource type |
| 69 | */ | 69 | */ |
| 70 | s32 GetMaxResourceValue(u32 resource) const; | 70 | u32 GetMaxResourceValue(u32 resource) const; |
| 71 | 71 | ||
| 72 | /// Name of resource limit object. | 72 | /// Name of resource limit object. |
| 73 | std::string name; | 73 | std::string name; |
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index a7b66142f..02d5a7a36 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp | |||
| @@ -42,7 +42,8 @@ SharedPtr<SharedMemory> SharedMemory::Create(SharedPtr<Process> owner_process, u | |||
| 42 | memory_region->used += size; | 42 | memory_region->used += size; |
| 43 | 43 | ||
| 44 | shared_memory->linear_heap_phys_address = | 44 | shared_memory->linear_heap_phys_address = |
| 45 | Memory::FCRAM_PADDR + memory_region->base + shared_memory->backing_block_offset; | 45 | Memory::FCRAM_PADDR + memory_region->base + |
| 46 | static_cast<PAddr>(shared_memory->backing_block_offset); | ||
| 46 | 47 | ||
| 47 | // Increase the amount of used linear heap memory for the owner process. | 48 | // Increase the amount of used linear heap memory for the owner process. |
| 48 | if (shared_memory->owner_process != nullptr) { | 49 | if (shared_memory->owner_process != nullptr) { |
diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h index 94b335ed1..93a6f2182 100644 --- a/src/core/hle/kernel/shared_memory.h +++ b/src/core/hle/kernel/shared_memory.h | |||
| @@ -114,7 +114,7 @@ public: | |||
| 114 | /// Backing memory for this shared memory block. | 114 | /// Backing memory for this shared memory block. |
| 115 | std::shared_ptr<std::vector<u8>> backing_block; | 115 | std::shared_ptr<std::vector<u8>> backing_block; |
| 116 | /// Offset into the backing block for this shared memory. | 116 | /// Offset into the backing block for this shared memory. |
| 117 | u32 backing_block_offset; | 117 | size_t backing_block_offset; |
| 118 | /// Size of the memory block. Page-aligned. | 118 | /// Size of the memory block. Page-aligned. |
| 119 | u32 size; | 119 | u32 size; |
| 120 | /// Permission restrictions applied to the process which created the block. | 120 | /// Permission restrictions applied to the process which created the block. |
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 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index ddc0d15c5..f02e1d43a 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include "core/hle/kernel/wait_object.h" | 15 | #include "core/hle/kernel/wait_object.h" |
| 16 | #include "core/hle/result.h" | 16 | #include "core/hle/result.h" |
| 17 | 17 | ||
| 18 | enum ThreadPriority : s32 { | 18 | enum ThreadPriority : u32 { |
| 19 | THREADPRIO_HIGHEST = 0, ///< Highest thread priority | 19 | THREADPRIO_HIGHEST = 0, ///< Highest thread priority |
| 20 | THREADPRIO_USERLAND_MAX = 24, ///< Highest thread priority for userland apps | 20 | THREADPRIO_USERLAND_MAX = 24, ///< Highest thread priority for userland apps |
| 21 | THREADPRIO_DEFAULT = 48, ///< Default thread priority for userland apps | 21 | THREADPRIO_DEFAULT = 48, ///< Default thread priority for userland apps |
| @@ -82,7 +82,7 @@ public: | |||
| 82 | * Gets the thread's current priority | 82 | * Gets the thread's current priority |
| 83 | * @return The current thread's priority | 83 | * @return The current thread's priority |
| 84 | */ | 84 | */ |
| 85 | s32 GetPriority() const { | 85 | u32 GetPriority() const { |
| 86 | return current_priority; | 86 | return current_priority; |
| 87 | } | 87 | } |
| 88 | 88 | ||
| @@ -90,7 +90,7 @@ public: | |||
| 90 | * Sets the thread's current priority | 90 | * Sets the thread's current priority |
| 91 | * @param priority The new priority | 91 | * @param priority The new priority |
| 92 | */ | 92 | */ |
| 93 | void SetPriority(s32 priority); | 93 | void SetPriority(u32 priority); |
| 94 | 94 | ||
| 95 | /** | 95 | /** |
| 96 | * Boost's a thread's priority to the best priority among the thread's held mutexes. | 96 | * Boost's a thread's priority to the best priority among the thread's held mutexes. |
| @@ -102,7 +102,7 @@ public: | |||
| 102 | * Temporarily boosts the thread's priority until the next time it is scheduled | 102 | * Temporarily boosts the thread's priority until the next time it is scheduled |
| 103 | * @param priority The new priority | 103 | * @param priority The new priority |
| 104 | */ | 104 | */ |
| 105 | void BoostPriority(s32 priority); | 105 | void BoostPriority(u32 priority); |
| 106 | 106 | ||
| 107 | /** | 107 | /** |
| 108 | * Gets the thread's thread ID | 108 | * Gets the thread's thread ID |
| @@ -176,8 +176,8 @@ public: | |||
| 176 | u32 entry_point; | 176 | u32 entry_point; |
| 177 | u32 stack_top; | 177 | u32 stack_top; |
| 178 | 178 | ||
| 179 | s32 nominal_priority; ///< Nominal thread priority, as set by the emulated application | 179 | u32 nominal_priority; ///< Nominal thread priority, as set by the emulated application |
| 180 | s32 current_priority; ///< Current thread priority, can be temporarily changed | 180 | u32 current_priority; ///< Current thread priority, can be temporarily changed |
| 181 | 181 | ||
| 182 | u64 last_running_ticks; ///< CPU tick when thread was last running | 182 | u64 last_running_ticks; ///< CPU tick when thread was last running |
| 183 | 183 | ||
| @@ -219,7 +219,7 @@ private: | |||
| 219 | * @param owner_process The parent process for the main thread | 219 | * @param owner_process The parent process for the main thread |
| 220 | * @return A shared pointer to the main thread | 220 | * @return A shared pointer to the main thread |
| 221 | */ | 221 | */ |
| 222 | SharedPtr<Thread> SetupMainThread(u32 entry_point, s32 priority, SharedPtr<Process> owner_process); | 222 | SharedPtr<Thread> SetupMainThread(u32 entry_point, u32 priority, SharedPtr<Process> owner_process); |
| 223 | 223 | ||
| 224 | /** | 224 | /** |
| 225 | * Returns whether there are any threads that are ready to run. | 225 | * Returns whether there are any threads that are ready to run. |
diff --git a/src/core/hle/kernel/wait_object.cpp b/src/core/hle/kernel/wait_object.cpp index f245eda6c..56fdd977f 100644 --- a/src/core/hle/kernel/wait_object.cpp +++ b/src/core/hle/kernel/wait_object.cpp | |||
| @@ -34,7 +34,7 @@ void WaitObject::RemoveWaitingThread(Thread* thread) { | |||
| 34 | 34 | ||
| 35 | SharedPtr<Thread> WaitObject::GetHighestPriorityReadyThread() { | 35 | SharedPtr<Thread> WaitObject::GetHighestPriorityReadyThread() { |
| 36 | Thread* candidate = nullptr; | 36 | Thread* candidate = nullptr; |
| 37 | s32 candidate_priority = THREADPRIO_LOWEST + 1; | 37 | u32 candidate_priority = THREADPRIO_LOWEST + 1; |
| 38 | 38 | ||
| 39 | for (const auto& thread : waiting_threads) { | 39 | for (const auto& thread : waiting_threads) { |
| 40 | // The list of waiting threads must not contain threads that are not waiting to be awakened. | 40 | // The list of waiting threads must not contain threads that are not waiting to be awakened. |