fork: move the real prepare_to_copy() users to arch_dup_task_struct()
[linux-2.6-block.git] / arch / powerpc / kernel / process.c
index 4937c9690090d0e9bf3809b7ae923ae24d181d93..bc129f24e11f1972112c6e738e9ea526adfde2d1 100644 (file)
@@ -711,18 +711,21 @@ release_thread(struct task_struct *t)
 }
 
 /*
- * This gets called before we allocate a new thread and copy
- * the current task into it.
+ * this gets called so that we can store coprocessor state into memory and
+ * copy the current task into the new thread.
  */
-void prepare_to_copy(struct task_struct *tsk)
+int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
 {
-       flush_fp_to_thread(current);
-       flush_altivec_to_thread(current);
-       flush_vsx_to_thread(current);
-       flush_spe_to_thread(current);
+       flush_fp_to_thread(src);
+       flush_altivec_to_thread(src);
+       flush_vsx_to_thread(src);
+       flush_spe_to_thread(src);
 #ifdef CONFIG_HAVE_HW_BREAKPOINT
-       flush_ptrace_hw_breakpoint(tsk);
+       flush_ptrace_hw_breakpoint(src);
 #endif /* CONFIG_HAVE_HW_BREAKPOINT */
+
+       *dst = *src;
+       return 0;
 }
 
 /*