mirror of
https://git.h3cjp.net/H3cJP/citra.git
synced 2024-11-23 23:32:47 +00:00
kernel/process: move next_process_id to kernel instance
This commit is contained in:
parent
129ca865b3
commit
4238754d8c
|
@ -23,9 +23,6 @@ KernelSystem::KernelSystem(u32 system_mode) {
|
|||
resource_limits = std::make_unique<ResourceLimitList>(*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
|
||||
|
|
|
@ -183,6 +183,10 @@ public:
|
|||
private:
|
||||
std::unique_ptr<ResourceLimitList> resource_limits;
|
||||
std::atomic<u32> 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
|
||||
|
|
|
@ -32,8 +32,6 @@ SharedPtr<CodeSet> KernelSystem::CreateCodeSet(std::string name, u64 program_id)
|
|||
CodeSet::CodeSet(KernelSystem& kernel) : Object(kernel) {}
|
||||
CodeSet::~CodeSet() {}
|
||||
|
||||
u32 Process::next_process_id;
|
||||
|
||||
SharedPtr<Process> KernelSystem::CreateProcess(SharedPtr<CodeSet> code_set) {
|
||||
SharedPtr<Process> process(new Process(*this));
|
||||
|
||||
|
@ -41,6 +39,7 @@ SharedPtr<Process> KernelSystem::CreateProcess(SharedPtr<CodeSet> 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;
|
||||
|
|
|
@ -123,8 +123,6 @@ public:
|
|||
return HANDLE_TYPE;
|
||||
}
|
||||
|
||||
static u32 next_process_id;
|
||||
|
||||
SharedPtr<CodeSet> codeset;
|
||||
/// Resource limit descriptor for this process
|
||||
SharedPtr<ResourceLimit> 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
|
||||
|
|
Loading…
Reference in a new issue