diff options
Diffstat (limited to 'arch/um/kernel/skas/process_kern.c')
-rw-r--r-- | arch/um/kernel/skas/process_kern.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c index 0a7b8aa55db8..cbabab104ac3 100644 --- a/arch/um/kernel/skas/process_kern.c +++ b/arch/um/kernel/skas/process_kern.c | |||
@@ -175,9 +175,12 @@ static int start_kernel_proc(void *unused) | |||
175 | return(0); | 175 | return(0); |
176 | } | 176 | } |
177 | 177 | ||
178 | extern int userspace_pid[]; | ||
179 | |||
178 | int start_uml_skas(void) | 180 | int start_uml_skas(void) |
179 | { | 181 | { |
180 | start_userspace(0); | 182 | if(proc_mm) |
183 | userspace_pid[0] = start_userspace(0); | ||
181 | 184 | ||
182 | init_new_thread_signals(1); | 185 | init_new_thread_signals(1); |
183 | 186 | ||
@@ -199,3 +202,31 @@ int thread_pid_skas(struct task_struct *task) | |||
199 | #warning Need to look up userspace_pid by cpu | 202 | #warning Need to look up userspace_pid by cpu |
200 | return(userspace_pid[0]); | 203 | return(userspace_pid[0]); |
201 | } | 204 | } |
205 | |||
206 | void kill_off_processes_skas(void) | ||
207 | { | ||
208 | if(proc_mm) | ||
209 | #warning need to loop over userspace_pids in kill_off_processes_skas | ||
210 | os_kill_ptraced_process(userspace_pid[0], 1); | ||
211 | else { | ||
212 | struct task_struct *p; | ||
213 | int pid, me; | ||
214 | |||
215 | me = os_getpid(); | ||
216 | for_each_process(p){ | ||
217 | if(p->mm == NULL) | ||
218 | continue; | ||
219 | |||
220 | pid = p->mm->context.skas.id.u.pid; | ||
221 | os_kill_ptraced_process(pid, 1); | ||
222 | } | ||
223 | } | ||
224 | } | ||
225 | |||
226 | unsigned long current_stub_stack(void) | ||
227 | { | ||
228 | if(current->mm == NULL) | ||
229 | return(0); | ||
230 | |||
231 | return(current->mm->context.skas.id.stack); | ||
232 | } | ||