summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/process.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/process.h')
-rw-r--r--src/core/hle/kernel/process.h21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h
index 992689186..1587d40c1 100644
--- a/src/core/hle/kernel/process.h
+++ b/src/core/hle/kernel/process.h
@@ -19,6 +19,8 @@
19 19
20namespace Kernel { 20namespace Kernel {
21 21
22class KernelCore;
23
22struct AddressMapping { 24struct AddressMapping {
23 // Address and size must be page-aligned 25 // Address and size must be page-aligned
24 VAddr address; 26 VAddr address;
@@ -62,7 +64,7 @@ struct CodeSet final : public Object {
62 u32 size = 0; 64 u32 size = 0;
63 }; 65 };
64 66
65 static SharedPtr<CodeSet> Create(std::string name); 67 static SharedPtr<CodeSet> Create(KernelCore& kernel, std::string name);
66 68
67 std::string GetTypeName() const override { 69 std::string GetTypeName() const override {
68 return "CodeSet"; 70 return "CodeSet";
@@ -109,13 +111,13 @@ struct CodeSet final : public Object {
109 std::string name; 111 std::string name;
110 112
111private: 113private:
112 CodeSet(); 114 explicit CodeSet(KernelCore& kernel);
113 ~CodeSet() override; 115 ~CodeSet() override;
114}; 116};
115 117
116class Process final : public Object { 118class Process final : public Object {
117public: 119public:
118 static SharedPtr<Process> Create(std::string&& name); 120 static SharedPtr<Process> Create(KernelCore& kernel, std::string&& name);
119 121
120 std::string GetTypeName() const override { 122 std::string GetTypeName() const override {
121 return "Process"; 123 return "Process";
@@ -129,8 +131,6 @@ public:
129 return HANDLE_TYPE; 131 return HANDLE_TYPE;
130 } 132 }
131 133
132 static u32 next_process_id;
133
134 /// Title ID corresponding to the process 134 /// Title ID corresponding to the process
135 u64 program_id; 135 u64 program_id;
136 136
@@ -157,8 +157,8 @@ public:
157 /// Current status of the process 157 /// Current status of the process
158 ProcessStatus status; 158 ProcessStatus status;
159 159
160 /// The id of this process 160 /// The ID of this process
161 u32 process_id = next_process_id++; 161 u32 process_id = 0;
162 162
163 /** 163 /**
164 * Parses a list of kernel capability descriptors (as found in the ExHeader) and applies them 164 * Parses a list of kernel capability descriptors (as found in the ExHeader) and applies them
@@ -206,13 +206,8 @@ public:
206 ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size); 206 ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size);
207 207
208private: 208private:
209 Process(); 209 explicit Process(KernelCore& kernel);
210 ~Process() override; 210 ~Process() override;
211}; 211};
212 212
213void ClearProcessList();
214
215/// Retrieves a process from the current list of processes.
216SharedPtr<Process> GetProcessById(u32 process_id);
217
218} // namespace Kernel 213} // namespace Kernel