diff options
| author | 2018-12-18 22:37:01 -0500 | |
|---|---|---|
| committer | 2018-12-18 22:37:03 -0500 | |
| commit | 8435451093b193c1a1556a9edadc5663d3372b02 (patch) | |
| tree | a162bf2b2482784bb1fe69ea27bc64c9d49c3424 /src | |
| parent | kernel/svc: Correct output parameter for svcGetProcessId (diff) | |
| download | yuzu-8435451093b193c1a1556a9edadc5663d3372b02.tar.gz yuzu-8435451093b193c1a1556a9edadc5663d3372b02.tar.xz yuzu-8435451093b193c1a1556a9edadc5663d3372b02.zip | |
kernel/thread: Make thread_id a 64-bit value
The kernel uses a 64-bit value for the thread ID, so we shouldn't be
using a 32-bit value.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/gdbstub/gdbstub.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.h | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index e6b5171ee..a1cad4fcb 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp | |||
| @@ -201,11 +201,11 @@ void RegisterModule(std::string name, VAddr beg, VAddr end, bool add_elf_ext) { | |||
| 201 | modules.push_back(std::move(module)); | 201 | modules.push_back(std::move(module)); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | static Kernel::Thread* FindThreadById(int id) { | 204 | static Kernel::Thread* FindThreadById(s64 id) { |
| 205 | for (u32 core = 0; core < Core::NUM_CPU_CORES; core++) { | 205 | for (u32 core = 0; core < Core::NUM_CPU_CORES; core++) { |
| 206 | const auto& threads = Core::System::GetInstance().Scheduler(core).GetThreadList(); | 206 | const auto& threads = Core::System::GetInstance().Scheduler(core).GetThreadList(); |
| 207 | for (auto& thread : threads) { | 207 | for (auto& thread : threads) { |
| 208 | if (thread->GetThreadID() == static_cast<u32>(id)) { | 208 | if (thread->GetThreadID() == static_cast<u64>(id)) { |
| 209 | current_core = core; | 209 | current_core = core; |
| 210 | return thread.get(); | 210 | return thread.get(); |
| 211 | } | 211 | } |
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index a221734c1..2be39fb52 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -156,7 +156,7 @@ struct KernelCore::Impl { | |||
| 156 | // TODO(Subv): Start the process ids from 10 for now, as lower PIDs are | 156 | // TODO(Subv): Start the process ids from 10 for now, as lower PIDs are |
| 157 | // reserved for low-level services | 157 | // reserved for low-level services |
| 158 | std::atomic<u64> next_process_id{10}; | 158 | std::atomic<u64> next_process_id{10}; |
| 159 | std::atomic<u32> next_thread_id{1}; | 159 | std::atomic<u64> next_thread_id{1}; |
| 160 | 160 | ||
| 161 | // Lists all processes that exist in the current session. | 161 | // Lists all processes that exist in the current session. |
| 162 | std::vector<SharedPtr<Process>> process_list; | 162 | std::vector<SharedPtr<Process>> process_list; |
| @@ -242,7 +242,7 @@ u32 KernelCore::CreateNewObjectID() { | |||
| 242 | return impl->next_object_id++; | 242 | return impl->next_object_id++; |
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | u32 KernelCore::CreateNewThreadID() { | 245 | u64 KernelCore::CreateNewThreadID() { |
| 246 | return impl->next_thread_id++; | 246 | return impl->next_thread_id++; |
| 247 | } | 247 | } |
| 248 | 248 | ||
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 4f0f2331c..58c9d108b 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -91,7 +91,7 @@ private: | |||
| 91 | u64 CreateNewProcessID(); | 91 | u64 CreateNewProcessID(); |
| 92 | 92 | ||
| 93 | /// Creates a new thread ID, incrementing the internal thread ID counter. | 93 | /// Creates a new thread ID, incrementing the internal thread ID counter. |
| 94 | u32 CreateNewThreadID(); | 94 | u64 CreateNewThreadID(); |
| 95 | 95 | ||
| 96 | /// Creates a timer callback handle for the given timer. | 96 | /// Creates a timer callback handle for the given timer. |
| 97 | ResultVal<Handle> CreateTimerCallbackHandle(const SharedPtr<Timer>& timer); | 97 | ResultVal<Handle> CreateTimerCallbackHandle(const SharedPtr<Timer>& timer); |
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 77aec099a..d6e7981d3 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -151,7 +151,7 @@ public: | |||
| 151 | * Gets the thread's thread ID | 151 | * Gets the thread's thread ID |
| 152 | * @return The thread's ID | 152 | * @return The thread's ID |
| 153 | */ | 153 | */ |
| 154 | u32 GetThreadID() const { | 154 | u64 GetThreadID() const { |
| 155 | return thread_id; | 155 | return thread_id; |
| 156 | } | 156 | } |
| 157 | 157 | ||
| @@ -379,7 +379,7 @@ private: | |||
| 379 | 379 | ||
| 380 | Core::ARM_Interface::ThreadContext context{}; | 380 | Core::ARM_Interface::ThreadContext context{}; |
| 381 | 381 | ||
| 382 | u32 thread_id = 0; | 382 | u64 thread_id = 0; |
| 383 | 383 | ||
| 384 | ThreadStatus status = ThreadStatus::Dormant; | 384 | ThreadStatus status = ThreadStatus::Dormant; |
| 385 | 385 | ||