@@ -192,7 +192,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
192192}
193193
194194int copy_thread (unsigned long clone_flags , unsigned long spu ,
195- unsigned long arg , struct task_struct * tsk , struct pt_regs * regs )
195+ unsigned long arg , struct task_struct * tsk , struct pt_regs * unused )
196196{
197197 struct pt_regs * childregs = task_pt_regs (tsk );
198198 extern void ret_from_fork (void );
@@ -206,8 +206,9 @@ int copy_thread(unsigned long clone_flags, unsigned long spu,
206206 tsk -> thread .lr = (unsigned long )ret_from_kernel_thread ;
207207 } else {
208208 /* Copy registers */
209- * childregs = * regs ;
210- childregs -> spu = spu ;
209+ * childregs = * current_pt_regs ();
210+ if (spu )
211+ childregs -> spu = spu ;
211212 childregs -> r0 = 0 ; /* Child gets zero as return value */
212213 tsk -> thread .lr = (unsigned long )ret_from_fork ;
213214 }
@@ -216,45 +217,6 @@ int copy_thread(unsigned long clone_flags, unsigned long spu,
216217 return 0 ;
217218}
218219
219- asmlinkage int sys_fork (void )
220- {
221- #ifdef CONFIG_MMU
222- struct pt_regs * regs = current_pt_regs ();
223- return do_fork (SIGCHLD , regs -> spu , regs , 0 , NULL , NULL );
224- #else
225- return - EINVAL ;
226- #endif /* CONFIG_MMU */
227- }
228-
229- asmlinkage int sys_clone (unsigned long clone_flags , unsigned long newsp ,
230- unsigned long parent_tidptr ,
231- unsigned long child_tidptr )
232- {
233- struct pt_regs * regs = current_pt_regs ();
234- if (!newsp )
235- newsp = regs -> spu ;
236-
237- return do_fork (clone_flags , newsp , regs , 0 ,
238- (int __user * )parent_tidptr , (int __user * )child_tidptr );
239- }
240-
241- /*
242- * This is trivial, and on the face of it looks like it
243- * could equally well be done in user mode.
244- *
245- * Not so, for quite unobvious reasons - register pressure.
246- * In user mode vfork() cannot have a stack frame, and if
247- * done by calling the "clone()" system call directly, you
248- * do not have enough call-clobbered registers to hold all
249- * the information you need.
250- */
251- asmlinkage int sys_vfork (void )
252- {
253- struct pt_regs * regs = current_pt_regs ();
254- return do_fork (CLONE_VFORK | CLONE_VM | SIGCHLD , regs -> spu , regs , 0 ,
255- NULL , NULL );
256- }
257-
258220/*
259221 * These bracket the sleeping functions..
260222 */
0 commit comments