aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel/process.c')
-rw-r--r--arch/parisc/kernel/process.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 8a488c22a99f..809905a811ed 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -181,9 +181,12 @@ int dump_task_fpu (struct task_struct *tsk, elf_fpregset_t *r)
181 return 1; 181 return 1;
182} 182}
183 183
184/*
185 * Copy architecture-specific thread state
186 */
184int 187int
185copy_thread(unsigned long clone_flags, unsigned long usp, 188copy_thread(unsigned long clone_flags, unsigned long usp,
186 unsigned long arg, struct task_struct *p) 189 unsigned long kthread_arg, struct task_struct *p)
187{ 190{
188 struct pt_regs *cregs = &(p->thread.regs); 191 struct pt_regs *cregs = &(p->thread.regs);
189 void *stack = task_stack_page(p); 192 void *stack = task_stack_page(p);
@@ -195,11 +198,10 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
195 extern void * const child_return; 198 extern void * const child_return;
196 199
197 if (unlikely(p->flags & PF_KTHREAD)) { 200 if (unlikely(p->flags & PF_KTHREAD)) {
201 /* kernel thread */
198 memset(cregs, 0, sizeof(struct pt_regs)); 202 memset(cregs, 0, sizeof(struct pt_regs));
199 if (!usp) /* idle thread */ 203 if (!usp) /* idle thread */
200 return 0; 204 return 0;
201
202 /* kernel thread */
203 /* Must exit via ret_from_kernel_thread in order 205 /* Must exit via ret_from_kernel_thread in order
204 * to call schedule_tail() 206 * to call schedule_tail()
205 */ 207 */
@@ -215,7 +217,7 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
215#else 217#else
216 cregs->gr[26] = usp; 218 cregs->gr[26] = usp;
217#endif 219#endif
218 cregs->gr[25] = arg; 220 cregs->gr[25] = kthread_arg;
219 } else { 221 } else {
220 /* user thread */ 222 /* user thread */
221 /* usp must be word aligned. This also prevents users from 223 /* usp must be word aligned. This also prevents users from