diff options
Diffstat (limited to 'arch/mips/kernel/signal.c')
-rw-r--r-- | arch/mips/kernel/signal.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 8c3c5a5789b0..fa581192de21 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
@@ -113,10 +113,10 @@ int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | |||
113 | * Save FPU state to signal context. Signal handler | 113 | * Save FPU state to signal context. Signal handler |
114 | * will "inherit" current FPU state. | 114 | * will "inherit" current FPU state. |
115 | */ | 115 | */ |
116 | preempt_disable(); | ||
116 | own_fpu(1); | 117 | own_fpu(1); |
117 | enable_fp_in_kernel(); | ||
118 | err |= save_fp_context(sc); | 118 | err |= save_fp_context(sc); |
119 | disable_fp_in_kernel(); | 119 | preempt_enable(); |
120 | } | 120 | } |
121 | return err; | 121 | return err; |
122 | } | 122 | } |
@@ -148,7 +148,10 @@ check_and_restore_fp_context(struct sigcontext __user *sc) | |||
148 | err = sig = fpcsr_pending(&sc->sc_fpc_csr); | 148 | err = sig = fpcsr_pending(&sc->sc_fpc_csr); |
149 | if (err > 0) | 149 | if (err > 0) |
150 | err = 0; | 150 | err = 0; |
151 | preempt_disable(); | ||
152 | own_fpu(0); | ||
151 | err |= restore_fp_context(sc); | 153 | err |= restore_fp_context(sc); |
154 | preempt_enable(); | ||
152 | return err ?: sig; | 155 | return err ?: sig; |
153 | } | 156 | } |
154 | 157 | ||
@@ -187,11 +190,8 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | |||
187 | 190 | ||
188 | if (used_math) { | 191 | if (used_math) { |
189 | /* restore fpu context if we have used it before */ | 192 | /* restore fpu context if we have used it before */ |
190 | own_fpu(0); | ||
191 | enable_fp_in_kernel(); | ||
192 | if (!err) | 193 | if (!err) |
193 | err = check_and_restore_fp_context(sc); | 194 | err = check_and_restore_fp_context(sc); |
194 | disable_fp_in_kernel(); | ||
195 | } else { | 195 | } else { |
196 | /* signal handler may have used FPU. Give it up. */ | 196 | /* signal handler may have used FPU. Give it up. */ |
197 | lose_fpu(0); | 197 | lose_fpu(0); |