diff options
Diffstat (limited to 'arch/mips/include/asm/switch_to.h')
-rw-r--r-- | arch/mips/include/asm/switch_to.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/arch/mips/include/asm/switch_to.h b/arch/mips/include/asm/switch_to.h index 278d45a09728..495c1041a2cc 100644 --- a/arch/mips/include/asm/switch_to.h +++ b/arch/mips/include/asm/switch_to.h | |||
@@ -16,22 +16,29 @@ | |||
16 | #include <asm/watch.h> | 16 | #include <asm/watch.h> |
17 | #include <asm/dsp.h> | 17 | #include <asm/dsp.h> |
18 | #include <asm/cop2.h> | 18 | #include <asm/cop2.h> |
19 | #include <asm/msa.h> | ||
19 | 20 | ||
20 | struct task_struct; | 21 | struct task_struct; |
21 | 22 | ||
23 | enum { | ||
24 | FP_SAVE_NONE = 0, | ||
25 | FP_SAVE_VECTOR = -1, | ||
26 | FP_SAVE_SCALAR = 1, | ||
27 | }; | ||
28 | |||
22 | /** | 29 | /** |
23 | * resume - resume execution of a task | 30 | * resume - resume execution of a task |
24 | * @prev: The task previously executed. | 31 | * @prev: The task previously executed. |
25 | * @next: The task to begin executing. | 32 | * @next: The task to begin executing. |
26 | * @next_ti: task_thread_info(next). | 33 | * @next_ti: task_thread_info(next). |
27 | * @usedfpu: Non-zero if prev's FP context should be saved. | 34 | * @fp_save: Which, if any, FP context to save for prev. |
28 | * | 35 | * |
29 | * This function is used whilst scheduling to save the context of prev & load | 36 | * This function is used whilst scheduling to save the context of prev & load |
30 | * the context of next. Returns prev. | 37 | * the context of next. Returns prev. |
31 | */ | 38 | */ |
32 | extern asmlinkage struct task_struct *resume(struct task_struct *prev, | 39 | extern asmlinkage struct task_struct *resume(struct task_struct *prev, |
33 | struct task_struct *next, struct thread_info *next_ti, | 40 | struct task_struct *next, struct thread_info *next_ti, |
34 | u32 usedfpu); | 41 | s32 fp_save); |
35 | 42 | ||
36 | extern unsigned int ll_bit; | 43 | extern unsigned int ll_bit; |
37 | extern struct task_struct *ll_task; | 44 | extern struct task_struct *ll_task; |
@@ -75,7 +82,8 @@ do { \ | |||
75 | 82 | ||
76 | #define switch_to(prev, next, last) \ | 83 | #define switch_to(prev, next, last) \ |
77 | do { \ | 84 | do { \ |
78 | u32 __usedfpu, __c0_stat; \ | 85 | u32 __c0_stat; \ |
86 | s32 __fpsave = FP_SAVE_NONE; \ | ||
79 | __mips_mt_fpaff_switch_to(prev); \ | 87 | __mips_mt_fpaff_switch_to(prev); \ |
80 | if (cpu_has_dsp) \ | 88 | if (cpu_has_dsp) \ |
81 | __save_dsp(prev); \ | 89 | __save_dsp(prev); \ |
@@ -88,8 +96,12 @@ do { \ | |||
88 | write_c0_status(__c0_stat & ~ST0_CU2); \ | 96 | write_c0_status(__c0_stat & ~ST0_CU2); \ |
89 | } \ | 97 | } \ |
90 | __clear_software_ll_bit(); \ | 98 | __clear_software_ll_bit(); \ |
91 | __usedfpu = test_and_clear_tsk_thread_flag(prev, TIF_USEDFPU); \ | 99 | if (test_and_clear_tsk_thread_flag(prev, TIF_USEDFPU)) \ |
92 | (last) = resume(prev, next, task_thread_info(next), __usedfpu); \ | 100 | __fpsave = FP_SAVE_SCALAR; \ |
101 | if (test_and_clear_tsk_thread_flag(prev, TIF_USEDMSA)) \ | ||
102 | __fpsave = FP_SAVE_VECTOR; \ | ||
103 | (last) = resume(prev, next, task_thread_info(next), __fpsave); \ | ||
104 | disable_msa(); \ | ||
93 | } while (0) | 105 | } while (0) |
94 | 106 | ||
95 | #define finish_arch_switch(prev) \ | 107 | #define finish_arch_switch(prev) \ |