summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/process.h
diff options
context:
space:
mode:
authorGravatar Lioncash2018-09-21 02:06:47 -0400
committerGravatar Lioncash2018-09-21 06:07:41 -0400
commit48b2eda492c064eeaf5af3716a9855b082eb2df7 (patch)
tree2a86155b190bfa5326f83444dab3f2b6c5c3da47 /src/core/hle/kernel/process.h
parentthread/process: Move TLS slot marking/freeing to the process class (diff)
downloadyuzu-48b2eda492c064eeaf5af3716a9855b082eb2df7.tar.gz
yuzu-48b2eda492c064eeaf5af3716a9855b082eb2df7.tar.xz
yuzu-48b2eda492c064eeaf5af3716a9855b082eb2df7.zip
svc: Move most process termination code to its own function within Process
Reduces the use of Process class members externally and keeps most code related to tearing down a process with the rest of the process code.
Diffstat (limited to 'src/core/hle/kernel/process.h')
-rw-r--r--src/core/hle/kernel/process.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h
index 84027a31a..04d74e572 100644
--- a/src/core/hle/kernel/process.h
+++ b/src/core/hle/kernel/process.h
@@ -131,6 +131,16 @@ public:
131 return HANDLE_TYPE; 131 return HANDLE_TYPE;
132 } 132 }
133 133
134 /// Gets the current status of the process
135 ProcessStatus GetStatus() const {
136 return status;
137 }
138
139 /// Gets the unique ID that identifies this particular process.
140 u32 GetProcessID() const {
141 return process_id;
142 }
143
134 /// Title ID corresponding to the process 144 /// Title ID corresponding to the process
135 u64 program_id; 145 u64 program_id;
136 146
@@ -154,11 +164,6 @@ public:
154 u32 allowed_processor_mask = THREADPROCESSORID_DEFAULT_MASK; 164 u32 allowed_processor_mask = THREADPROCESSORID_DEFAULT_MASK;
155 u32 allowed_thread_priority_mask = 0xFFFFFFFF; 165 u32 allowed_thread_priority_mask = 0xFFFFFFFF;
156 u32 is_virtual_address_memory_enabled = 0; 166 u32 is_virtual_address_memory_enabled = 0;
157 /// Current status of the process
158 ProcessStatus status;
159
160 /// The ID of this process
161 u32 process_id = 0;
162 167
163 /** 168 /**
164 * Parses a list of kernel capability descriptors (as found in the ExHeader) and applies them 169 * Parses a list of kernel capability descriptors (as found in the ExHeader) and applies them
@@ -171,6 +176,12 @@ public:
171 */ 176 */
172 void Run(VAddr entry_point, s32 main_thread_priority, u32 stack_size); 177 void Run(VAddr entry_point, s32 main_thread_priority, u32 stack_size);
173 178
179 /**
180 * Prepares a process for termination by stopping all of its threads
181 * and clearing any other resources.
182 */
183 void PrepareForTermination();
184
174 void LoadModule(SharedPtr<CodeSet> module_, VAddr base_addr); 185 void LoadModule(SharedPtr<CodeSet> module_, VAddr base_addr);
175 186
176 /////////////////////////////////////////////////////////////////////////////////////////////// 187 ///////////////////////////////////////////////////////////////////////////////////////////////
@@ -195,6 +206,12 @@ private:
195 explicit Process(KernelCore& kernel); 206 explicit Process(KernelCore& kernel);
196 ~Process() override; 207 ~Process() override;
197 208
209 /// Current status of the process
210 ProcessStatus status;
211
212 /// The ID of this process
213 u32 process_id = 0;
214
198 // Memory used to back the allocations in the regular heap. A single vector is used to cover 215 // Memory used to back the allocations in the regular heap. A single vector is used to cover
199 // the entire virtual address space extents that bound the allocations, including any holes. 216 // the entire virtual address space extents that bound the allocations, including any holes.
200 // This makes deallocation and reallocation of holes fast and keeps process memory contiguous 217 // This makes deallocation and reallocation of holes fast and keeps process memory contiguous