summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-12-21 13:45:27 -0500
committerGravatar GitHub2018-12-21 13:45:27 -0500
commit59ac3346ebe605bfb0f538d9fa045b32d86168cb (patch)
treed2793ede352840b4326cc7c56fc8e7b7a3e6670f /src/core/hle/kernel/kernel.cpp
parentMerge pull request #1914 from lioncash/id (diff)
parentkernel/svc: Handle thread handles within GetProcessId (diff)
downloadyuzu-59ac3346ebe605bfb0f538d9fa045b32d86168cb.tar.gz
yuzu-59ac3346ebe605bfb0f538d9fa045b32d86168cb.tar.xz
yuzu-59ac3346ebe605bfb0f538d9fa045b32d86168cb.zip
Merge pull request #1925 from lioncash/pid
kernel/{process, thread}: Amend behavior related to IDs
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index e441c5bc6..1c2290651 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -112,7 +112,7 @@ struct KernelCore::Impl {
112 112
113 void Shutdown() { 113 void Shutdown() {
114 next_object_id = 0; 114 next_object_id = 0;
115 next_process_id = 10; 115 next_process_id = Process::ProcessIDMin;
116 next_thread_id = 1; 116 next_thread_id = 1;
117 117
118 process_list.clear(); 118 process_list.clear();
@@ -153,10 +153,8 @@ struct KernelCore::Impl {
153 } 153 }
154 154
155 std::atomic<u32> next_object_id{0}; 155 std::atomic<u32> next_object_id{0};
156 // TODO(Subv): Start the process ids from 10 for now, as lower PIDs are 156 std::atomic<u64> next_process_id{Process::ProcessIDMin};
157 // reserved for low-level services 157 std::atomic<u64> next_thread_id{1};
158 std::atomic<u32> next_process_id{10};
159 std::atomic<u32> next_thread_id{1};
160 158
161 // Lists all processes that exist in the current session. 159 // Lists all processes that exist in the current session.
162 std::vector<SharedPtr<Process>> process_list; 160 std::vector<SharedPtr<Process>> process_list;
@@ -242,11 +240,11 @@ u32 KernelCore::CreateNewObjectID() {
242 return impl->next_object_id++; 240 return impl->next_object_id++;
243} 241}
244 242
245u32 KernelCore::CreateNewThreadID() { 243u64 KernelCore::CreateNewThreadID() {
246 return impl->next_thread_id++; 244 return impl->next_thread_id++;
247} 245}
248 246
249u32 KernelCore::CreateNewProcessID() { 247u64 KernelCore::CreateNewProcessID() {
250 return impl->next_process_id++; 248 return impl->next_process_id++;
251} 249}
252 250