diff options
Diffstat (limited to 'arch/mips/kernel/process.c')
-rw-r--r-- | arch/mips/kernel/process.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 6ae540e133b2..60e39dc7f1eb 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/cpu.h> | 32 | #include <asm/cpu.h> |
33 | #include <asm/dsp.h> | 33 | #include <asm/dsp.h> |
34 | #include <asm/fpu.h> | 34 | #include <asm/fpu.h> |
35 | #include <asm/msa.h> | ||
35 | #include <asm/pgtable.h> | 36 | #include <asm/pgtable.h> |
36 | #include <asm/mipsregs.h> | 37 | #include <asm/mipsregs.h> |
37 | #include <asm/processor.h> | 38 | #include <asm/processor.h> |
@@ -65,6 +66,8 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp) | |||
65 | clear_used_math(); | 66 | clear_used_math(); |
66 | clear_fpu_owner(); | 67 | clear_fpu_owner(); |
67 | init_dsp(); | 68 | init_dsp(); |
69 | clear_thread_flag(TIF_MSA_CTX_LIVE); | ||
70 | disable_msa(); | ||
68 | regs->cp0_epc = pc; | 71 | regs->cp0_epc = pc; |
69 | regs->regs[29] = sp; | 72 | regs->regs[29] = sp; |
70 | } | 73 | } |
@@ -89,7 +92,9 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
89 | 92 | ||
90 | preempt_disable(); | 93 | preempt_disable(); |
91 | 94 | ||
92 | if (is_fpu_owner()) | 95 | if (is_msa_enabled()) |
96 | save_msa(p); | ||
97 | else if (is_fpu_owner()) | ||
93 | save_fp(p); | 98 | save_fp(p); |
94 | 99 | ||
95 | if (cpu_has_dsp) | 100 | if (cpu_has_dsp) |
@@ -157,7 +162,13 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
157 | /* Fill in the fpu structure for a core dump.. */ | 162 | /* Fill in the fpu structure for a core dump.. */ |
158 | int dump_fpu(struct pt_regs *regs, elf_fpregset_t *r) | 163 | int dump_fpu(struct pt_regs *regs, elf_fpregset_t *r) |
159 | { | 164 | { |
160 | memcpy(r, ¤t->thread.fpu, sizeof(current->thread.fpu)); | 165 | int i; |
166 | |||
167 | for (i = 0; i < NUM_FPU_REGS; i++) | ||
168 | memcpy(&r[i], ¤t->thread.fpu.fpr[i], sizeof(*r)); | ||
169 | |||
170 | memcpy(&r[NUM_FPU_REGS], ¤t->thread.fpu.fcr31, | ||
171 | sizeof(current->thread.fpu.fcr31)); | ||
161 | 172 | ||
162 | return 1; | 173 | return 1; |
163 | } | 174 | } |
@@ -192,7 +203,13 @@ int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) | |||
192 | 203 | ||
193 | int dump_task_fpu(struct task_struct *t, elf_fpregset_t *fpr) | 204 | int dump_task_fpu(struct task_struct *t, elf_fpregset_t *fpr) |
194 | { | 205 | { |
195 | memcpy(fpr, &t->thread.fpu, sizeof(current->thread.fpu)); | 206 | int i; |
207 | |||
208 | for (i = 0; i < NUM_FPU_REGS; i++) | ||
209 | memcpy(&fpr[i], &t->thread.fpu.fpr[i], sizeof(*fpr)); | ||
210 | |||
211 | memcpy(&fpr[NUM_FPU_REGS], &t->thread.fpu.fcr31, | ||
212 | sizeof(t->thread.fpu.fcr31)); | ||
196 | 213 | ||
197 | return 1; | 214 | return 1; |
198 | } | 215 | } |