]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sh/kernel/process_32.c
sh: arch/sh/kernel/smp.c needs linux/cpu.h for notify_cpu_starting().
[linux-2.6-omap-h63xx.git] / arch / sh / kernel / process_32.c
index 914e543102df1f9908dcf5653981929e0acba513..b965f0282c7dab650ec30fa1b02d532ed6674be5 100644 (file)
@@ -7,7 +7,11 @@
  *
  *  SuperH version:  Copyright (C) 1999, 2000  Niibe Yutaka & Kaz Kojima
  *                  Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC
- *                  Copyright (C) 2002 - 2007  Paul Mundt
+ *                  Copyright (C) 2002 - 2008  Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
  */
 #include <linux/module.h>
 #include <linux/mm.h>
@@ -169,6 +173,7 @@ __asm__(".align 5\n"
 int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 {
        struct pt_regs regs;
+       int pid;
 
        memset(&regs, 0, sizeof(regs));
        regs.regs[4] = (unsigned long)arg;
@@ -178,8 +183,12 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
        regs.sr = (1 << 30);
 
        /* Ok, create the new process.. */
-       return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
-                      &regs, 0, NULL, NULL);
+       pid = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
+                     &regs, 0, NULL, NULL);
+
+       trace_mark(kernel_arch_kthread_create, "pid %d fn %p", pid, fn);
+
+       return pid;
 }
 
 /*
@@ -217,10 +226,10 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
        struct task_struct *tsk = current;
 
        fpvalid = !!tsk_used_math(tsk);
-       if (fpvalid) {
-               unlazy_fpu(tsk, regs);
-               memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu));
-       }
+       if (fpvalid)
+               fpvalid = !fpregs_get(tsk, NULL, 0,
+                                     sizeof(struct user_fpu_struct),
+                                     fpu, NULL);
 #endif
 
        return fpvalid;