diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index ba7223db46..306dc6cdda 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -23,9 +23,6 @@ KernelSystem::KernelSystem(u32 system_mode) { resource_limits = std::make_unique(*this); Kernel::ThreadingInit(); Kernel::TimersInit(); - // TODO(Subv): Start the process ids from 10 for now, as lower PIDs are - // reserved for low-level services - Process::next_process_id = 10; } /// Shutdown the kernel diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 98a5d14a2a..015fbe87f8 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -183,6 +183,10 @@ public: private: std::unique_ptr resource_limits; std::atomic next_object_id{0}; + + // TODO(Subv): Start the process ids from 10 for now, as lower PIDs are + // reserved for low-level services + u32 next_process_id = 10; }; } // namespace Kernel diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index ae799d15fa..7f089a4c42 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -32,8 +32,6 @@ SharedPtr KernelSystem::CreateCodeSet(std::string name, u64 program_id) CodeSet::CodeSet(KernelSystem& kernel) : Object(kernel) {} CodeSet::~CodeSet() {} -u32 Process::next_process_id; - SharedPtr KernelSystem::CreateProcess(SharedPtr code_set) { SharedPtr process(new Process(*this)); @@ -41,6 +39,7 @@ SharedPtr KernelSystem::CreateProcess(SharedPtr code_set) { process->flags.raw = 0; process->flags.memory_region.Assign(MemoryRegion::APPLICATION); process->status = ProcessStatus::Created; + process->process_id = ++next_process_id; process_list.push_back(process); return process; diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index a141dff4c7..70be04ff54 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -123,8 +123,6 @@ public: return HANDLE_TYPE; } - static u32 next_process_id; - SharedPtr codeset; /// Resource limit descriptor for this process SharedPtr resource_limit; @@ -145,7 +143,7 @@ public: ProcessStatus status; /// The id of this process - u32 process_id = next_process_id++; + u32 process_id; /** * Parses a list of kernel capability descriptors (as found in the ExHeader) and applies them