diff options
author | David Daney <david.daney@cavium.com> | 2015-01-15 08:11:06 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-02-20 09:28:51 -0500 |
commit | d6e41525e356a8dc4b9ad6249a644d4123240881 (patch) | |
tree | a275601c4a4283de4494999f0520e91a3746fc3a /arch | |
parent | ac655fb7626ea63b12ee5f449a082c79db6d2f26 (diff) |
MIPS: OCTEON: Fix FP context save.
It wasn't being saved on task switch.
Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Aleksey Makarov <aleksey.makarov@auriga.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8934/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/kernel/octeon_switch.S | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/arch/mips/kernel/octeon_switch.S b/arch/mips/kernel/octeon_switch.S index 3dec1e8becf0..2787c014ec56 100644 --- a/arch/mips/kernel/octeon_switch.S +++ b/arch/mips/kernel/octeon_switch.S | |||
@@ -31,15 +31,11 @@ | |||
31 | /* | 31 | /* |
32 | * check if we need to save FPU registers | 32 | * check if we need to save FPU registers |
33 | */ | 33 | */ |
34 | PTR_L t3, TASK_THREAD_INFO(a0) | 34 | .set push |
35 | LONG_L t0, TI_FLAGS(t3) | 35 | .set noreorder |
36 | li t1, _TIF_USEDFPU | 36 | beqz a3, 1f |
37 | and t2, t0, t1 | 37 | PTR_L t3, TASK_THREAD_INFO(a0) |
38 | beqz t2, 1f | 38 | .set pop |
39 | nor t1, zero, t1 | ||
40 | |||
41 | and t0, t0, t1 | ||
42 | LONG_S t0, TI_FLAGS(t3) | ||
43 | 39 | ||
44 | /* | 40 | /* |
45 | * clear saved user stack CU1 bit | 41 | * clear saved user stack CU1 bit |
@@ -57,14 +53,13 @@ | |||
57 | 1: | 53 | 1: |
58 | 54 | ||
59 | /* check if we need to save COP2 registers */ | 55 | /* check if we need to save COP2 registers */ |
60 | PTR_L t2, TASK_THREAD_INFO(a0) | 56 | LONG_L t0, ST_OFF(t3) |
61 | LONG_L t0, ST_OFF(t2) | ||
62 | bbit0 t0, 30, 1f | 57 | bbit0 t0, 30, 1f |
63 | 58 | ||
64 | /* Disable COP2 in the stored process state */ | 59 | /* Disable COP2 in the stored process state */ |
65 | li t1, ST0_CU2 | 60 | li t1, ST0_CU2 |
66 | xor t0, t1 | 61 | xor t0, t1 |
67 | LONG_S t0, ST_OFF(t2) | 62 | LONG_S t0, ST_OFF(t3) |
68 | 63 | ||
69 | /* Enable COP2 so we can save it */ | 64 | /* Enable COP2 so we can save it */ |
70 | mfc0 t0, CP0_STATUS | 65 | mfc0 t0, CP0_STATUS |