1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
4 #ifndef __ASM_CSKY_SWITCH_TO_H
5 #define __ASM_CSKY_SWITCH_TO_H
7 #include <linux/thread_info.h>
8 #ifdef CONFIG_CPU_HAS_FPU
10 static inline void __switch_to_fpu(struct task_struct
*prev
,
11 struct task_struct
*next
)
13 save_to_user_fp(&prev
->thread
.user_fp
);
14 restore_from_user_fp(&next
->thread
.user_fp
);
17 static inline void __switch_to_fpu(struct task_struct
*prev
,
18 struct task_struct
*next
)
23 * Context switching is now performed out-of-line in switch_to.S
25 extern struct task_struct
*__switch_to(struct task_struct
*,
26 struct task_struct
*);
28 #define switch_to(prev, next, last) \
30 struct task_struct *__prev = (prev); \
31 struct task_struct *__next = (next); \
32 __switch_to_fpu(__prev, __next); \
33 ((last) = __switch_to((prev), (next))); \
36 #endif /* __ASM_CSKY_SWITCH_TO_H */