Merge branch 'arch-microblaze' into no-rebases
[firefly-linux-kernel-4.4.55.git] / arch / sparc / include / asm / processor_64.h
index 721e25f0e2ea80f19d4a7868791d4653097a2124..cce72ce4c33499c21d20b31cf69f28bfa189d239 100644 (file)
@@ -94,6 +94,7 @@ struct thread_struct {
 #ifndef __ASSEMBLY__
 
 #include <linux/types.h>
+#include <asm/fpumacro.h>
 
 /* Return saved PC of a blocked thread. */
 struct task_struct;
@@ -143,6 +144,10 @@ do { \
        : \
        : "r" (regs), "r" (sp - sizeof(struct reg_window) - STACK_BIAS), \
          "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); \
+       fprs_write(0);  \
+       current_thread_info()->xfsr[0] = 0;     \
+       current_thread_info()->fpsaved[0] = 0;  \
+       regs->tstate &= ~TSTATE_PEF;    \
 } while (0)
 
 #define start_thread32(regs, pc, sp) \
@@ -183,13 +188,15 @@ do { \
        : \
        : "r" (regs), "r" (sp - sizeof(struct reg_window32)), \
          "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); \
+       fprs_write(0);  \
+       current_thread_info()->xfsr[0] = 0;     \
+       current_thread_info()->fpsaved[0] = 0;  \
+       regs->tstate &= ~TSTATE_PEF;    \
 } while (0)
 
 /* Free all resources held by a thread. */
 #define release_thread(tsk)            do { } while (0)
 
-extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
-
 extern unsigned long get_wchan(struct task_struct *task);
 
 #define task_pt_regs(tsk) (task_thread_info(tsk)->kregs)